Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdal-config: command not found #30

Open
brancomat opened this issue May 24, 2022 · 3 comments
Open

gdal-config: command not found #30

brancomat opened this issue May 24, 2022 · 3 comments
Assignees
Labels

Comments

@brancomat
Copy link
Member

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
Copy link
Member

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

  • If the error was in configure.ac, the gdal support would be disabled (but it's enabled):
 AC_PATH_PROG([GDAL_CONFIG], [gdal-config], [NONE])
if test "x$GDAL_CONFIG" == "xNONE"; then
    have_gdal="no"
    AC_MSG_WARN("*** GDAL support disabled")
  • If the error was in the specfile, the variable gdal_pl_version wouldn't be set and the rpm build would fail, because it wouldn't find the gdal_Meteosatlib.* files in %{_libdir}/gdalplugins/ directory:
%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
Copy link
Contributor

spanezz commented Jun 15, 2022

Abbiamo modo di riprodurlo nella nostra infrastruttura?

@brancomat
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants