Skip site navigation (1) Skip section navigation (2)

Re: wxWidgets 2.9 build

From: Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, Guillaume Lelarge <guillaume(at)lelarge(dot)info>, pgadmin-hackers(at)postgresql(dot)org
Subject: Re: wxWidgets 2.9 build
Date: 2011-01-23 14:46:09
Message-ID: AANLkTikNMZjbEzpCEP+orFfuA_-COAjQkojh2byK6E0n@mail.gmail.com (view raw or flat)
Thread:
Lists: pgadmin-hackers
On 23 January 2011 12:58, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
>> Why do we ship a copy of FlexLexer.h from a specific version of
>> flex++? Are we really that sensitive to the differences in Flex
>> versions? Is the easiest thing to get pgadmin to build after changing
>> the pgscript grammar to use flex 2.5.33, as perhaps suggested in
>> ./pgadmin3/pgadmin/pgscript/README?
>
> Isn't that part of the "ship the bison/flex output files" thing? We
> ship lex.pgs.cc parser.tab.cc as well, and that's where the dependency
> comes from. So we need to ship either both of them or none of them, I
> think.

Right, I see your point.

> I don't recall exactly why it was, but the README is pretty specific
> about the fact that it *is* sensitive. So the version used to generate
> the .cc files should be the same as the one used for the .h....

Actually, I would say that the README isn't very clear on that at all
- it just indicates that non 2.5.33 Flex will invalidate the shipped
FlexLexer.h. However, I suppose despite what you've said about
FlexLexer.h, the fact that we ship what is supposed to be a system
header makes whether or not we're sensitive to Flex version less
clear.

We ship a shell script, "parser.sh", that does it all for us. Example:

cd ./.. ... done
/home/peter/pgadmin3/pgadmin

+ Generating Bison output... done
+ Generating Flex output... done
+ Processing Flex output... done
+ Processing Bison output... done
+ Moving Bison header files...
    + mv pgscript/location.hh include/pgscript/location.hh
    + mv pgscript/parser.tab.hh include/pgscript/parser.tab.hh
    + mv pgscript/position.hh include/pgscript/position.hh
    + mv pgscript/stack.hh include/pgscript/stack.hh
... done

This updates both  lex.pgs.cc and parser.tab.cc . I now run Make
--ignore, and see errors about various structs only having
declarations and not definitions available. Here it is:

g++ -DHAVE_CONFIG_H -I. -I..   -I/usr/local/pgsql/include
-I/usr/local/pgsql/include -DHAVE_CONNINFO_PARSE
-I/usr/local/lib/wx/include/gtk2-unicode-2.9
-I/usr/local/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL
-D__WXGTK__ -O2 -DEMBED_XRC -I/usr/include/libxml2
-I/usr/include/libxml2
-DDATA_DIR=\"/usr/local/pgadmin3/share/pgadmin3/\" -Wall
-Wno-non-virtual-dtor -fno-strict-aliasing -I../pgadmin/include   -MT
lex.pgs.o -MD -MP -MF .deps/lex.pgs.Tpo -c -o lex.pgs.o `test -f
'./pgscript/lex.pgs.cc' || echo './'`./pgscript/lex.pgs.cc
In file included from pgscript/pgsScanner.ll:17:0:
pgscript/pgsParser.yy:109:2: error: ‘pgsExpression’ does not name a type
pgscript/pgsParser.yy:110:2: error: ‘pgsStmt’ does not name a type
pgscript/pgsParser.yy:111:2: error: ‘pgsStmtList’ does not name a type
make[2]: [lex.pgs.o] Error 1 (ignored)
mv -f .deps/lex.pgs.Tpo .deps/lex.pgs.Po
mv: cannot stat `.deps/lex.pgs.Tpo': No such file or directory
make[2]: [lex.pgs.o] Error 1 (ignored)
g++ -DHAVE_CONFIG_H -I. -I..   -I/usr/local/pgsql/include
-I/usr/local/pgsql/include -DHAVE_CONNINFO_PARSE
-I/usr/local/lib/wx/include/gtk2-unicode-2.9
-I/usr/local/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL
-D__WXGTK__ -O2 -DEMBED_XRC -I/usr/include/libxml2
-I/usr/include/libxml2
-DDATA_DIR=\"/usr/local/pgadmin3/share/pgadmin3/\" -Wall
-Wno-non-virtual-dtor -fno-strict-aliasing -I../pgadmin/include   -MT
pgsCast.o -MD -MP -MF .deps/pgsCast.Tpo -c -o pgsCast.o `test -f
'./pgscript/expressions/pgsCast.cpp' || echo
'./'`./pgscript/expressions/pgsCast.cpp
In file included from ./pgscript/expressions/pgsCast.cpp:17:0:
pgscript/pgsParser.yy:110:2: error: ‘pgsStmt’ does not name a type
pgscript/pgsParser.yy:111:2: error: ‘pgsStmtList’ does not name a type
./pgscript/expressions/pgsCast.cpp: In member function ‘virtual
pgsOperand pgsCast::eval(pgsVarMap&) const’:
./pgscript/expressions/pgsCast.cpp:94:23: error: invalid use of
incomplete type ‘struct pgsRecord’
../pgadmin/include/pgscript/objects/pgsVariable.h:19:7: error: forward
declaration of ‘struct pgsRecord’
./pgscript/expressions/pgsCast.cpp:96:23: error: invalid use of
incomplete type ‘struct pgsString’
../pgadmin/include/pgscript/objects/pgsVariable.h:20:7: error: forward
declaration of ‘struct pgsString’
make[2]: [pgsCast.o] Error 1 (ignored)
mv -f .deps/pgsCast.Tpo .deps/pgsCast.Po
mv: cannot stat `.deps/pgsCast.Tpo': No such file or directory
make[2]: [pgsCast.o] Error 1 (ignored)
g++ -DHAVE_CONFIG_H -I. -I..   -I/usr/local/pgsql/include
-I/usr/local/pgsql/include -DHAVE_CONNINFO_PARSE
-I/usr/local/lib/wx/include/gtk2-unicode-2.9
-I/usr/local/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL
-D__WXGTK__ -O2 -DEMBED_XRC -I/usr/include/libxml2
-I/usr/include/libxml2
-DDATA_DIR=\"/usr/local/pgadmin3/share/pgadmin3/\" -Wall
-Wno-non-virtual-dtor -fno-strict-aliasing -I../pgadmin/include   -MT
pgsDriver.o -MD -MP -MF .deps/pgsDriver.Tpo -c -o pgsDriver.o `test -f
'./pgscript/utilities/pgsDriver.cpp' || echo
'./'`./pgscript/utilities/pgsDriver.cpp
In file included from ../pgadmin/include/pgscript/utilities/pgsScanner.h:33:0,
                 from ../pgadmin/include/pgscript/utilities/pgsDriver.h:15,
                 from ./pgscript/utilities/pgsDriver.cpp:12:
pgscript/pgsParser.yy:109:2: error: ‘pgsExpression’ does not name a type
pgscript/pgsParser.yy:110:2: error: ‘pgsStmt’ does not name a type
pgscript/pgsParser.yy:111:2: error: ‘pgsStmtList’ does not name a type
./pgscript/utilities/pgsDriver.cpp: In member function ‘bool
pgscript::pgsDriver::parse_stream(std::istream&)’:
./pgscript/utilities/pgsDriver.cpp:42:9: error: ‘class
pgscript::pgsParser’ has no member named ‘set_debug_level’
./pgscript/utilities/pgsDriver.cpp: In member function ‘void
pgscript::pgsDriver::error(const pgscript::location&, const
wxString&)’:
./pgscript/utilities/pgsDriver.cpp:75:9: error: invalid use of
incomplete type ‘struct pgsContext’
../pgadmin/include/pgscript/utilities/pgsDriver.h:19:7: error: forward
declaration of ‘struct pgsContext’
make[2]: [pgsDriver.o] Error 1 (ignored)
mv -f .deps/pgsDriver.Tpo .deps/pgsDriver.Po
mv: cannot stat `.deps/pgsDriver.Tpo': No such file or directory
make[2]: [pgsDriver.o] Error 1 (ignored)


It's as various #includes are absent from various CPP files. I hack
the files listed in those various cpp files and add includes (mostly
the ones in pgsParset.yy, but some others - haven't bothered to
isolate anything), and everything seems to work fine.


Now, the only remaining error message is that prevents us from
compiling the only missing object file, pgsDriver.o, is:
./pgscript/utilities/pgsDriver.cpp: In member function ‘bool
pgscript::pgsDriver::parse_stream(std::istream&)’:
./pgscript/utilities/pgsDriver.cpp:49:9: error: ‘class
pgscript::pgsParser’ has no member named ‘set_debug_level’

The class pgsParser very clearly does not have a member named
set_debug_level, so it's hard to argue with that.

How would everyone feel about committing my work without Flex/Bison
changes, and without worrying about how we'll eventually handle OGL?
I'll verify that I haven't somehow broken wx 2.8 compatibility today,
and then produce a new patch.

-- 
Regards,
Peter Geoghegan

In response to

Responses

pgadmin-hackers by date

Next:From: Magnus HaganderDate: 2011-01-23 14:56:43
Subject: Re: wxWidgets 2.9 build
Previous:From: Magnus HaganderDate: 2011-01-23 12:58:38
Subject: Re: wxWidgets 2.9 build

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group