nix-community / poetry2nix

Convert poetry projects to nix automagically [maintainer=@adisbladis,@cpcloud]
MIT License
876 stars 448 forks source link

Can't build GDAL 3.5.0 #647

Closed l0b0 closed 1 year ago

l0b0 commented 2 years ago

Describe the issue

GDAL 3.5.0 fails to build with a recent version of poetry2nix due to a missing GDT_UInt64 symbol.

Workaround: Install the version available in the relevant nixpkgs version. That is, put GDAL = "3.4.2" in pyproject.toml if using today's nixpkgs, or 3.3.2 if using stable 21.11.

Additional context

let poetryEnv = pkgs.poetry2nix.mkPoetryEnv { python = pkgs.python3; projectDir = ./.; }; in poetryEnv.env


- `pyproject.toml`

[tool.poetry] name = "tmp.3coi1jnsnh" version = "0.1.0" description = "" authors = ["Victor Engmark vengmark@linz.govt.nz"]

[tool.poetry.dependencies] python = "^3.9" GDAL = "^3.5.0"

[tool.poetry.dev-dependencies]

[build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api"


- `poetry.lock`

[[package]] name = "gdal" version = "3.5.0" description = "GDAL: Geospatial Data Abstraction Library" category = "main" optional = false python-versions = ">=3.6.0"

[package.extras] numpy = ["numpy (>1.0.0)"]

[metadata] lock-version = "1.1" python-versions = "^3.9" content-hash = "c83ad22349b565b9008b3d3f5e336192dfb2077cd6d96a2961b18b14477a97df"

[metadata.files] gdal = [ {file = "GDAL-3.5.0.tar.gz", hash = "sha256:cd57c9534c8d437045649a3919349e099451ead5f11d17cf39261db1e129d7b5"}, ]


Log:

$ nix-shell these derivations will be built: /nix/store/hmhibj2ra8hlaxphfw4w5m49a6qrfq5i-python3.9-gdal-3.5.0.drv /nix/store/9mspl6i8knq63w0zw21jy2q8zid8x1pg-python3-3.9.12-env.drv these paths will be fetched (3.37 MiB download, 17.97 MiB unpacked): /nix/store/1sfi6g28wym879nsjsxra8gfimnz934q-python3.9-packaging-21.3 /nix/store/2wcvnyznab8ysnwn9d377z0is2s3zfby-python-imports-check-hook.sh /nix/store/4m4hm78mas015yzfpiqi7pzh93vb371q-pip-build-hook.sh /nix/store/4ppnl4w8c3q4yk7y5v5hfncpflqv7xcs-python3.9-setuptools-scm-6.4.2 /nix/store/62va3ispxg0xp7vqzjpjwmalpv4iqp50-python3.9-setuptools-61.2.0 /nix/store/7p9qka9f7ciwl6k9rl988v5x5cixdv5g-python3.9-tomli-2.0.1 /nix/store/d5ll8w6x4b75rid43s6hfwf7hlxcsqbk-python3.9-pip-22.0.4 /nix/store/dafysaw1dmcsvp76w2hzypi9dqxjmf2v-fixup-hook.sh /nix/store/l3aisjysngq059jli6r733hqbk629nkk-python-remove-tests-dir-hook /nix/store/nbkxm14n1q6pgkrafkhm87c5agnl217p-hook /nix/store/pglav05zraisif7y050mcmygmh698acr-python-catch-conflicts-hook /nix/store/phrmh4qspw91qik3xic65ncfg4jfhppz-python3.9-pyparsing-3.0.9 /nix/store/q9fp55p5hrky0mb5323lb3wr41a5sb22-python3.9-wheel-0.37.1 /nix/store/sg7d1rnz3bmfyll16pm79pgpnwsddd5s-python-namespaces-hook.sh /nix/store/wwcbzpc6xj3dsdwgrcgl8sxilch3mkzv-pip-install-hook copying path '/nix/store/62va3ispxg0xp7vqzjpjwmalpv4iqp50-python3.9-setuptools-61.2.0' from 'https://cache.nixos.org'... copying path '/nix/store/dafysaw1dmcsvp76w2hzypi9dqxjmf2v-fixup-hook.sh' from 'https://cache.nixos.org'... copying path '/nix/store/l3aisjysngq059jli6r733hqbk629nkk-python-remove-tests-dir-hook' from 'https://cache.nixos.org'... copying path '/nix/store/nbkxm14n1q6pgkrafkhm87c5agnl217p-hook' from 'https://cache.nixos.org'... copying path '/nix/store/2wcvnyznab8ysnwn9d377z0is2s3zfby-python-imports-check-hook.sh' from 'https://cache.nixos.org'... copying path '/nix/store/sg7d1rnz3bmfyll16pm79pgpnwsddd5s-python-namespaces-hook.sh' from 'https://cache.nixos.org'... copying path '/nix/store/d5ll8w6x4b75rid43s6hfwf7hlxcsqbk-python3.9-pip-22.0.4' from 'https://cache.nixos.org'... copying path '/nix/store/7p9qka9f7ciwl6k9rl988v5x5cixdv5g-python3.9-tomli-2.0.1' from 'https://cache.nixos.org'... copying path '/nix/store/q9fp55p5hrky0mb5323lb3wr41a5sb22-python3.9-wheel-0.37.1' from 'https://cache.nixos.org'... copying path '/nix/store/phrmh4qspw91qik3xic65ncfg4jfhppz-python3.9-pyparsing-3.0.9' from 'https://cache.nixos.org'... copying path '/nix/store/1sfi6g28wym879nsjsxra8gfimnz934q-python3.9-packaging-21.3' from 'https://cache.nixos.org'... copying path '/nix/store/pglav05zraisif7y050mcmygmh698acr-python-catch-conflicts-hook' from 'https://cache.nixos.org'... copying path '/nix/store/4ppnl4w8c3q4yk7y5v5hfncpflqv7xcs-python3.9-setuptools-scm-6.4.2' from 'https://cache.nixos.org'... copying path '/nix/store/wwcbzpc6xj3dsdwgrcgl8sxilch3mkzv-pip-install-hook' from 'https://cache.nixos.org'... copying path '/nix/store/4m4hm78mas015yzfpiqi7pzh93vb371q-pip-build-hook.sh' from 'https://cache.nixos.org'... building '/nix/store/hmhibj2ra8hlaxphfw4w5m49a6qrfq5i-python3.9-gdal-3.5.0.drv'... Sourcing python-remove-tests-dir-hook Sourcing python-catch-conflicts-hook.sh Sourcing python-remove-bin-bytecode-hook.sh Sourcing pip-build-hook Using pipBuildPhase Using pipShellHook Sourcing pip-install-hook Using pipInstallPhase Sourcing python-imports-check-hook.sh Using pythonImportsCheckPhase Sourcing python-namespaces-hook unpacking sources unpacking source archive /nix/store/4h2bq0fn6wkfp15zmhb45amrfq7szg24-GDAL-3.5.0.tar.gz source root is GDAL-3.5.0 setting SOURCE_DATE_EPOCH to timestamp 1652443523 of file GDAL-3.5.0/setup.cfg patching sources configuring no configure script, doing nothing building Executing pipBuildPhase Creating a wheel... WARNING: The directory '/homeless-shelter/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag. Processing /build/GDAL-3.5.0 Running command python setup.py egg_info WARNING: numpy not available! Array support will not be enabled running egg_info creating /build/pip-pip-egg-info-1bmcbj7o/GDAL.egg-info writing /build/pip-pip-egg-info-1bmcbj7o/GDAL.egg-info/PKG-INFO writing dependency_links to /build/pip-pip-egg-info-1bmcbj7o/GDAL.egg-info/dependency_links.txt writing requirements to /build/pip-pip-egg-info-1bmcbj7o/GDAL.egg-info/requires.txt writing top-level names to /build/pip-pip-egg-info-1bmcbj7o/GDAL.egg-info/top_level.txt writing manifest file '/build/pip-pip-egg-info-1bmcbj7o/GDAL.egg-info/SOURCES.txt' reading manifest file '/build/pip-pip-egg-info-1bmcbj7o/GDAL.egg-info/SOURCES.txt' writing manifest file '/build/pip-pip-egg-info-1bmcbj7o/GDAL.egg-info/SOURCES.txt' Preparing metadata (setup.py) ... done Building wheels for collected packages: GDAL Running command python setup.py bdist_wheel WARNING: numpy not available! Array support will not be enabled running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.9 creating build/lib.linux-x86_64-3.9/osgeo copying osgeo/gdalconst.py -> build/lib.linux-x86_64-3.9/osgeo copying osgeo/gdal.py -> build/lib.linux-x86_64-3.9/osgeo copying osgeo/utils.py -> build/lib.linux-x86_64-3.9/osgeo copying osgeo/gdalnumeric.py -> build/lib.linux-x86_64-3.9/osgeo copying osgeo/gnm.py -> build/lib.linux-x86_64-3.9/osgeo copying osgeo/ogr.py -> build/lib.linux-x86_64-3.9/osgeo copying osgeo/init.py -> build/lib.linux-x86_64-3.9/osgeo copying osgeo/osr.py -> build/lib.linux-x86_64-3.9/osgeo copying osgeo/gdal_array.py -> build/lib.linux-x86_64-3.9/osgeo creating build/lib.linux-x86_64-3.9/osgeo_utils copying gdal-utils/osgeo_utils/gdal_proximity.py -> build/lib.linux-x86_64-3.9/osgeo_utils copying gdal-utils/osgeo_utils/gdal_retile.py -> build/lib.linux-x86_64-3.9/osgeo_utils copying gdal-utils/osgeo_utils/gdal_edit.py -> build/lib.linux-x86_64-3.9/osgeo_utils copying gdal-utils/osgeo_utils/gdal2xyz.py -> build/lib.linux-x86_64-3.9/osgeo_utils copying gdal-utils/osgeo_utils/gdalmove.py -> build/lib.linux-x86_64-3.9/osgeo_utils copying gdal-utils/osgeo_utils/ogrmerge.py -> build/lib.linux-x86_64-3.9/osgeo_utils copying gdal-utils/osgeo_utils/gdal_calc.py -> build/lib.linux-x86_64-3.9/osgeo_utils copying gdal-utils/osgeo_utils/gdal_merge.py -> build/lib.linux-x86_64-3.9/osgeo_utils copying gdal-utils/osgeo_utils/init.py -> build/lib.linux-x86_64-3.9/osgeo_utils copying gdal-utils/osgeo_utils/rgb2pct.py -> build/lib.linux-x86_64-3.9/osgeo_utils copying gdal-utils/osgeo_utils/gdal_pansharpen.py -> build/lib.linux-x86_64-3.9/osgeo_utils copying gdal-utils/osgeo_utils/gdal2tiles.py -> build/lib.linux-x86_64-3.9/osgeo_utils copying gdal-utils/osgeo_utils/gdalcompare.py -> build/lib.linux-x86_64-3.9/osgeo_utils copying gdal-utils/osgeo_utils/gdal_polygonize.py -> build/lib.linux-x86_64-3.9/osgeo_utils copying gdal-utils/osgeo_utils/gdal_fillnodata.py -> build/lib.linux-x86_64-3.9/osgeo_utils copying gdal-utils/osgeo_utils/gdal_sieve.py -> build/lib.linux-x86_64-3.9/osgeo_utils copying gdal-utils/osgeo_utils/gdalattachpct.py -> build/lib.linux-x86_64-3.9/osgeo_utils copying gdal-utils/osgeo_utils/pct2rgb.py -> build/lib.linux-x86_64-3.9/osgeo_utils creating build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/mkgraticule.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/tile_extent_from_raster.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/dump_jp2.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/get_soundg.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gdalident.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gdal_remove_towgs84.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gdal_ls.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/ogr_layer_algebra.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gdal_rmdir.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/ogr2vrt.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gdal_rm.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gdalfilter.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/densify.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/validate_cloud_optimized_geotiff.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/ogrupdate.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gdal_create_pdf.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gcps2vec.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gdal_mkdir.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/load2odbc.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/fix_gpkg.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/val_repl.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/vec_tr_spat.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/hsv_merge.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/wcs_virtds_params.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/tigerpoly.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/jpeg_in_tiff_extract.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gcps2ogr.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/epsg_tr.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/magphase.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gdal_vrtmerge.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/esri2wkt.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gdal_zip.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/histrep.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gdalchksum.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/ogr2ogr.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gdalinfo.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gcps2wld.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/build_jp2_from_xml.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gdalcopyproj.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/tolatlong.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/ogr_build_junction_table.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/init.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/crs2crs2grid.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/validate_gpkg.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/fft.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gdal2grd.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/classify.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/ogrinfo.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/vec_tr.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/validate_jp2.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/make_fuzzer_friendly_archive.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/ogr_dispatch.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gdalimport.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gdal_lut.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gdallocationinfo.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/loslas2ntv2.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/rel.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gdal_cp.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/gdal_auth.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples copying gdal-utils/osgeo_utils/samples/assemblepoly.py -> build/lib.linux-x86_64-3.9/osgeo_utils/samples creating build/lib.linux-x86_64-3.9/osgeo_utils/auxiliary copying gdal-utils/osgeo_utils/auxiliary/numpy_util.py -> build/lib.linux-x86_64-3.9/osgeo_utils/auxiliary copying gdal-utils/osgeo_utils/auxiliary/batch_creator.py -> build/lib.linux-x86_64-3.9/osgeo_utils/auxiliary copying gdal-utils/osgeo_utils/auxiliary/raster_creation.py -> build/lib.linux-x86_64-3.9/osgeo_utils/auxiliary copying gdal-utils/osgeo_utils/auxiliary/array_util.py -> build/lib.linux-x86_64-3.9/osgeo_utils/auxiliary copying gdal-utils/osgeo_utils/auxiliary/util.py -> build/lib.linux-x86_64-3.9/osgeo_utils/auxiliary copying gdal-utils/osgeo_utils/auxiliary/init.py -> build/lib.linux-x86_64-3.9/osgeo_utils/auxiliary copying gdal-utils/osgeo_utils/auxiliary/color_palette.py -> build/lib.linux-x86_64-3.9/osgeo_utils/auxiliary copying gdal-utils/osgeo_utils/auxiliary/base.py -> build/lib.linux-x86_64-3.9/osgeo_utils/auxiliary copying gdal-utils/osgeo_utils/auxiliary/gdal_argparse.py -> build/lib.linux-x86_64-3.9/osgeo_utils/auxiliary copying gdal-utils/osgeo_utils/auxiliary/rectangle.py -> build/lib.linux-x86_64-3.9/osgeo_utils/auxiliary copying gdal-utils/osgeo_utils/auxiliary/progress.py -> build/lib.linux-x86_64-3.9/osgeo_utils/auxiliary copying gdal-utils/osgeo_utils/auxiliary/osr_util.py -> build/lib.linux-x86_64-3.9/osgeo_utils/auxiliary copying gdal-utils/osgeo_utils/auxiliary/extent_util.py -> build/lib.linux-x86_64-3.9/osgeo_utils/auxiliary copying gdal-utils/osgeo_utils/auxiliary/color_table.py -> build/lib.linux-x86_64-3.9/osgeo_utils/auxiliary running build_ext g++ -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/include/python3.9 -I. -I/nix/store/785axnhh6d0xisj91c3bg9igijhvx8g1-gdal-3.4.2/include -c gdal_python_cxx11_test.cpp -o gdal_python_cxx11_test.o building 'osgeo._gdal' extension creating build/temp.linux-x86_64-3.9 creating build/temp.linux-x86_64-3.9/extensions g++ -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/include/python3.9 -I. -I/nix/store/785axnhh6d0xisj91c3bg9igijhvx8g1-gdal-3.4.2/include -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-3.9/extensions/gdal_wrap.o -I/nix/store/785axnhh6d0xisj91c3bg9igijhvx8g1-gdal-3.4.2/include building 'osgeo._gdalconst' extension gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/include/python3.9 -I. -I/nix/store/785axnhh6d0xisj91c3bg9igijhvx8g1-gdal-3.4.2/include -c extensions/gdalconst_wrap.c -o build/temp.linux-x86_64-3.9/extensions/gdalconst_wrap.o -I/nix/store/785axnhh6d0xisj91c3bg9igijhvx8g1-gdal-3.4.2/include building 'osgeo._osr' extension g++ -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/include/python3.9 -I. -I/nix/store/785axnhh6d0xisj91c3bg9igijhvx8g1-gdal-3.4.2/include -c extensions/osr_wrap.cpp -o build/temp.linux-x86_64-3.9/extensions/osr_wrap.o -I/nix/store/785axnhh6d0xisj91c3bg9igijhvx8g1-gdal-3.4.2/include building 'osgeo._gnm' extension g++ -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/include/python3.9 -I. -I/nix/store/785axnhh6d0xisj91c3bg9igijhvx8g1-gdal-3.4.2/include -c extensions/gnm_wrap.cpp -o build/temp.linux-x86_64-3.9/extensions/gnm_wrap.o -I/nix/store/785axnhh6d0xisj91c3bg9igijhvx8g1-gdal-3.4.2/include building 'osgeo._ogr' extension g++ -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/include/python3.9 -I. -I/nix/store/785axnhh6d0xisj91c3bg9igijhvx8g1-gdal-3.4.2/include -c extensions/ogr_wrap.cpp -o build/temp.linux-x86_64-3.9/extensions/ogr_wrap.o -I/nix/store/785axnhh6d0xisj91c3bg9igijhvx8g1-gdal-3.4.2/include extensions/gdalconst_wrap.c: In function ‘PyInitgdalconst’: extensions/gdalconst_wrap.c:3526:63: error: ‘GDT_UInt64’ undeclared (first use in this function); did you mean ‘GDT_UInt32’? 3526 | SWIG_Python_SetConstant(d, "GDT_UInt64",SWIG_From_int((int)(GDT_UInt64))); | ^~~~~~ | GDT_UInt32 extensions/gdalconst_wrap.c:3526:63: note: each undeclared identifier is reported only once for each function it appears in extensions/gdalconst_wrap.c:3527:62: error: ‘GDT_Int64’ undeclared (first use in this function); did you mean ‘GDT_Int32’? 3527 | SWIG_Python_SetConstant(d, "GDT_Int64",SWIG_From_int((int)(GDT_Int64))); | ^~~~~ | GDT_Int32 extensions/gdalconst_wrap.c:3636:81: error: ‘GDAL_DMD_CREATION_FIELD_DOMAIN_TYPES’ undeclared (first use in this function); did you mean ‘GDAL_DMD_CREATIONFIELDDATASUBTYPES’? 3636 | SWIG_Python_SetConstant(d, "DMD_CREATION_FIELD_DOMAIN_TYPES",SWIG_FromCharPtr(GDAL_DMD_CREATION_FIELD_DOMAIN_TYPES)); | ^~~~~~~~ | GDAL_DMD_CREATIONFIELDDATASUBTYPES extensions/gdalconst_wrap.c:3656:68: error: ‘GDAL_DCAP_FIELD_DOMAINS’ undeclared (first use in this function) 3656 | SWIG_Python_SetConstant(d, "DCAP_FIELD_DOMAINS",SWIG_FromCharPtr(GDAL_DCAP_FIELD_DOMAINS)); | ^~~~~~~ extensions/gdalconst_wrap.c:3657:68: error: ‘GDAL_DCAP_RENAME_LAYERS’ undeclared (first use in this function) 3657 | SWIG_Python_SetConstant(d, "DCAP_RENAME_LAYERS",SWIG_FromCharPtr(GDAL_DCAP_RENAME_LAYERS)); | ^~~~~~~ extensions/gdalconst_wrap.c:3710:3: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations] 3710 | SWIG_PYTHON_INITIALIZE_THREADS; | ^~~~~~~~~~ In file included from /nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/include/python3.9/Python.h:140, from extensions/gdalconst_wrap.c:156: /nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/include/python3.9/ceval.h:130:37: note: declared here 130 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void); | ^~~~~~ extensions/gnm_wrap.cpp: In function ‘PyObject PyInit__gnm()’: extensions/gnm_wrap.cpp:982:64: warning: ‘void PyEval_InitThreads()’ is deprecated [-Wdeprecated-declarations] 982 | # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() | ~~~~~~^~ extensions/gnm_wrap.cpp:6539:3: note: in expansion of macro ‘SWIG_PYTHON_INITIALIZE_THREADS’ 6539 | SWIG_PYTHON_INITIALIZE_THREADS; | ^~~~~~~~~~ In file included from /nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/include/python3.9/Python.h:140, from extensions/gnm_wrap.cpp:180: /nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/include/python3.9/ceval.h:130:37: note: declared here 130 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void); | ^~~~~~ extensions/ogr_wrap.cpp: In function ‘OGRErr OGRLayerShadow_Rename(OGRLayerShadow, const char)’: extensions/ogr_wrap.cpp:3786:12: error: ‘OGR_L_Rename’ was not declared in this scope; did you mean ‘OGR_L_GetName’? 3786 | return OGR_L_Rename( self, new_name); | ^~~~ | OGR_L_GetName extensions/gdal_wrap.cpp: In function ‘int getAlignment(GDALDataType)’: extensions/gdal_wrap.cpp:2950:14: error: ‘GDT_Int64’ was not declared in this scope; did you mean ‘GDT_Int32’? 2950 | case GDT_Int64: | ^~~~~ | GDT_Int32 extensions/gdal_wrap.cpp:2951:14: error: ‘GDT_UInt64’ was not declared in this scope; did you mean ‘GDT_UInt32’? 2951 | case GDT_UInt64: | ^~~~~~ | GDT_UInt32 extensions/gdal_wrap.cpp: In function ‘const char wrapper_VSIGetCredential(const char, const char, const char)’: extensions/gdal_wrap.cpp:4018:12: error: ‘VSIGetCredential’ was not declared in this scope; did you mean ‘wrapper_VSIGetCredential’? 4018 | return VSIGetCredential( pszPathPrefix, pszKey, pszDefault ); | ^~~~ | wrapper_VSIGetCredential extensions/gdal_wrap.cpp: In function ‘void wrapper_VSIClearCredentials(const char)’: extensions/gdal_wrap.cpp:4024:5: error: ‘VSIClearCredentials’ was not declared in this scope; did you mean ‘wrapper_VSIClearCredentials’? 4024 | VSIClearCredentials( pszPathPrefix ); | ^~~~~~~ | wrapper_VSIClearCredentials extensions/gdal_wrap.cpp: In function ‘char* GDALDatasetShadow_GetFieldDomainNames(GDALDatasetShadow, char*)’: extensions/gdal_wrap.cpp:5079:12: error: ‘GDALDatasetGetFieldDomainNames’ was not declared in this scope; did you mean ‘GDALDatasetGetFieldDomain’? 5079 | return GDALDatasetGetFieldDomainNames(self, options); | ^~~~~~~~~~ | GDALDatasetGetFieldDomain extensions/gdal_wrap.cpp: In function ‘bool GDALDatasetShadow_DeleteFieldDomain(GDALDatasetShadow, const char)’: extensions/gdal_wrap.cpp:5088:14: error: ‘GDALDatasetDeleteFieldDomain’ was not declared in this scope; did you mean ‘GDALDatasetGetFieldDomain’? 5088 | return GDALDatasetDeleteFieldDomain(self, name, NULL); | ^~~~~~~~ | GDALDatasetGetFieldDomain extensions/gdal_wrap.cpp: In function ‘bool GDALDatasetShadow_UpdateFieldDomain(GDALDatasetShadow, OGRFieldDomainShadow)’: extensions/gdal_wrap.cpp:5091:14: error: ‘GDALDatasetUpdateFieldDomain’ was not declared in this scope; did you mean ‘GDALDatasetGetFieldDomain’? 5091 | return GDALDatasetUpdateFieldDomain(self, (OGRFieldDomainH)fieldDomain, NULL); | ^~~~~~~~ | GDALDatasetGetFieldDomain extensions/gdal_wrap.cpp: In function ‘void GDALMDArrayHS_GetNoDataValueAsInt64(GDALMDArrayHS, GIntBig, int)’: extensions/gdal_wrap.cpp:5801:12: error: ‘GDALMDArrayGetNoDataValueAsInt64’ was not declared in this scope; did you mean ‘GDALMDArrayHS_GetNoDataValueAsInt64’? 5801 | val = GDALMDArrayGetNoDataValueAsInt64( self, hasval ); | ^~~~~~~~ | GDALMDArrayHS_GetNoDataValueAsInt64 extensions/gdal_wrap.cpp: In function ‘void GDALMDArrayHS_GetNoDataValueAsUInt64(GDALMDArrayHS, GUIntBig, int)’: extensions/gdal_wrap.cpp:5804:12: error: ‘GDALMDArrayGetNoDataValueAsUInt64’ was not declared in this scope; did you mean ‘GDALMDArrayHS_GetNoDataValueAsUInt64’? 5804 | val = GDALMDArrayGetNoDataValueAsUInt64( self, hasval ); | ^~~~~~~~~ | GDALMDArrayHS_GetNoDataValueAsUInt64 extensions/gdal_wrap.cpp: In function ‘CPLErr GDALMDArrayHS_SetNoDataValueInt64(GDALMDArrayHS, GIntBig)’: extensions/gdal_wrap.cpp:5830:12: error: ‘GDALMDArraySetNoDataValueAsInt64’ was not declared in this scope; did you mean ‘GDALMDArrayHS_GetNoDataValueAsInt64’? 5830 | return GDALMDArraySetNoDataValueAsInt64( self, v ) ? CE_None : CE_Failure; | ^~~~~~~~ | GDALMDArrayHS_GetNoDataValueAsInt64 extensions/gdal_wrap.cpp: In function ‘CPLErr GDALMDArrayHS_SetNoDataValueUInt64(GDALMDArrayHS, GUIntBig)’: extensions/gdal_wrap.cpp:5833:12: error: ‘GDALMDArraySetNoDataValueAsUInt64’ was not declared in this scope; did you mean ‘GDALMDArrayHS_GetNoDataValueAsUInt64’? 5833 | return GDALMDArraySetNoDataValueAsUInt64( self, v ) ? CE_None : CE_Failure; | ^~~~~~~~~ | GDALMDArrayHS_GetNoDataValueAsUInt64 extensions/gdal_wrap.cpp: In function ‘void GDALRasterBandShadow_GetNoDataValueAsInt64(GDALRasterBandShadow, GIntBig, int)’: extensions/gdal_wrap.cpp:6243:12: error: ‘GDALGetRasterNoDataValueAsInt64’ was not declared in this scope; did you mean ‘GDALGetRasterNoDataValue’? 6243 | val = GDALGetRasterNoDataValueAsInt64( self, hasval ); | ^~~~~~~ | GDALGetRasterNoDataValue extensions/osr_wrap.cpp: In function ‘PyObject PyInitosr()’: extensions/osr_wrap.cpp:982:64: warning: ‘void PyEval_InitThreads()’ is deprecated [-Wdeprecated-declarations] 982 | # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() | ~~~~~~^~ extensions/osr_wrap.cpp:19126:3: note: in expansion of macro ‘SWIG_PYTHON_INITIALIZE_THREADS’ 19126 | SWIG_PYTHON_INITIALIZE_THREADS; | ^~~~~~~~~~ In file included from /nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/include/python3.9/Python.h:140, from extensions/osr_wrap.cpp:180: /nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/include/python3.9/ceval.h:130:37: note: declared here 130 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void); | ^~~~~~ extensions/gdal_wrap.cpp: In function ‘void GDALRasterBandShadow_GetNoDataValueAsUInt64(GDALRasterBandShadow, GUIntBig, int)’: extensions/gdal_wrap.cpp:6246:12: error: ‘GDALGetRasterNoDataValueAsUInt64’ was not declared in this scope; did you mean ‘GDALGetRasterNoDataValue’? 6246 | val = GDALGetRasterNoDataValueAsUInt64( self, hasval ); | ^~~~~~~~ | GDALGetRasterNoDataValue extensions/gdal_wrap.cpp: In function ‘CPLErr GDALRasterBandShadow_SetNoDataValueAsInt64(GDALRasterBandShadow, GIntBig)’: extensions/gdal_wrap.cpp:6252:12: error: ‘GDALSetRasterNoDataValueAsInt64’ was not declared in this scope; did you mean ‘GDALSetRasterNoDataValue’? 6252 | return GDALSetRasterNoDataValueAsInt64( self, v ); | ^~~~~~~ | GDALSetRasterNoDataValue extensions/gdal_wrap.cpp: In function ‘CPLErr GDALRasterBandShadow_SetNoDataValueAsUInt64(GDALRasterBandShadow, GUIntBig)’: extensions/gdal_wrap.cpp:6255:12: error: ‘GDALSetRasterNoDataValueAsUInt64’ was not declared in this scope; did you mean ‘GDALSetRasterNoDataValue’? 6255 | return GDALSetRasterNoDataValueAsUInt64( self, v ); | ^~~~~~~~ | GDALSetRasterNoDataValue extensions/gdal_wrap.cpp: In function ‘bool GDALRasterBandShadow_IsMaskBand(GDALRasterBandShadow)’: extensions/gdal_wrap.cpp:6367:14: error: ‘GDALIsMaskBand’ was not declared in this scope; did you mean ‘GDALGetMaskBand’? 6367 | return GDALIsMaskBand( self ); | ^~~~~~ | GDALGetMaskBand extensions/gdal_wrap.cpp: In function ‘PyObject _wrap_SetCredential(PyObject, PyObject)’: extensions/gdal_wrap.cpp:10495:7: error: ‘VSISetCredential’ was not declared in this scope; did you mean ‘_wrap_SetCredential’? 10495 | VSISetCredential((char const )arg1,(char const )arg2,(char const )arg3); | ^~~~ | _wrap_SetCredential extensions/ogr_wrap.cpp: In function ‘PyObject PyInitogr()’: extensions/ogr_wrap.cpp:982:64: warning: ‘void PyEval_InitThreads()’ is deprecated [-Wdeprecated-declarations] 982 | # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() | ~~~~~~^~ extensions/ogr_wrap.cpp:36970:3: note: in expansion of macro ‘SWIG_PYTHON_INITIALIZE_THREADS’ 36970 | SWIG_PYTHON_INITIALIZE_THREADS; | ^~~~~~~~~~ In file included from /nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/include/python3.9/Python.h:140, from extensions/ogr_wrap.cpp:180: /nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/include/python3.9/ceval.h:130:37: note: declared here 130 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void); | ^~~~~~ extensions/gdal_wrap.cpp: In function ‘PyObject* PyInitgdal()’: extensions/gdal_wrap.cpp:982:64: warning: ‘void PyEval_InitThreads()’ is deprecated [-Wdeprecated-declarations] 982 | # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() | ~~~~~~^~ extensions/gdal_wrap.cpp:46157:3: note: in expansion of macro ‘SWIG_PYTHON_INITIALIZE_THREADS’ 46157 | SWIG_PYTHON_INITIALIZE_THREADS; | ^~~~~~~~~~ In file included from /nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/include/python3.9/Python.h:140, from extensions/gdal_wrap.cpp:180: /nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/include/python3.9/ceval.h:130:37: note: declared here 130 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void); | ^~~~~~ g++ -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -shared build/temp.linux-x86_64-3.9/extensions/gnm_wrap.o -L../../.libs -L../../ -L/nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/lib -L/nix/store/785axnhh6d0xisj91c3bg9igijhvx8g1-gdal-3.4.2/lib -lgdal -o build/lib.linux-x86_64-3.9/osgeo/_gnm.cpython-39-x86_64-linux-gnu.so g++ -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -shared build/temp.linux-x86_64-3.9/extensions/osr_wrap.o -L../../.libs -L../../ -L/nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/lib -L/nix/store/785axnhh6d0xisj91c3bg9igijhvx8g1-gdal-3.4.2/lib -lgdal -o build/lib.linux-x86_64-3.9/osgeo/_osr.cpython-39-x86_64-linux-gnu.so error: command '/nix/store/r7r10qvsqlnvbzjkjinvscjlahqbxifl-gcc-wrapper-11.3.0/bin/g++' failed with exit code 1 error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip. full command: /nix/store/vzqny68wq33dcg4hkdala51n5vqhpnwc-python3-3.9.12/bin/python3.9 -u -c ' exec(compile('"'"''"'"''"'"'

This is -- a caller that pip uses to run setup.py

#

- It imports setuptools before invoking setup.py, to enable projects that directly

import from distutils.core to work with newer packaging standards.

- It provides a clear error message when setuptools is not installed.

- It sets sys.argv[0] to the underlying setup.py, when invoking setup.py so

setuptools doesn'"'"'t think the script is -c. This avoids the following warning:

manifest_maker: standard file '"'"'-c'"'"' not found".

- It generates a shim setup.py, for handling setup.cfg-only projects.

import os, sys, tokenize

try: import setuptools except ImportError as error: print( "ERROR: Can not execute setup.py since setuptools is not available in " "the build environment.", file=sys.stderr, ) sys.exit(1)

file = %r sys.argv[0] = file

if os.path.exists(file): filename = file with tokenize.open(file) as f: setup_py_code = f.read() else: filename = "" setup_py_code = "from setuptools import setup; setup()"

exec(compile(setup_py_code, filename, "exec")) '"'"''"'"''"'"' % ('"'"'/build/GDAL-3.5.0/setup.py'"'"',), "", "exec"))' bdist_wheel -d /build/pip-wheel-bleqvsei cwd: /build/GDAL-3.5.0/ Building wheel for GDAL (setup.py) ... error ERROR: Failed building wheel for GDAL Running setup.py clean for GDAL Running command python setup.py clean WARNING: numpy not available! Array support will not be enabled running clean removing 'build/temp.linux-x86_64-3.9' (and everything under it) removing 'build/lib.linux-x86_64-3.9' (and everything under it) 'build/bdist.linux-x86_64' does not exist -- can't clean it 'build/scripts-3.9' does not exist -- can't clean it removing 'build' Failed to build GDAL ERROR: Failed to build one or more wheels

builder for '/nix/store/hmhibj2ra8hlaxphfw4w5m49a6qrfq5i-python3.9-gdal-3.5.0.drv' failed with exit code 1 cannot build derivation '/nix/store/9mspl6i8knq63w0zw21jy2q8zid8x1pg-python3-3.9.12-env.drv': 1 dependencies couldn't be built error: build of '/nix/store/9mspl6i8knq63w0zw21jy2q8zid8x1pg-python3-3.9.12-env.drv' failed

blackvvine commented 2 years ago

I'm having the same issue when installing gdal using pip in Debian testing. Have you found any workarounds other than downgrading to 3.4.2?

l0b0 commented 2 years ago

@blackvvine No, sorry.

adisbladis commented 2 years ago

The issue is that the gdal version in nixpkgs and the python bindings are using symbols only available in more recent versions.

This makes the Python bindings build against nixos-unstable (but I havent tried running the resulting build):

{ pkgs ? import <nixpkgs> {
    overlays = [
      (self: super: {
        gdal = super.gdal.overrideAttrs (old:
          let
            version = "3.5.1";
          in
          {
            name = "gdal-${version}";
            inherit version;
            src = pkgs.fetchFromGitHub {
              owner = "OSGeo";
              repo = "gdal";
              rev = "v${version}";
              hash = "sha256-1bxXnfyw9Z2eacV/v+X0+VfDYf8XrM8F8qBiBP7KAPo=";
            };
            sourceRoot = "source";

            # The nixpkgs check phase refers to files that do not exist in recent versions of gdal
            doInstallCheck = false;
            doCheck = false;
          });
      })

    ];
  }
}:

pkgs.poetry2nix.mkPoetryEnv {
  projectDir = ./.;
}
cpcloud commented 1 year ago

@l0b0 Can this issue be closed?

l0b0 commented 1 year ago

@cpcloud Please hold; I'm trying to update the relevant project to latest nixpkgs.