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

pythonPackages.xgboost: fix build #43809

Merged
merged 2 commits into from Jul 21, 2018
Merged

pythonPackages.xgboost: fix build #43809

merged 2 commits into from Jul 21, 2018

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented Jul 19, 2018

Motivation for this change

Fixes the broken path detection of the xgboost python package and replaces it with a simple path that substitutes the storepath of libxgboost.so.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

Ma27 added 2 commits July 19, 2018 13:27
The setup.py of `python-package` contains some path resolution magic to
find `libxgboost.so` which is needed for the python API.

Unfortunately the code is incompatible with Nix as it isn't compatible
with the store-based structure for each package and tries to express the
location of the shared object with relative paths.

The detection in `setup.py` and `xgboost/libpath.py` has been either
removed entirely or patched to link to the proper store path of the
`libxgboost` build input.

See https://hydra.nixos.org/build/77702715 for further reference.
@Ma27 Ma27 requested a review from FRidh as a code owner July 19, 2018 11:33
@Ma27
Copy link
Member Author

Ma27 commented Jul 19, 2018

will run nox-review just to be sure.

@Ma27 Ma27 changed the title Fix python xgboost pythonPackages.xgboost: fix build Jul 19, 2018
@Ma27
Copy link
Member Author

Ma27 commented Jul 19, 2018

Result in /tmp/nox-review-in4b42yn
total 8
lrwxrwxrwx 1 ma27 users 66 Jul 19 13:36 result -> /nix/store/dpc92c1w1h7zc9yjav9v8ih3f3j3jb4m-python2.7-xgboost-0.72
lrwxrwxrwx 1 ma27 users 56 Jul 19 13:36 result-2 -> /nix/store/dni9473cw0bh335ps0gz5778ybwa5qyj-xgboost-0.72
lrwxrwxrwx 1 ma27 users 66 Jul 19 13:36 result-3 -> /nix/store/g7jplykqbpgi8nnqicfrljk0b4g25721-python3.6-xgboost-0.72

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: xgboost

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: xgboost

Partial log (click to expand)

installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/dni9473cw0bh335ps0gz5778ybwa5qyj-xgboost-0.72
shrinking /nix/store/dni9473cw0bh335ps0gz5778ybwa5qyj-xgboost-0.72/lib/libxgboost.so
shrinking /nix/store/dni9473cw0bh335ps0gz5778ybwa5qyj-xgboost-0.72/bin/xgboost
strip is /nix/store/90vmpr41dzsx350k5argycaf693hnl1l-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/dni9473cw0bh335ps0gz5778ybwa5qyj-xgboost-0.72/lib  /nix/store/dni9473cw0bh335ps0gz5778ybwa5qyj-xgboost-0.72/bin
patching script interpreter paths in /nix/store/dni9473cw0bh335ps0gz5778ybwa5qyj-xgboost-0.72
checking for references to /build in /nix/store/dni9473cw0bh335ps0gz5778ybwa5qyj-xgboost-0.72...
/nix/store/dni9473cw0bh335ps0gz5778ybwa5qyj-xgboost-0.72

@FRidh FRidh merged commit 7db4c36 into NixOS:master Jul 21, 2018
@Ma27 Ma27 deleted the fix-python-xgboost branch July 21, 2018 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants