Opened 14 years ago

Closed 14 years ago

#2411 closed bug (fixed)

FTBFS: qgsgrass.cpp + old grasses on Debian/Lenny

Reported by: hamish Owned by: nobody
Priority: major: does not work as expected Milestone: Version 1.6.0
Component: Build/Install Version: Trunk
Keywords: grass Cc:
Must Fix for Release: No Platform: Debian
Platform Version: Lenny amd64 Awaiting user input: yes

Description

Hi,

I'm still trying to compile trunk on Debian/Lenny using the supplied debian/control.lenny + debuild. (thanks for fixing #2400)

Now I'm getting this error:

[ 68%] Building CXX object src/providers/grass/CMakeFiles/qgisgrass.dir/qgsgrass.cpp.o
In file included from /usr/local/src/qgis/svn/trunk/src/providers/grass/qgsgrass.cpp:37:
/usr/lib/grass/include/grass/version.h:1: warning: deprecated conversion from string constant to 'char*'
/usr/lib/grass/include/grass/version.h:2: warning: deprecated conversion from string constant to 'char*'
/usr/lib/grass/include/grass/version.h:3: warning: deprecated conversion from string constant to 'char*'
/usr/lib/grass/include/grass/version.h:4: warning: deprecated conversion from string constant to 'char*'
/usr/local/src/qgis/svn/trunk/src/providers/grass/qgsgrass.cpp: In static member function 'static void QgsGrass::setLocation(QString, QString)':
/usr/local/src/qgis/svn/trunk/src/providers/grass/qgsgrass.cpp:342: error: invalid conversion from 'const char*' to 'char*'
/usr/local/src/qgis/svn/trunk/src/providers/grass/qgsgrass.cpp:342: error:   initializing argument 2 of 'int G__setenv(char*, char*)'
/usr/local/src/qgis/svn/trunk/src/providers/grass/qgsgrass.cpp:344: error: invalid conversion from 'const char*' to 'char*'
/usr/local/src/qgis/svn/trunk/src/providers/grass/qgsgrass.cpp:344: error:   initializing argument 2 of 'int G__setenv(char*, char*)'
make[3]: *** [src/providers/grass/CMakeFiles/qgisgrass.dir/qgsgrass.cpp.o] Error 1
make[3]: Leaving directory `/usr/local/src/qgis/svn/trunk/debian/build'
make[2]: *** [src/providers/grass/CMakeFiles/qgisgrass.dir/all] Error 2
make[2]: Leaving directory `/usr/local/src/qgis/svn/trunk/debian/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/src/qgis/svn/trunk/debian/build'
make: *** [build-stamp] Error 2
debuild: fatal error at line 1301:
couldn't exec fakeroot debian/rules: 

I have made these modifications to debian/rules:

$ svn diff trunk/debian/rules 
Index: trunk/debian/rules
===================================================================
--- trunk/debian/rules  (revision 12870)
+++ trunk/debian/rules  (working copy)
@@ -22,7 +22,7 @@
 
 CMAKE_OPTS := \
        -Wno-dev \
-       -D GRASS_PREFIX=/usr/lib/grass64 \
+       -D GRASS_PREFIX=/usr/local/src/grass/svn/grass65 \
        -D CMAKE_INSTALL_PREFIX=/usr \
        -D CMAKE_SKIP_RPATH=TRUE \
        -D BINDINGS_GLOBAL_INSTALL=TRUE \
@@ -147,12 +147,12 @@
        dh_installmime -pqgis
        dh_link
        if which dh_lintian >/dev/null; then dh_lintian; fi
-       dh_strip
+       #dh_strip
        dh_compress --exclude=pdf
        dh_fixperms
        dh_makeshlibs
        dh_installdeb
-       LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):/usr/lib/grass/lib:/usr/lib/grass64/lib dh_shlibdeps
+       LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):/usr/local/src/grass/svn/grass65/dist.x86_64-unknown-linux-gnu/lib dh_shlibdeps
        dh_gencontrol
        dh_md5sums
        dh_builddeb

the standard Debian/stable grass-dev package is installed (6.2.3-2.1) which is why /usr/lib/grass/include/grass/version.h is found. (in addition to about 5-6 other self-contained versions of grass on that machine)

How to get cmake to respect GRASS_PREFIX= for the include path as well as the library path?

thanks, Hamish

Attachments (2)

trunk_lenny_chages_2july2010.diff (6.6 KB ) - added by hamish 14 years ago.
current patch for attempting qgis build on debian/lenny + grass6.5
debuild.log.gz (113.0 KB ) - added by hamish 14 years ago.
tee'd debuild log showing dh_makeshlibs error

