Skip to content

boost: Split python module into separate derivation#370251

Open
tobim wants to merge 3 commits intoNixOS:stagingfrom
tobim:topic/boost-python-standalone
Open

boost: Split python module into separate derivation#370251
tobim wants to merge 3 commits intoNixOS:stagingfrom
tobim:topic/boost-python-standalone

Conversation

@tobim
Copy link
Contributor

@tobim tobim commented Jan 2, 2025

This change replaces the enablePython option from the boost package into a more granular structure where boost-python is a dedicated derivation. This is enabled by 2 new passthru functions from the boost attribute:

  • boost.pythonLib: Takes a python derivation as a parameter and produces a boost-python itself.
  • boost.withPython: Takes a python derivation as well and produces a symlinkJoin-style derivation containing a boost-python lib together with the rest of the boost libraries.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Jan 2, 2025
@tobim tobim force-pushed the topic/boost-python-standalone branch 4 times, most recently from 1349d14 to bc0aeff Compare January 2, 2025 15:55
@github-actions github-actions bot removed the 6.topic: python Python is a high-level, general-purpose programming language. label Jan 2, 2025
@tobim tobim force-pushed the topic/boost-python-standalone branch from bc0aeff to 5bf960b Compare January 2, 2025 16:15
@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Jan 2, 2025
@tobim tobim force-pushed the topic/boost-python-standalone branch 3 times, most recently from da3a4ba to 18c2af5 Compare January 2, 2025 16:42
@github-actions github-actions bot added 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Jan 2, 2025
@emilazy
Copy link
Member

emilazy commented Jan 2, 2025

  • boost.withPython: Takes a python derivation as well and produces a symlinkJoin-style derivation containing a boost-python lib together with the rest of the boost libraries.

Is this a convenience, or actually required to deal with some build systems? I would prefer to skip it if the former.

I like the idea of splitting it. I wonder if it makes sense to scope it under python3Packages rather than passing a Python as an argument? But since this isn’t itself a Python library, I guess that might not make sense.

cc @natsukium as Python maintainer

Comment on lines 15 to 34
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice to avoid duplication here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not so sure. The last 8 are indeed duplicate, but intrucing a b2Args_common indirection would hurt readability and I'd expect them to change very infrequently.

@tobim tobim force-pushed the topic/boost-python-standalone branch 2 times, most recently from b9af0d9 to 4256b9d Compare January 3, 2025 10:21
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 4, 2025
@tobim tobim force-pushed the topic/boost-python-standalone branch from 4256b9d to 9bd119e Compare January 4, 2025 04:44
@tobim tobim force-pushed the topic/boost-python-standalone branch from 9bd119e to efe9d80 Compare January 19, 2025 17:05
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 19, 2025
@tobim tobim changed the base branch from master to staging January 19, 2025 17:07
@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 19, 2025
@tobim
Copy link
Contributor Author

tobim commented Jan 19, 2025

  • boost.withPython: Takes a python derivation as well and produces a symlinkJoin-style derivation containing a boost-python lib together with the rest of the boost libraries.

Is this a convenience, or actually required to deal with some build systems? I would prefer to skip it if the former.

Depends on how you define convenience, without that some packages would need to be patched to support boost libs that are spread out across multiple filesystem paths. I believe I only used it for packages that actually need it.

I like the idea of splitting it. I wonder if it makes sense to scope it under python3Packages rather than passing a Python as an argument? But since this isn’t itself a Python library, I guess that might not make sense.

There is actually a boost-python attribute in python3Packages as an alias for boost.pythonLib python now. If you need a non-default boost-python you still need to go through the top-level boost attribute tho.

@tobim tobim force-pushed the topic/boost-python-standalone branch from efe9d80 to 8c8d3a8 Compare January 20, 2025 10:24
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 20, 2025
@tobim tobim force-pushed the topic/boost-python-standalone branch from 8c8d3a8 to 7be6230 Compare February 2, 2025 09:48
@tobim tobim marked this pull request as ready for review February 2, 2025 09:49
@nix-owners nix-owners bot requested a review from natsukium February 2, 2025 09:50
@tobim tobim requested a review from mweinelt February 12, 2025 08:16
@tobim
Copy link
Contributor Author

tobim commented Feb 12, 2025

@natsukium @emilazy @SuperSandro2000 I think this is ready. I'd like to get it merged soon.

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Feb 15, 2025
@tobim tobim force-pushed the topic/boost-python-standalone branch from 3e06f06 to b558f7e Compare February 25, 2025 10:55
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Feb 25, 2025
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 16, 2025
@tobim tobim force-pushed the topic/boost-python-standalone branch from b558f7e to e905697 Compare May 8, 2025 10:23
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label May 8, 2025
@tobim tobim force-pushed the topic/boost-python-standalone branch 4 times, most recently from 8f018da to 6fe0603 Compare May 11, 2025 14:34
@SuperSandro2000
Copy link
Member

I do not know if this falls under a potential breaking change and we still can merge it for the release.

@tobim
Copy link
Contributor Author

tobim commented May 13, 2025

Let's merge this after branch off.

@tobim tobim marked this pull request as draft May 13, 2025 04:08
@tobim tobim force-pushed the topic/boost-python-standalone branch from 6fe0603 to 33a2729 Compare June 1, 2025 08:39
@tobim tobim marked this pull request as ready for review June 1, 2025 08:40
@tobim tobim force-pushed the topic/boost-python-standalone branch from 33a2729 to 5714196 Compare June 1, 2025 10:11
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 9, 2025
@tobim tobim force-pushed the topic/boost-python-standalone branch from 5714196 to 1f50278 Compare June 13, 2025 11:40
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 13, 2025
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 16, 2025
@tobim tobim force-pushed the topic/boost-python-standalone branch from 1f50278 to 37cfe00 Compare July 6, 2025 22:01
@tobim tobim force-pushed the topic/boost-python-standalone branch from 37cfe00 to b3bc76f Compare July 11, 2025 06:42
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 11, 2025
@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 26, 2025
@nixpkgs-ci nixpkgs-ci bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 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: 5001+ This PR causes many rebuilds on Darwin and must 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.

5 participants