Bug 1606875

Summary: gdal: FTBFS in Fedora rawhide
Product: [Fedora] Fedora Reporter: Mohan Boddu <mboddu>
Component: gdalAssignee: Pavel Raiskup <praiskup>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: alex, anto.trande, awilliam, devrim, jmlich83, loganjerry, mmahut, oliver, orion, pavel.lisy, pertusus, praiskup, thofmann, volker27
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-08-22 04:44:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1602938, 1604054, 1605475    
Attachments:
Description Flags
build.log
none
root.log
none
state.log none

Description Mohan Boddu 2018-07-20 22:02:40 UTC
gdal failed to build from source in Fedora rawhide

https://koji.fedoraproject.org/koji/taskinfo?taskID=28439835


For details on the mass rebuild see:

https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Please fix gdal at your earliest convenience and set the bug's status to
ASSIGNED when you start fixing it. If the bug remains in NEW state for 8 weeks,
gdal will be orphaned. Before branching of Fedora 30,
gdal will be retired, if it still fails to build.

For more details on the FTBFS policy, please visit:
https://fedoraproject.org/wiki/Fails_to_build_from_source

Comment 1 Mohan Boddu 2018-07-20 22:02:59 UTC
Created attachment 1469489 [details]
build.log

file build.log too big, will only attach last 32768 bytes

Comment 2 Mohan Boddu 2018-07-20 22:03:05 UTC
Created attachment 1469490 [details]
root.log

file root.log too big, will only attach last 32768 bytes

Comment 3 Mohan Boddu 2018-07-20 22:03:09 UTC
Created attachment 1469491 [details]
state.log

Comment 4 Jan Kurik 2018-08-14 08:44:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 5 Adam Williamson (Red Hat non-Fedora) 2018-08-14 19:37:04 UTC
The supposed fix for this didn't work, it's still FTBFS. I can see why Devrim thought just adding BuildRequires: gcc-c++ should fix this - it looks a lot like https://trac.osgeo.org/gdal/ticket/4436 - but even with that BuildRequires added (and I verified gcc-c++ really gets installed to the buildroot), the build fails with the "unable to infer tagged configuration" error...

Comment 6 Volker Fröhlich 2018-08-14 22:50:35 UTC
For reference: Building the latest version of gdal does not solve the problem.

https://koji.fedoraproject.org/koji/taskinfo?taskID=29074138

Comment 7 Volker Fröhlich 2018-08-15 11:21:38 UTC
--tag was removed from GDALmake.opt.in again in the same year (2012). What was added though in April of this year, is --silent. But that's not causing it.

Comment 8 Adam Williamson (Red Hat non-Fedora) 2018-08-15 15:40:18 UTC
Right, but the point of that ticket is, it turned out that the problem was happening in that case because configure was run without gcc-c++ installed. So it sure would seem to make sense that we had the same problem, and adding BuildRequires: gcc-c++ would fix things! Turns out it didn't, though.

Comment 9 Jerry James 2018-08-18 17:12:58 UTC
The problem is caused by line 361 of the spec file:

sed -i 's|@LIBTOOL@|%{_bindir}/libtool|g' GDALmake.opt.in

Instead of using the libtool script generated by ltmain.sh, the spec file is ignoring it and using /usr/bin/libtool.  That's wrong.  If you remove that line from the spec file, then the generated libtool script successfully produces the necessary --tag=CXX argument without any further assistance, because that is the only valid tag.

/usr/bin/libtool says:
available_tags='CXX F77 FC GO GCJ RC ' (so you have to say which tag you want)

generated libtool script says:
available_tags='CXX ' (there is only one tag, so that must be the one we want)

This spec file needs some TLC.  It has "rm -rf %{buildroot}" as the first line of %install, which should be removed.  It uses "%add_maven_depmap", which is deprecated.  It has license files listed under %doc instead of %license.  It could use the %py3_build and %py3_install macros to simplify things a bit.  There is probably more; that's what I saw just glancing through.

Also, after fixing the libtool problem, the build still fails due to bugs in %install.  First, lines 572-574 of the spec file say:

#TODO: Don't do that?
find %{buildroot}%{perl_vendorarch} -name "*.dox" -exec rm -rf '{}' \;
rm -f %{buildroot}%{perl_archlib}/perllocal.pod

The failure is:

+ find /builddir/build/BUILDROOT/gdal-2.3.1-2.fc30.x86_64/usr/lib64/perl5/vendor_perl -name '*.dox' -exec rm -rf '{}' ';'
find: '/builddir/build/BUILDROOT/gdal-2.3.1-2.fc30.x86_64/usr/lib64/perl5/vendor_perl': No such file or directory

That's because those files were installed into /usr/lib instead of /usr/lib64.  Also, there is an empty directory named /builddir/build/BUILDROOT/gdal-2.3.1-2.fc30.x86_64lib/python3.7/site-packages.  Note the absence of "/usr".

Comment 10 Pavel Raiskup 2018-08-20 06:46:38 UTC
Thanks for the analysis, I'll try to fix the FTBFS now at least.

Comment 11 Pavel Raiskup 2018-08-20 12:48:08 UTC
WIP PR https://src.fedoraproject.org/rpms/gdal/pull-request/7