Skip to content

python3Packages.cffi: 1.17.1 -> 2.0.0#445749

Merged
mweinelt merged 1 commit intostagingfrom
unknown repository
Oct 5, 2025
Merged

python3Packages.cffi: 1.17.1 -> 2.0.0#445749
mweinelt merged 1 commit intostagingfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Sep 24, 2025

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 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: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 12.first-time contribution This PR is the author's first one; please be gentle! 6.topic: python Python is a high-level, general-purpose programming language. labels Sep 24, 2025
@nix-owners nix-owners bot requested review from mweinelt and natsukium September 24, 2025 09:17
@SuperSandro2000
Copy link
Member

Why was the pypy casing removed?


# The tests use -Werror but with python3.6 clang detects some unreachable code.
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument -Wno-unreachable-code -Wno-c++11-narrowing";
# The tests use -Werror but with python3.6 clang detects some unreachable code.
Copy link
Member

Choose a reason for hiding this comment

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

Is this still true?

Copy link
Author

Choose a reason for hiding this comment

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

I don't know how to test for clang. I've tried some commands, but none overrode gcc.

Copy link
Member

Choose a reason for hiding this comment

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

You need to override the attrset passed to buildPythonPackage with "stdenv" set to clangStdenv. A command to do this is nix-build -I nixpkgs=. --expr 'with (import <nixpkgs> { }); python3Packages.cffi.overridePythonAttrs { stdenv = clangStdenv; }'.

NIX_CFLAGS_COMPILE seems to be unnecessary now.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, with the new default clang 21, it builds fine without any flags.

@ghost
Copy link
Author

ghost commented Sep 29, 2025

Was there a reason to use the already built cffi from within isPyPy instead of just building it from source?

@mdaniels5757
Copy link
Member

Was there a reason to use the already built cffi from within isPyPy instead of just building it from source?

Per cffi's setup.py: "On PyPy, cffi is preinstalled and it is not possible, at least for now, to install a different version."

@ghost
Copy link
Author

ghost commented Oct 2, 2025

Thank you for the explanation.
I asked the developer to see if the situation has changed in any way and it hasn't.

Copy link
Member

@mdaniels5757 mdaniels5757 left a comment

Choose a reason for hiding this comment

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

Diff LGTM; python3Packages.cffi and its dependent python3Packages.pyvips both build locally on x86_64-linux.

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Oct 3, 2025
{
pyproject = false;
dontUnpack = true;
}
Copy link
Member

Choose a reason for hiding this comment

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

Make the whole package null for isPyPy in pkgs/top-level/python-packages.nix instead.

Copy link
Author

Choose a reason for hiding this comment

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

Could you also give a comparison between the two and why this approach is preferred instead?

Copy link
Member

@mweinelt mweinelt Oct 4, 2025

Choose a reason for hiding this comment

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

With pypy not supporting cffi there shouldn't be a package named cffi in the path.

Your workaround disables pyproject and unpacking but leaves a derivation. Setting cffi to null makes it a no-op for pypy.

@github-project-automation github-project-automation bot moved this from In progress to Review in progress in Python batch upgrade Oct 4, 2025
Copy link
Member

@mweinelt mweinelt left a comment

Choose a reason for hiding this comment

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

Build-tested on x86_64-linux, aarch64-linux and aarch64-darwin.

@github-project-automation github-project-automation bot moved this from Review in progress to Reviewer approved in Python batch upgrade Oct 5, 2025
Comment on lines -26 to -27
# Some dependent packages expect to have pycparser available when using cffi.
dependencies = [ pycparser ];
Copy link
Member

Choose a reason for hiding this comment

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

Frankly, this is a bug in these packages and shouldn't live rent-free in our cffi packaging.

@mweinelt mweinelt merged commit 63e8c8c into NixOS:staging Oct 5, 2025
29 of 31 checks passed
@github-project-automation github-project-automation bot moved this from Reviewer approved to Done in Python batch upgrade Oct 5, 2025
@ghost ghost deleted the cffi branch October 20, 2025 10:15
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: 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. 12.approvals: 1 This PR was reviewed and approved by one person. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

Development

Successfully merging this pull request may close these issues.

3 participants