build: Add cargo timing script to devshell (#49941)
This commit is contained in:
1 parent
12278e81be
commit
096a097b1e
2 files changed
+14
No files matched your search
@@ -18,6 +18,15 @@
|
||||
|
||||
# Musl cross-compiler for building remote_server
|
||||
muslCross = pkgs.pkgsCross.musl64;
|
||||
|
||||
# Cargo build timings wrapper script
|
||||
wrappedCargo = pkgs.writeShellApplication {
|
||||
name = "cargo";
|
||||
runtimeInputs = [pkgs.nodejs];
|
||||
text = ''
|
||||
NIX_WRAPPER=1 CARGO=${rustToolchain}/bin/cargo ./script/cargo "$@"
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
devShells.default = (pkgs.mkShell.override { inherit (zed-editor) stdenv; }) {
|
||||
@@ -25,6 +34,7 @@
|
||||
inputsFrom = [ zed-editor ];
|
||||
|
||||
packages = with pkgs; [
|
||||
wrappedCargo # must be first, to shadow the `cargo` provided by `rustToolchain`
|
||||
rustToolchain # cargo, rustc, and rust-toolchain.toml components included
|
||||
cargo-nextest
|
||||
cargo-hakari
|
||||
|
||||
@@ -209,6 +209,10 @@ async function main() {
|
||||
|
||||
// Handle --init flag
|
||||
if (args[0] === "--init") {
|
||||
if (process.env.NIX_WRAPPER === "1") {
|
||||
console.error("`--init` not supported when going through the nix wrapper");
|
||||
process.exit(1);
|
||||
}
|
||||
initShellAlias();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user