Skip to content

python3Packages.numpy: mass-rebuild clean up#244461

Merged
vcunat merged 2 commits intoNixOS:stagingfrom
vcunat:p/numpy-rebuild
Jul 24, 2023
Merged

python3Packages.numpy: mass-rebuild clean up#244461
vcunat merged 2 commits intoNixOS:stagingfrom
vcunat:p/numpy-rebuild

Conversation

@vcunat
Copy link
Copy Markdown
Member

@vcunat vcunat commented Jul 20, 2023

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@vcunat vcunat added the 8.has: clean-up This PR removes packages or removes other cruft label Jul 20, 2023
@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Jul 20, 2023
@vcunat vcunat force-pushed the p/numpy-rebuild branch from d2bf842 to dfbd2d4 Compare July 20, 2023 10:25
The test-skipping patch is conditionalized on python layer.

I moved the conditional patch after the unconditional ones, too.
@vcunat vcunat force-pushed the p/numpy-rebuild branch from dfbd2d4 to f94d2b7 Compare July 20, 2023 10:29
@ofborg ofborg bot requested a review from FRidh July 20, 2023 14:44
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 2501-5000 This PR causes many rebuilds on Darwin and should target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Jul 20, 2023
Comment on lines +92 to +93
# Causes `error: argument unused during compilation: '-fno-strict-overflow'` due to `-Werror`.
hardeningDisable = lib.optionals stdenv.cc.isClang [ "strictoverflow" ];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's more of a discussion for the original PR. Here I just move the line to simplify the expression.

I would expect that some -Wno-error approach would also work.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn’t it make more sense to stop passing the unused argument than to hack at the build scripts to suppress the unused argument warning?

See #243595 regarding -fno-strict-overflow and Clang.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry.

Comment on lines +54 to +73
patches = [
# f2py.f90mod_rules generates code with invalid function pointer conversions, which are
# clang 16 makes an error by default.
(fetchpatch {
url = "https://github.com/numpy/numpy/commit/609fee4324f3521d81a3454f5fcc33abb0d3761e.patch";
hash = "sha256-6Dbmf/RWvQJPTIjvchVaywHGcKCsgap/0wAp5WswuCo=";
})
]
++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [

# Backport from 1.25. `platform.machine` returns `arm64` on aarch64-darwin, which causes
# differing results between `_selected_real_kind_func` and Fortran’s `selected_real_kind`.
(fetchpatch {
url = "https://github.com/numpy/numpy/commit/afcedf4b63f4a94187e6995c2adea0da3bb18e83.patch";
hash = "sha256-cxBoimX5a9wC2qUIGAo5o/M2E9+eV63bV2/wLmfDYKg=";
})
]
++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [

# Disable `numpy/core/tests/test_umath.py::TestComplexFunctions::test_loss_of_precision[complex256]`
# on x86_64-darwin because it fails under Rosetta 2 due to issues with trig functions and
# 80-bit long double complex numbers.
./disable-failing-long-double-test-Rosetta-2.patch
]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that looks good to me

@vcunat vcunat merged commit b601995 into NixOS:staging Jul 24, 2023
@vcunat vcunat deleted the p/numpy-rebuild branch July 24, 2023 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 8.has: clean-up This PR removes packages or removes other cruft 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 2501-5000 This PR causes many rebuilds on Darwin and should target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants