ARPA-SIMC / meteosatlib

OpenMTP/HRI/HRIT C++ access libraries, gdal drivers and other tools
GNU General Public License v2.0
8 stars 2 forks source link

`gdal-config`: command not found #30

Open brancomat opened 2 years ago

brancomat commented 2 years ago

This message occurs in every build (centos7/rocky8/fedora):

Start: rpmbuild -bs
sh: gdal-config: command not found
sh: gdal-config: command not found
sh: gdal-config: command not found
sh: gdal-config: command not found
sh: gdal-config: command not found
sh: gdal-config: command not found
sh: gdal-config: command not found

Full log: https://download.copr.fedorainfracloud.org/results/simc/stable/epel-8-x86_64/04438391-meteosatlib/builder-live.log.gz

gdal-config seems to be present:

checking for gdal-config... /usr/bin/gdal-config

It's invoked in two separate points, it seems the specfile call is failing:

$ git grep gdal-config
configure.ac:AC_PATH_PROG([GDAL_CONFIG], [gdal-config], [NONE])
configure.ac:        GDAL_PLUGIN_DIRNAME=gdalplugins/$(gdal-config --version | sed -re ['s/([0-9]+\.[0-9]+).+/\1/'])
fedora/SPECS/meteosatlib.spec:%define gdal_pl_version %(gv=$(gdal-config --version); echo ${gv%.*})
edigiacomo commented 2 years ago

I don't know that error message comes from, but I don't think it's from configure.ac or the spec file:

%define gdal_pl_version %(gv=$(gdal-config --version); echo ${gv%.*})
...
%files gdal
%defattr(-,root,root,-)
%{_libdir}/gdalplugins/%{gdal_pl_version}/gdal_Meteosatlib.a
%{_libdir}/gdalplugins/%{gdal_pl_version}/gdal_Meteosatlib.la
%{_libdir}/gdalplugins/%{gdal_pl_version}/gdal_Meteosatlib.so
%{_libdir}/gdalplugins/%{gdal_pl_version}/gdal_Meteosatlib.so.0
%{_libdir}/gdalplugins/%{gdal_pl_version}/gdal_Meteosatlib.so.0.0.0
spanezz commented 2 years ago

Abbiamo modo di riprodurlo nella nostra infrastruttura?

brancomat commented 2 years ago

I investigated the issue a bit with the mighty help of moncic-ci, it turned out that it was the specfile, but in a kind of unexpected way.

Logs are a bit clearer in moncic-ci builds (https://simc.arpae.it/moncic-ci/meteosatlib/last/master/fedora34/build.log): in short it's the dnf builddep command that seems to evaluate some spec macros and since gdal is not present, the gdal-config invocation on line 89 gives the error. The subsequent launch of rpmbuild, having all the dependencies, works correctly.

I took a quick look at the (very scarce) documentation trying to find a decent syntax to test the gdal-config presence in a conditional macro in a way that gives no warnings for dnf builddep and a clear error during the build itself, but so far I only got labyrinthitis.

I'll keep the issue open for a bit, long story short we can safely ignore the error.