mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-10-02 10:00:18 +02:00
python3Packages.setuptools-rust: fix passthru test
The build wanted to create a Cargo.lock in the top-level source directory (presumably because it is also a Cargo project), since we were crating the lock file in sourceRoot (which was set to the example project). This failed because the sources are read-only. Change the test to create the lock file in the top-level crate directory, which is Cargo's default behavior.
This commit is contained in:
parent
807f70aff6
commit
313177129b
|
@ -17,5 +17,9 @@ callPackage ../../../tools/rust/maturin/pyo3-test/generic.nix {
|
||||||
rust.rustc
|
rust.rustc
|
||||||
]);
|
]);
|
||||||
|
|
||||||
sourceRoot = "source/examples/word-count";
|
preConfigure = ''
|
||||||
|
# sourceRoot puts Cargo.lock in the wrong place due to the
|
||||||
|
# example setup.
|
||||||
|
cd examples/word-count
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
, buildAndTestSubdir ? null
|
, buildAndTestSubdir ? null
|
||||||
, format ? "pyproject"
|
, format ? "pyproject"
|
||||||
, sourceRoot ? "source"
|
, preConfigure ? ""
|
||||||
}:
|
}:
|
||||||
|
|
||||||
python3Packages.buildPythonPackage rec {
|
python3Packages.buildPythonPackage rec {
|
||||||
|
@ -25,14 +25,14 @@ python3Packages.buildPythonPackage rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
cargoDeps = rustPlatform.fetchCargoTarball {
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
||||||
inherit src sourceRoot patches;
|
inherit src patches;
|
||||||
name = "${pname}-${version}";
|
name = "${pname}-${version}";
|
||||||
hash = "sha256-//TmozgWy9zrSpMKX92XdHj4fw/T1Elfgn4YhhR7ot0=";
|
hash = "sha256-//TmozgWy9zrSpMKX92XdHj4fw/T1Elfgn4YhhR7ot0=";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [ ./Cargo.lock.patch ];
|
patches = [ ./Cargo.lock.patch ];
|
||||||
|
|
||||||
inherit buildAndTestSubdir format nativeBuildInputs sourceRoot;
|
inherit buildAndTestSubdir format nativeBuildInputs preConfigure;
|
||||||
|
|
||||||
pythonImportsCheck = [ "word_count" ];
|
pythonImportsCheck = [ "word_count" ];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue