Opened 3 years ago

Closed 17 months ago

#63414 closed defect (fixed)

gdal @3.3.1: opportunistically uses libheif which causes destroot failure when building universal

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: Veence (Vincent)
Priority: Normal Milestone:
Component: ports Version: 2.7.99
Keywords: Cc: Dave-Allured (Dave Allured), mascguy (Christopher Nielsen), cooljeanius (Eric Gallager)
Port: gdal

Description

On High Sierra where the universal archs are i386 and x86_64, building gdal with the universal variant fails when the libheif port is installed without the universal variant:

--->  Staging gdal into destroot
Error: Failed to destroot gdal: gdal-config differs in /opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-ryandesign-fork_gis_gdal/gdal/work/destroot-i386//opt/local/bin and /opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-ryandesign-fork_gis_gdal/gdal/work/destroot-x86_64//opt/local/bin and cannot be merged

The difference between the two gdal-config files is:

$ diff -u destroot-{i386,x86_64}/opt/local/bin/gdal-config
--- destroot-i386/opt/local/bin/gdal-config	2021-08-28 02:43:15.000000000 -0500
+++ destroot-x86_64/opt/local/bin/gdal-config	2021-08-28 02:43:05.000000000 -0500
@@ -1,13 +1,13 @@
 #!/bin/sh
 CONFIG_LIBS="-L/opt/local/lib -lgdal"
-CONFIG_DEP_LIBS="-lcrypto  -lqhull -lqhull -L/opt/local/lib -lgeos_c -L/opt/local/lib -lwebp -L/opt/local/lib -lexpat -lgif -lcharls -lpng -L/opt/local/lib/postgresql12 -lpq -lzstd -L/opt/local/lib/proj7/lib -lproj  -L/opt/local/lib -lsqlite3 -lz -lpthread -ldl  -L/usr/local/lib -lpcre -lLerc   -L/opt/local/lib -lcurl          -liconv  -L/opt/local/lib -lxml2      "
+CONFIG_DEP_LIBS="-L/opt/local/lib -lheif -lcrypto  -lqhull -lqhull -L/opt/local/lib -lgeos_c -L/opt/local/lib -lwebp -L/opt/local/lib -lexpat -lgif -lcharls -lpng -L/opt/local/lib/postgresql12 -lpq -lzstd -L/opt/local/lib/proj7/lib -lproj  -L/opt/local/lib -lsqlite3 -lz -lpthread -ldl  -L/usr/local/lib -lpcre -lLerc   -L/opt/local/lib -lcurl          -liconv  -L/opt/local/lib -lxml2      "
 CONFIG_PREFIX="/opt/local"
 CONFIG_CFLAGS="-I/opt/local/include"
 CONFIG_DATA="/opt/local/share/gdal"
 CONFIG_VERSION="3.3.1"
 CONFIG_OGR_ENABLED=yes
 CONFIG_GNM_ENABLED=yes
-CONFIG_FORMATS="derived gtiff hfa mem vrt  adrg aigrid airsar arg blx bmp bsb cals ceos ceos2 coasp cosar ctg dimap dted elas envisat ers esric fit gff gsg gxf hf2 idrisi ilwis ingr iris iso8211 jaxapalsar jdem l1b leveller map mrf msgn ngsgeoid nitf northwood pds prf r raw rmf rs2 safe saga sdts sentinel2 sgi sigdem srtmhgt terragen tga til tsx usgsdem xpm xyz zmap eeda plmosaic rda wcs wms wmts daas ogcapi rasterlite mbtiles grib webp gif png pcraster jpeg  pcidsk postgisraster jpegls"
+CONFIG_FORMATS="derived gtiff hfa mem vrt  adrg aigrid airsar arg blx bmp bsb cals ceos ceos2 coasp cosar ctg dimap dted elas envisat ers esric fit gff gsg gxf hf2 idrisi ilwis ingr iris iso8211 jaxapalsar jdem l1b leveller map mrf msgn ngsgeoid nitf northwood pds prf r raw rmf rs2 safe saga sdts sentinel2 sgi sigdem srtmhgt terragen tga til tsx usgsdem xpm xyz zmap eeda plmosaic rda wcs wms wmts daas ogcapi rasterlite mbtiles grib heif webp gif png pcraster jpeg  pcidsk postgisraster jpegls"
 usage()
 {
 	cat <<EOF

So gdal has detected that libheif is installed and has decided to use it even though the port does not declare a dependency on it.

My suggested fix for this problem is that you modify gdal so that it does not try to use libheif even if it is installed. Increase the revision to ensure that no installed copies of gdal were inadvertently built with libheif support.

The other possible solution—add libheif as a dependency so gdal uses it always—doesn't fix this problem in that it would prevent gdal from being installed for architectures other than arm64 and x86_64 because libheif depends on rav1e which uses cargo and rust which cannot be installed for architectures other than arm64 and x86_64; see #62650. Or we could first fix that ticket so that libheif only depends on rav1e on the architectures where that's possible, then change gdal so that it always depends on libheif.

Change History (5)

comment:1 Changed 3 years ago by Veence (Vincent)

Thanks for reporting that. Given that adding libheif as a fixed dependency could cause GDAL not to compile on some platforms, I’ll add a new variant for it.

comment:2 Changed 3 years ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added

comment:3 Changed 3 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:4 Changed 3 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:5 Changed 17 months ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.