python3Packages.tensorflow: avoid deprecated override of pybind11#479764
Merged
leona-ya merged 1 commit intoNixOS:masterfrom Jan 14, 2026
Merged
python3Packages.tensorflow: avoid deprecated override of pybind11#479764leona-ya merged 1 commit intoNixOS:masterfrom
leona-ya merged 1 commit intoNixOS:masterfrom
Conversation
Member
|
@MattSturgeon, @ShamrockLee is this the best solution? |
MattSturgeon
approved these changes
Jan 13, 2026
Contributor
MattSturgeon
left a comment
There was a problem hiding this comment.
is this the best solution?
Assuming stdenv actually needs overriding, as per the existing code, then yes: this is essentially the only way to build pybind11 with a different stdenv.
Under the hood, the deprecation/compatibility layer does the same thing; overriding buildPythonPackage with the supplied stdenv:
Comment on lines
+333
to
+337
| (pybind11.override { | ||
| buildPythonPackage = buildPythonPackage.override { | ||
| inherit stdenv; | ||
| }; | ||
| }) |
Contributor
There was a problem hiding this comment.
I'd typically override the previous attr, rather than supplying another one from this scope:
Suggested change
| (pybind11.override { | |
| buildPythonPackage = buildPythonPackage.override { | |
| inherit stdenv; | |
| }; | |
| }) | |
| (pybind11.override (prev: { | |
| buildPythonPackage = prev.buildPythonPackage.override { inherit stdenv; }; | |
| })) |
In practice, they're probably the same. But it's technically possible that someone has an overlay in which pybind11 receives a different buildPythonPackage to this package.
Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
758f4ef to
4d8ab9d
Compare
leona-ya
approved these changes
Jan 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change is necessary after #476384 to avoid the warning shown below.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.