Skip to content

python3.pkgs.meson-python: run hook in postConfigure#260637

Merged
vcunat merged 1 commit intoNixOS:staging-nextfrom
alyssais:meson-python-postConfigure
Oct 14, 2023
Merged

python3.pkgs.meson-python: run hook in postConfigure#260637
vcunat merged 1 commit intoNixOS:staging-nextfrom
alyssais:meson-python-postConfigure

Conversation

@alyssais
Copy link
Member

Description of changes

It's not uncommon for packages to modify mesonFlags/mesonFlagsArray in e.g. preConfigure. Since the hook was previously run immediately, these changes wouldn't have been picked up. To fix this, run the hook after the configure phase, where we know the list of meson flags will have been finalized.

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.

@alyssais alyssais requested a review from doronbehar October 12, 2023 09:02
@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Oct 12, 2023
@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: 2501-5000 This PR causes many rebuilds on Linux and should target the staging branches. labels Oct 12, 2023
@doronbehar
Copy link
Contributor

Looks good, have you tested cross compilation of something with this? Maybe of scipy?

@alyssais
Copy link
Member Author

Tested cross-compilation of scipy; seems to work fine.

@alyssais
Copy link
Member Author

@vcunat can we get this into staging-next still? It's a fix for a commit in master.

@vcunat
Copy link
Member

vcunat commented Oct 13, 2023

Anything really is OK rebuild-wise right now. So the only possible problem is likelihood of creating some regressions, as the current master..staging-next is already really complicated.

@alyssais alyssais changed the base branch from staging to staging-next October 13, 2023 13:04
@alyssais
Copy link
Member Author

I think this should be pretty safe — only a handful of packages actually use this hook, and I've built them all successfully.

It's not uncommon for packages to modify mesonFlags/mesonFlagsArray in
e.g. preConfigure.  Since the hook was previously run immediately,
these changes wouldn't have been picked up.  To fix this, run the hook
after the configure phase, where we know the list of meson flags will
have been finalized.

Fixes: 70d182b ("python3.pkgs.meson-python: populate python build flags with $mesonFlags")
@alyssais alyssais force-pushed the meson-python-postConfigure branch from 7e45d40 to 787af71 Compare October 13, 2023 18:56
@vcunat vcunat merged commit 612a66d into NixOS:staging-next Oct 14, 2023
@alyssais alyssais deleted the meson-python-postConfigure branch October 14, 2023 10:12
@alyssais
Copy link
Member Author

@doronbehar btw, this should probably support mesonFlagsArray, or things will get confusing. I didn't do it here, because it probably also means implementing pypaBuildFlagsArray.

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. 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: 2501-5000 This PR causes many rebuilds on Linux and should target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants