NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.2k stars 14.2k forks source link

Build failure: gdcm with Swig update to 4.2.1 #287880

Open afh opened 9 months ago

afh commented 9 months ago

Steps To Reproduce

Steps to reproduce the behavior:

  1. Include the changes from #277049 in your test branch
  2. nix build nixpkgs-dev#python310Packages.gdcm

Build log

  Traceback (most recent call last):
    File "/tmp/nix-build-gdcm-3.0.23.drv-0/source/Testing/Source/MediaStorageAndFileFormat/Python/TestUIDGenerator.py", line 26, in <module>
      gdcm.UIDGenerator_SetRoot( MY_ROOT )
  AttributeError: module 'gdcm' has no attribute 'UIDGenerator_SetRoot'

  CMake Error at TestUIDGeneratorPython.cmake:30 (message):
    1

Additional context

Add any other context about the problem here.

Notify maintainers

@tfmoraes, any idea how to resolve this issue? Is it something specific to nixpkgs or something that upstream needs to address and the test should be disabled for the time being? E.g.:

diff --git a/pkgs/development/libraries/gdcm/default.nix b/pkgs/development/libraries/gdcm/default.nix
index 9d6db6fca684..d60c8fba8497 100644
--- a/pkgs/development/libraries/gdcm/default.nix
+++ b/pkgs/development/libraries/gdcm/default.nix
@@ -76,6 +76,8 @@ stdenv.mkDerivation rec {
     "TestSCUValidation"
     # errors because 3 classes not wrapped:
     "TestWrapPython"
+  ] ++ lib.optionals (swig4.version >= "4.2.0") [
+    "TestUIDGeneratorPython"
   ] ++ lib.optionals (stdenv.isAarch64 && stdenv.isLinux) [
     "TestRescaler2"
   ];

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"aarch64-darwin"`
 - host os: `Darwin 23.3.0, macOS 14.3`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

Add a :+1: reaction to issues you find important.

afh commented 6 months ago

Friendly ping to @tfmoraes on this 🙂

bcdarwin commented 5 months ago

So, I checked that the recent gdcm bump to 3.0.24 didn't fix this, and neither does setting GDCM_USE_SYSTEM_UUID=OFF (purely a guess). Seems likely the UID module isn't being wrapped for some reason - observe that TestWrapPython is already disabled because 3 classes don't get wrapped, but UID generation seems more important than these other modules, so I would be hesitant to simply disable this test.

One possibility is downgrading gdcm swig to swig3, which works, although it's a bit unfortunate since there is not much use of swig3 in tree.

afh commented 5 months ago

Thanks for chiming in on this, @bcdarwin. Do you see value in raising this upstream?

afh commented 3 months ago

Friendly ping to @tfmoraes on this :)