os icon indicating copy to clipboard operation
os copied to clipboard

gdal/3.9.2 package update

Open octo-sts[bot] opened this issue 1 year ago • 1 comments

octo-sts[bot] avatar Aug 20 '24 15:08 octo-sts[bot]

Open AI suggestions to solve the build error:

The error message is:

CMake Error at /usr/lib64/cmake/zstd/zstdTargets.cmake:107 (message): The imported target "zstd::libzstd_static" references the file "/usr/lib/libzstd.a" but this file does not exist. Possible reasons include:

  • The file was deleted, renamed, or moved to another location.
  • An install or uninstall procedure did not complete successfully.
  • The installation package was faulty and contained "/usr/lib64/cmake/zstd/zstdTargets.cmake" but not all the files it references. Call Stack (most recent call first): /usr/lib64/cmake/zstd/zstdConfig.cmake:42 (include) cmake/helpers/CheckDependentLibraries.cmake:141 (find_package) cmake/helpers/CheckDependentLibraries.cmake:428 (gdal_check_package) gdal.cmake:266 (include) CMakeLists.txt:240 (include) -- Configuring incomplete, errors occurred! ERROR: failed to build package. the build environment has been preserved: workspace dir: /temp/melange-workspace-3595563185 guest dir: /temp/melange-guest-3481484788 failed to build package: unable to run package gdal pipeline: unable to run pipeline: unable to run pipeline: exit status 1 make[1]: *** [Makefile:111: packages/aarch64/gdal-3.9.2-r0.apk] Error 1 make[1]: Leaving directory '/github/home' make: *** [Makefile:101: package/gdal] Error 2 ##[error]Process completed with exit code 2.

To fix this error:
1. Verify if `/usr/lib/libzstd.a` exists.
2. If missing, install the `zstd` development package using `sudo apt-get install libzstd-dev` or equivalent for your OS.
3. Ensure CMake is pointing to the correct path for `libzstd.a`.
4. Re-run the build process.

octo-sts[bot] avatar Aug 20 '24 15:08 octo-sts[bot]

if (DEFINED ENV{CONDA_PREFIX} AND UNIX)
    # Currently on Unix, the Zstd cmake config file is buggy. It declares a
    # libzstd_static target but the corresponding libzstd.a file is missing,
    # which cause CMake to error out.
    set(ZSTD_NAMES_AND_TARGETS)
else()
    set(ZSTD_NAMES_AND_TARGETS NAMES zstd TARGETS zstd::libzstd_shared zstd::libzstd_static ZSTD::zstd)
endif()
gdal_check_package(ZSTD "ZSTD compression library" CAN_DISABLE ${ZSTD_NAMES_AND_TARGETS})

AAAAAA

xnox avatar Sep 02 '24 09:09 xnox

This feels like merging zstd-dev & zstd-cmake has bugs.

xnox avatar Sep 02 '24 09:09 xnox

Previously zstd-dev did not provide any cmake files (those used to be in a separate cmake build zstd-cmake). and gdal used to use it's own FindZSTD module which would find and shared link against libzstd.

Since zstd-dev started to provide cmake modules, those take precedence by gdal cmake files..... which force simultaneous shared and static linking against zstd, and thus end up with statically linked zstd. That can't be good, as it introduces dark matter / untraceable zstd.

Instead of adding zstd-static to the build environment, remove the zstd-dev provided cmake files; to let gdal continue to use its fallback logic to still shared link against zstd.

Something is off with either our zstd cmake modules or gdal upstream usage of zstd upstream cmake modules.

xnox avatar Sep 02 '24 10:09 xnox

Open AI suggestions to solve the build error:

The error message is: "ModuleNotFoundError: No module named 'distutils.msvccompiler'"

1. Ensure you have Python installed.
2. Install the `setuptools` package: `pip install setuptools`.
3. If using Python 3.10 or later, install `distutils` separately: `pip install distutils`.
4. Verify the installation by running a Python script that imports `distutils.msvccompiler`.
5. If the error persists, check your environment variables and Python path settings.

octo-sts[bot] avatar Sep 02 '24 12:09 octo-sts[bot]