Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pkgs/by-name/ce/ceph/old-python-packages/cryptography.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
rustPlatform,
cargo,
rustc,
setuptoolsRustBuildHook,
setuptools-rust,
openssl,
Security ? null,
isPyPy,
Expand Down Expand Up @@ -74,9 +74,12 @@ buildPythonPackage rec {

cargoRoot = "src/rust";

build-system = [
setuptools-rust
];

nativeBuildInputs = [
rustPlatform.cargoSetupHook
setuptoolsRustBuildHook
cargo
rustc
pkg-config
Expand Down
14 changes: 0 additions & 14 deletions pkgs/development/interpreters/python/hooks/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -441,20 +441,6 @@ in
} ./setuptools-build-hook.sh
) { };

setuptoolsRustBuildHook = callPackage (
{ makePythonHook, setuptools-rust }:
makePythonHook {
name = "setuptools-rust-setup-hook";
propagatedBuildInputs = [ setuptools-rust ];
substitutions = {
pyLibDir = "${python}/lib/${python.libPrefix}";
cargoBuildTarget = stdenv.hostPlatform.rust.rustcTargetSpec;
cargoLinkerVar = stdenv.hostPlatform.rust.cargoEnvVarTarget;
Comment on lines -450 to -453

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.

Why didn't you use these variables in the setputools-rust.setupHook?

targetLinker = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
};
} ./setuptools-rust-hook.sh
) { };

unittestCheckHook = callPackage (
{ makePythonHook }:
makePythonHook {
Expand Down
21 changes: 20 additions & 1 deletion pkgs/development/python-modules/setuptools-rust/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildPythonPackage,
fetchPypi,
maturin,
Expand All @@ -11,8 +12,9 @@
setuptools,
setuptools-rust,
setuptools-scm,
replaceVars,
targetPackages,
}:

buildPythonPackage rec {
pname = "setuptools-rust";
version = "1.12.0";
Expand Down Expand Up @@ -40,6 +42,23 @@ buildPythonPackage rec {

doCheck = false;

# integrate the setup hook to set up the build environment for cross compilation
# this hook is automatically propagated to consumers using setuptools-rust as build-system
#
# Only include the setup hook if targetPackages.python3 is defined.
# targetPackages.python3 is not always available, for example when including
# setuptools-rust via buildInputs instead of nativeBuildInputs or building it directly.
setupHook =
if !(targetPackages ? python3) then
null
else
replaceVars ./setuptools-rust-hook.sh {
pyLibDir = "${targetPackages.python3}/lib/${targetPackages.python3.libPrefix}";

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.

The default version of python is incorrectly introduced here, instead of the correct one corresponding to python3Packages.

This is causing python312Packages.bcrypt to fail in staging-next, and potentially other packages, because pyo3 tries to use a higher version than current system, resulting in incompatible symbols.

cargoBuildTarget = stdenv.targetPlatform.rust.rustcTargetSpec;
cargoLinkerVar = stdenv.targetPlatform.rust.cargoEnvVarTarget;
targetLinker = "${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc";
};

passthru.tests = {
pyo3 = maturin.tests.pyo3.override {
format = "setuptools";
Expand Down
1 change: 1 addition & 0 deletions pkgs/top-level/python-aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ mapAliases {
sentry-sdk_2 = throw "'sentry-sdk_2' has been renamed to/replaced by 'sentry-sdk'"; # Converted to throw 2025-10-29
setuptools_dso = throw "'setuptools_dso' has been renamed to/replaced by 'setuptools-dso'"; # Converted to throw 2025-10-29
setuptools_scm = throw "'setuptools_scm' has been renamed to/replaced by 'setuptools-scm'"; # Converted to throw 2025-10-29
setuptoolsRustBuildHook = lib.warn "setuptoolsRustBuildHook is deprecated. Instead, include 'setuptools-rust' via 'build-system'" setuptools-rust; # added 2025-12-07
setuptoolsTrial = throw "'setuptoolsTrial' has been renamed to/replaced by 'setuptools-trial'"; # Converted to throw 2025-10-29
sharkiqpy = throw "'sharkiqpy' has been renamed to/replaced by 'sharkiq'"; # Converted to throw 2025-10-29
shippai = throw "shippai has been removed because the upstream repository was archived in 2023"; # added 2025-07-09
Expand Down
Loading