···5455 depsExtraArgs ? { },
5657- # Toggles whether a custom sysroot is created when the target is a .json file.
58- __internal_dontAddSysroot ? false,
59-60 # Needed to `pushd`/`popd` into a subdir of a tarball if this subdir
61 # contains a Cargo.toml, but isn't part of a workspace (which is e.g. the
62 # case for `rustfmt`/etc from the `rust-sources).
···125126 target = stdenv.hostPlatform.rust.rustcTargetSpec;
127 targetIsJSON = lib.hasSuffix ".json" target;
128- useSysroot = targetIsJSON && !__internal_dontAddSysroot;
129-130- sysroot = callPackage ./sysroot { } {
131- inherit target;
132- shortTarget = stdenv.hostPlatform.rust.cargoShortTarget;
133- RUSTFLAGS = args.RUSTFLAGS or "";
134- originalCargoToml = src + /Cargo.toml; # profile info is later extracted
135- };
136-137in
138139-# Tests don't currently work for `no_std`, and all custom sysroots are currently built without `std`.
140-# See https://os.phil-opp.com/testing/ for more information.
141-assert useSysroot -> !(args.doCheck or true);
142-143stdenv.mkDerivation (
144 (removeAttrs args [
145 "depsExtraArgs"
···147 "cargoDeps"
148 "cargoLock"
149 ])
150- // lib.optionalAttrs useSysroot {
151- RUSTFLAGS = "--sysroot ${sysroot} " + (args.RUSTFLAGS or "");
152- }
153 // lib.optionalAttrs (stdenv.hostPlatform.isDarwin && buildType == "debug") {
154- RUSTFLAGS =
155- "-C split-debuginfo=packed "
156- + lib.optionalString useSysroot "--sysroot ${sysroot} "
157- + (args.RUSTFLAGS or "");
158 }
159 // {
160 cargoDeps = cargoDeps';
···5455 depsExtraArgs ? { },
5600057 # Needed to `pushd`/`popd` into a subdir of a tarball if this subdir
58 # contains a Cargo.toml, but isn't part of a workspace (which is e.g. the
59 # case for `rustfmt`/etc from the `rust-sources).
···122123 target = stdenv.hostPlatform.rust.rustcTargetSpec;
124 targetIsJSON = lib.hasSuffix ".json" target;
000000000125in
1260000127stdenv.mkDerivation (
128 (removeAttrs args [
129 "depsExtraArgs"
···131 "cargoDeps"
132 "cargoLock"
133 ])
000134 // lib.optionalAttrs (stdenv.hostPlatform.isDarwin && buildType == "debug") {
135+ RUSTFLAGS = "-C split-debuginfo=packed " + (args.RUSTFLAGS or "");
000136 }
137 // {
138 cargoDeps = cargoDeps';
···3536 postPatch = ''
37 patchShebangs ./autogen.pl ./config
38+39+ # This is needed for multi-node jobs.
40+ # mpirun/srun/prterun does not have "prted" in its path unless
41+ # it is actively pulled in. Hard-coding the nix store path
42+ # as a default universally solves this issue.
43+ substituteInPlace src/runtime/prte_mca_params.c --replace-fail \
44+ "prte_launch_agent = \"prted\"" "prte_launch_agent = \"$out/bin/prted\""
45 '';
4647 preConfigure = ''