Download all attachments as: .zip

Change History (20)

comment:1 by hamish, 14 years ago

ah, trunk/debian/build/CMakeCache.txt:

//Path to a file.
GRASS_INCLUDE_DIR:PATH=/usr/lib/grass/include

//Path to GRASS base directory
GRASS_PREFIX:PATH=usr/local/src/grass/svn/grass65

(that base dir is supposed to be the installed ($GISBASE) dir not the source code base I guess)

with debian/rules changed to:

-       -D GRASS_PREFIX=/usr/lib/grass64 \
+       -D GRASS_PREFIX=/usr/local/src/grass/svn/grass65/dist.x86_64-unknown-linux-gnu \
+       -D GRASS_INCLUDE_DIR=/usr/local/src/grass/svn/grass65/dist.x86_64-unknown-linux-gnu/include \

and also to build for GRASS 6.5 I needed to make this symlink:

cd trunk/src/plugins/grass/
ln -s modules-6.4 modules-6.5

after fixing all that, I now get this error:

[ 93%] Building CXX object src/plugins/grass/CMakeFiles/grassplugin.dir/qgsgrassshell.cpp.o
/usr/local/src/qgis/svn/trunk/src/plugins/grass/qgsgrassshell.cpp: In constructor 'QgsGrassShell::QgsGrassShell(QgsGrassTools*, QTabWidget*, const char*)':
/usr/local/src/qgis/svn/trunk/src/plugins/grass/qgsgrassshell.cpp:69: error: 'class QStringList' has no member named 'length'
make[3]: *** [src/plugins/grass/CMakeFiles/grassplugin.dir/qgsgrassshell.cpp.o] Error 1
make[3]: Leaving directory `/usr/local/src/qgis/svn/trunk/debian/build'
make[2]: *** [src/plugins/grass/CMakeFiles/grassplugin.dir/all] Error 2
make[2]: Leaving directory `/usr/local/src/qgis/svn/trunk/debian/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/src/qgis/svn/trunk/debian/build'
make: *** [build-stamp] Error 2
debuild: fatal error at line 1301:
couldn't exec fakeroot debian/rules: 

progress, only 7% to go! :)

Hamish

comment:2 by hamish, 14 years ago

this seems to fix the 'class QStringList' has no member named 'length' error:

