Merge pull request #242633 from wegank/py-spy-refactor

py-spy: make fixes more legal
This commit is contained in:
Weijia Wang 2023-07-10 16:38:23 +03:00 committed by GitHub
commit 22f141984f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 12 deletions

View File

@ -3,10 +3,7 @@
, darwin
, fetchFromGitHub
, libunwind
, pkg-config
, pkgsBuildBuild
, python3
, runCommand
, rustPlatform
}:
@ -23,6 +20,11 @@ rustPlatform.buildRustPackage rec {
cargoHash = "sha256-nm+44YWSJOOg9a9d8b3APXW50ThV3iA2C/QsJMttscE=";
# error: linker `arm-linux-gnueabihf-gcc` not found
postPatch = ''
rm .cargo/config
'';
nativeBuildInputs = [
rustPlatform.bindgenHook
];
@ -33,18 +35,11 @@ rustPlatform.buildRustPackage rec {
buildInputs = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
# Pull a header that contains a definition of proc_pid_rusage().
(runCommand "${pname}_headers" { } ''
install -Dm444 ${lib.getDev darwin.apple_sdk.sdk}/include/libproc.h $out/include/libproc.h
'')
darwin.apple_sdk_11_0.Libsystem
];
env.NIX_CFLAGS_COMPILE = "-L${libunwind}/lib";
# error: linker `arm-linux-gnueabihf-gcc` not found
preConfigure = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
export RUSTFLAGS="-Clinker=$CC"
'';
checkFlags = [
# thread 'python_data_access::tests::test_copy_string' panicked at 'called `Result::unwrap()` on an `Err`
"--skip=python_data_access::tests::test_copy_string"

View File

@ -11843,7 +11843,7 @@ with pkgs;
pythonPackages = python27Packages;
};
py-spy = callPackage ../development/tools/py-spy { };
py-spy = darwin.apple_sdk_11_0.callPackage ../development/tools/py-spy { };
pydeps = with python3Packages; toPythonApplication pydeps;