Index: src/plugins/grass/qgsgrassshell.cpp
===================================================================
--- src/plugins/grass/qgsgrassshell.cpp (revision 12941)
+++ src/plugins/grass/qgsgrassshell.cpp (working copy)
@@ -66,7 +66,7 @@
     {
       QString line = buf;
       QStringList kv = line.split ( ':' );
-      if ( kv.length() == 2 &&  kv.at(0) == "GRASS_GUI" ) 
+      if ( kv.size() == 2 &&  kv.at(0) == "GRASS_GUI" ) 
       {
         oldGui = kv.at(1).trimmed ();
         break;

and now it fails with:

dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs
dh_installexamples
dh_install --sourcedir=debian/tmp
cp: cannot stat `debian/tmp/usr/lib/libqgis_core.so.QGIS_ABI': No such file or directory
dh_install: command returned error code 256
make: *** [binary-arch] Error 1
debuild: fatal error at line 1301:
couldn't exec fakeroot debian/rules: 
trunk$ ls -l debian/tmp/usr/lib/libqgis_core.*        
lrwxrwxrwx ... 21 ... debian/tmp/usr/lib/libqgis_core.so -> libqgis_core.so.1.5.0
-rw-r--r-- ... 6457442 ... debian/tmp/usr/lib/libqgis_core.so.1.5.0

so apparently the "libqgis_core.so.QGIS_ABI" macro isn't being expanded?

Hamish

comment:3 by hamish, 14 years ago

ok, I ran 'debuild clean' and then 'svn status' to identify and clean out a few files in debian/ that it missed', and reran 'debuild binary'. This time it failed a little differently:

dh_install --sourcedir=debian/tmp
dh_install: Compatibility levels before 4 are deprecated.
cp: `debian/tmp//usr/bin/qgis_help' and `debian/tmp//usr/bin/qgis_help' are the same file
dh_install: command returned error code 256
make: *** [binary-arch] Error 1
debuild: fatal error at line 1301:
couldn't exec fakeroot debian/rules: 

?

thanks, Hamish

ps- these files should be cleaned but are not:

trunk/debian$ svn status
?      libqgis1.5.0.install
?      libqgis{QGIS_ABI}
?      python-qgis.install
?      libqgis1.5.0.lintian-overrides
?      python-qgis.lintian-overrides
?      qgis-plugin-grass.install
?      libqgis{QGIS_ABI}.debhelper.log
?      libqgis1.5.0.symbols
?      python-qgis.symbols
?      debhelper.log
?      qgis-plugin-grass.symbols
?      libqgis1.5.0
?      qgis.sh
?      compat
?      libqgis1.5.0-dev.install

and it is a bit annoying to have to copy debian/control.lenny back over the top of debian/control every single time you do anything.

comment:4 by hamish, 14 years ago

same debian/lenny. after svn up & rebuild:

$ debuild binary
[...]
dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs
dh_installexamples
dh_install --sourcedir=debian/tmp
cp: cannot stat `debian/tmp/usr/lib/libqgis_core.so.QGIS_ABI': No such file or directory
dh_install: command returned error code 256
make: *** [binary-arch] Error 1
debuild: fatal error at line 1301:
couldn't exec fakeroot debian/rules: 

{QGIS_ABI} should be replaced by 1.5.0 by rules, but for some reason is not.

ls -1 debian/tmp/usr/lib/libqgis_core.*

debian/tmp/usr/lib/libqgis_core.so@
debian/tmp/usr/lib/libqgis_core.so.1.5.0

?,

Hamish

comment:5 by pcav, 14 years ago

Is this still valid? Does it make sense to support Lenny, as our minimum requirements are getting higher, and release of Squeeze approaches?

in reply to:  5 ; comment:6 by hamish, 14 years ago

Replying to pcav:

Is this still valid?

Yes, as of latest r13426.

Today I didn't get as far as the linking-

I edited debian/rules to turn off spatialite, and CMakeLists.txt too just in case.

But it still dies:

$ cp debian/control.lenny debian/control
$ debuild binary
...
[ 40%] Building CXX object src/app/CMakeFiles/qgis.dir/qgsnewspatialitelayerdialog.cpp.o
In file included from /home/hamish/dev/qgis/svn/trunk/src/app/qgsnewspatialitelayerdialog.cpp:22:
/home/hamish/dev/qgis/svn/trunk/src/app/qgsnewspatialitelayerdialog.h:30:24: error: spatialite.h: No such file or directory
/home/hamish/dev/qgis/svn/trunk/src/app/qgsnewspatialitelayerdialog.cpp: In member function 'bool QgsNewSpatialiteLayerDialog::apply()':
/home/hamish/dev/qgis/svn/trunk/src/app/qgsnewspatialitelayerdialog.cpp:297: error: 'spatialite_init' was not declared in this scope
make[3]: *** [src/app/CMakeFiles/qgis.dir/qgsnewspatialitelayerdialog.cpp.o] Error 1
make[3]: Leaving directory `/home/hamish/dev/qgis/svn/trunk/debian/build'
make[2]: *** [src/app/CMakeFiles/qgis.dir/all] Error 2
make[2]: Leaving directory `/home/hamish/dev/qgis/svn/trunk/debian/build'
make[1]: *** [all] Error 2
...

missing #ifdef in the .cpp or CMakeLists.txt rule? (fwiw I'm not a cmake expert)

Does it make sense to support Lenny,

Yes please, it does. For work reasons etc. not everyone has the luxury (or desire) to change OSs on the shared machines they need to work on, to the latest-greatest testing release.. especially when it is just for one app.

I would accept using an older version on an older OS, but so far the most modern version I can build for Lenny is 1.2.0. :-/

thanks, Hamish

in reply to:  6 ; comment:7 by jef, 14 years ago

Did you add a changelog entry stating that you are building for lenny? otherwise it falls back to sid.

in reply to:  7 ; comment:8 by hamish, 14 years ago

Replying to jef:

Did you add a changelog entry stating that you are building for lenny? otherwise it falls back to sid.

I hadn't, but I had edited the rules file to set to FALSE even in that sid+= logic. (everywhere grep could find it being set to TRUE)

Now changed to:

--- debian/changelog    (revision 13427)
+++ debian/changelog    (working copy)
@@ -1,4 +1,4 @@
-qgis (1.5.0) UNRELEASED; urgency=low
+qgis (1.5.0.lenny) stable; urgency=low

but it still ignores WITH_SPATIALITE=FALSE & dies in the same place.

thanks, Hamish

in reply to:  8 comment:9 by jef, 14 years ago

Replying to hamish:

but it still ignores WITH_SPATIALITE=FALSE & dies in the same place.

The default is to build with internal spatialite when not building for sid. Anything wrong with that? Otherwise you also need to tweak the .install files and apply the hardy patches to get the grass plugin compiled with GRASS 6.2.

Still spatialite should be optional: fixed in r13429.

in reply to:  4 ; comment:10 by jef, 14 years ago

Replying to hamish:

{QGIS_ABI} should be replaced by 1.5.0 by rules, but for some reason is not.

You're supposed to add a changelog entry with distribution lenny (not stable) and the rules will rebuild control from control.lenny replacing {QGIS_ABI} (and {GRASS_ABI}).

in reply to:  10 ; comment:11 by hamish, 14 years ago

Replying to jef:

Still spatialite should be optional: fixed in r13429.

great, I get past that .cpp file now, thanks.

Replying to jef:

You're supposed to add a changelog entry with distribution lenny (not stable)

"supposed"? as in specific to the qgis build scripts, right? for previous backports of other software I've used the unstable/ testing/ stable/ old-stable names without problem.

and the rules will rebuild control from control.lenny replacing {QGIS_ABI} (and {GRASS_ABI}).

ok, done that. Now it gets past the main build but I get a weird linking error I've not seen before. Here's the end of it:

...
- _ZThn8_N20QgsMapOverviewCanvasD0Ev@Base 1.5.0
- _ZThn8_N20QgsMapOverviewCanvasD1Ev@Base 1.5.0
- _ZThn8_N21QgsDetailedItemWidgetD0Ev@Base 1.5.0
- _ZThn8_N21QgsDetailedItemWidgetD1Ev@Base 1.5.0
- _ZThn8_N21QgsEncodingFileDialogD0Ev@Base 1.5.0
- _ZThn8_N21QgsEncodingFileDialogD1Ev@Base 1.5.0
- _ZThn8_N21QgsProjectionSelectorD0Ev@Base 1.5.0
- _ZThn8_N21QgsProjectionSelectorD1Ev@Base 1.5.0
- _ZThn8_N28QgsGenericProjectionSelectorD0Ev@Base 1.5.0
- _ZThn8_N28QgsGenericProjectionSelectorD1Ev@Base 1.5.0
+ _ZThn40_N19QgsCredentialDialog7requestE7QStringRS0_S1_S0_@Base 1.5.0.lenny
+ _ZThn40_N19QgsCredentialDialogD0Ev@Base 1.5.0.lenny
+ _ZThn40_N19QgsCredentialDialogD1Ev@Base 1.5.0.lenny
+#MISSING: 1.5.0.lenny# _ZThn8_N12QgsMapCanvasD0Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N12QgsMapCanvasD1Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N14QgsColorButtonD0Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N14QgsColorButtonD1Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N15QgsComposerViewD0Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N15QgsComposerViewD1Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N15QgsFileDropEditD0Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N15QgsFileDropEditD1Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N16QgsMessageViewerD0Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N16QgsMessageViewerD1Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N16QgsPanningWidgetD0Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N16QgsPanningWidgetD1Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N20QgsMapOverviewCanvasD0Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N20QgsMapOverviewCanvasD1Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N21QgsDetailedItemWidgetD0Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N21QgsDetailedItemWidgetD1Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N21QgsEncodingFileDialogD0Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N21QgsEncodingFileDialogD1Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N21QgsProjectionSelectorD0Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N21QgsProjectionSelectorD1Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N28QgsGenericProjectionSelectorD0Ev@Base 1.5.0
+#MISSING: 1.5.0.lenny# _ZThn8_N28QgsGenericProjectionSelectorD1Ev@Base 1.5.0
  _ZZN11QMetaTypeIdI19QgsDetailedItemDataE14qt_metatype_idEvE11metatype_id@Base 1.5.0
+ _ZZN11QMetaTypeIdI5QListIP7QWidgetEE14qt_metatype_idEvE11metatype_id@Base 1.5.0.lenny
+ _ZdlPvS_@Base 1.5.0.lenny
+ _Zeq5QCharS_@Base 1.5.0.lenny
+ _ZeqN7QString4NullERKS_@Base 1.5.0.lenny
+ _ZeqPKcRK7QString@Base 1.5.0.lenny
+ _ZmiRK6QPointS1_@Base 1.5.0.lenny
+ _ZmiRK7QPointFS1_@Base 1.5.0.lenny
+ _ZneRK5QSizeS1_@Base 1.5.0.lenny
+ _ZnwmPv@Base 1.5.0.lenny
+ _ZorN11QMessageBox14StandardButtonES0_@Base 1.5.0.lenny
+ _ZorN16QDialogButtonBox14StandardButtonES0_@Base 1.5.0.lenny
+ _ZorN17QAbstractItemView11EditTriggerES0_@Base 1.5.0.lenny
+ _ZorN2Qt13AlignmentFlagES0_@Base 1.5.0.lenny
+ _ZorN2Qt8ItemFlagES0_@Base 1.5.0.lenny
+ _ZorN2Qt9MatchFlagES0_@Base 1.5.0.lenny
  _ZplPKcRK7QString@Base 1.5.0
+ _ZplRK7QPointFS1_@Base 1.5.0.lenny
+ _ZplRK7QString5QChar@Base 1.5.0.lenny
  _ZplRK7QStringPKc@Base 1.5.0
+ _ZplRK7QStringS1_@Base 1.5.0.lenny
  capture_point_cursor@Base 1.5.0
  cross_hair_cursor@Base 1.5.0
  identify_cursor@Base 1.5.0
dh_makeshlibs: command returned error code 256
make: *** [binary-arch] Error 1
debuild: fatal error at line 1301:
couldn't exec fakeroot debian/rules: 

Apparently errors >3000 lines long so the start of it is beyond my terminal buffer. I can rerun tee'ing stderr to a file if it helps.

thanks, Hamish

in reply to:  11 ; comment:12 by jef, 14 years ago

Replying to hamish:

Replying to jef:

You're supposed to add a changelog entry with distribution lenny (not stable)

"supposed"? as in specific to the qgis build scripts, right? for previous backports of other software I've used the unstable/ testing/ stable/ old-stable names without problem.

Right. The distribution name in the changelog determines which template files are used to build the package...

ok, done that. Now it gets past the main build but I get a weird linking error I've not seen before. Here's the end of it:

That's not a link error. dh_makeshlibs complains about missing symbols in the shared library. But that's just due to the different Qt version in lenny. I dropped that altogether in r13438.

comment:13 by pcav, 14 years ago

Milestone: Version 1.5.0Version 1.6.0

in reply to:  12 ; comment:14 by jef, 14 years ago

Awaiting user input: set

Replying to jef:

That's not a link error. dh_makeshlibs complains about missing symbols in the shared library. But that's just due to the different Qt version in lenny. I dropped that altogether in r13438.

Hamish, did that work for you, too?

by hamish, 14 years ago

current patch for attempting qgis build on debian/lenny + grass6.5

in reply to:  14 comment:15 by hamish, 14 years ago

Replying to jef:

Replying to jef:

That's not a link error. dh_makeshlibs complains about missing symbols in the shared library. But that's just due to the different Qt version in lenny. I dropped that altogether in r13438.

Hamish, did that work for you, too?

nope, I still get the error shown in comment:11. I've attached to this ticket the current svn diff from latest trunk needed to start the build on Debian/Lenny + GRASS 6.5svn.

thanks, Hamish

by hamish, 14 years ago

Attachment: debuild.log.gz added

tee'd debuild log showing dh_makeshlibs error

comment:16 by hamish, 14 years ago

attached debuild log showing dh_makeshlibs error to ticket. see:

dpkg-gensymbols: warning: some new symbols appeared in the symbols file: see diff output below
dpkg-gensymbols: warning: some symbols disappeared in the symbols file: see diff output below
dpkg-gensymbols: warning: debian/libqgis1.5.0/DEBIAN/symbols doesn't match completely debian/libqgis1.5.0.symbols
[...]
dh_makeshlibs: command returned error code 256
make: *** [binary-arch] Error 1
debuild: fatal error at line 1301:
couldn't exec fakeroot debian/rules: 

in reply to:  16 comment:17 by jef, 14 years ago

Replying to hamish:

attached debuild log showing dh_makeshlibs error to ticket. see:

Remove the symbol files - those are leftovers created from templates, that have been removed in r13438.

comment:18 by hamish, 14 years ago

Resolution: fixed
Status: newclosed

ok, I had run "debuild clean" but I guess it missed those old files.

"svn status" showed that debian/qgis-plugin-grass.symbols, libqgis1.5.0.symbols, python-qgis.symbols were extra so I removed those and restored the missing debian/qgis-plugin-grass-common.install file.

after that, tried rebuilding the package and it worked. hurray!

so svn trunk r13867 now builds + installs .debs on Lenny. test of loading shapefile, geotiff, and PostGIS db worked. closing bug.

thanks for your help, Hamish

Note: See TracTickets for help on using tickets.