From 8b1e2833b0ed8e1729746e9e62269c1faa010423 Mon Sep 17 00:00:00 2001 From: "guillem.cordoba" Date: Mon, 3 Jun 2024 18:43:17 +0200 Subject: [PATCH] Fixed sweettest --- flake.nix | 15 ++++-------- nix/fixtures/module-repo/Cargo.lock | 16 ++++++------- nix/fixtures/module-repo/flake.lock | 2 +- nix/fixtures/module-repo/zome/src/lib.rs | 2 +- nix/sweettest.nix | 30 ++++++++++-------------- nix/zome.nix | 12 +++------- 6 files changed, 29 insertions(+), 48 deletions(-) diff --git a/flake.nix b/flake.nix index e7f7377..8c5300e 100644 --- a/flake.nix +++ b/flake.nix @@ -96,13 +96,8 @@ commonArgs = { inherit src; doCheck = false; + strictDeps = true; CARGO_BUILD_TARGET = "wasm32-unknown-unknown"; - CARGO_PROFILE = if debug then "debug" else "release"; - cargoExtraArgs = ""; - cargoCheckCommand = ""; - # RUSTFLAGS="--remap-path-prefix $(pwd)=/build/source/ --remap-path-prefix ${cargoVendorDir}=/build/source/" - cargoBuildCommand = - "cargo build --profile release --locked --workspace"; }; cargoArtifacts = craneLib.buildDepsOnly (commonArgs // { pname = "zome"; @@ -129,15 +124,13 @@ src = craneLib.cleanCargoSource (craneLib.path ./nix/reference-happ); doCheck = false; + strictDeps = true; # RUSTFLAGS = # "--remap-path-prefix ${cargoVendorDir}=/build/source/"; - cargoBuildCommand = - "cargo build --profile release --tests --locked --workspace"; - cargoCheckCommand = ""; - cargoExtraArgs = ""; # CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS = # " -Clink-arg=-fuse-ld=mold"; - # CARGO_PROFILE = if debug then "debug" else "release"; + # CARGO_PROFILE = "release"; + CARGO_PROFILE = "release"; pname = "sweettest"; version = "for-holochain-0.3.1-rc"; }; diff --git a/nix/fixtures/module-repo/Cargo.lock b/nix/fixtures/module-repo/Cargo.lock index 60b4d6b..bd9c9a7 100644 --- a/nix/fixtures/module-repo/Cargo.lock +++ b/nix/fixtures/module-repo/Cargo.lock @@ -2346,7 +2346,7 @@ dependencies = [ "tiny-keccak", "tokio", "tokio-stream", - "toml 0.8.13", + "toml 0.8.14", "tracing", "tracing-futures", "tracing-subscriber", @@ -2770,7 +2770,7 @@ dependencies = [ "holochain_util", "strum", "strum_macros 0.18.0", - "toml 0.8.13", + "toml 0.8.14", "walkdir", ] @@ -2986,7 +2986,7 @@ dependencies = [ "os_info", "serde", "serde_derive", - "toml 0.8.13", + "toml 0.8.14", "uuid", ] @@ -6941,14 +6941,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.13" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.13", + "toml_edit 0.22.14", ] [[package]] @@ -6986,9 +6986,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.13" +version = "0.22.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" +checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" dependencies = [ "indexmap 2.2.6", "serde", diff --git a/nix/fixtures/module-repo/flake.lock b/nix/fixtures/module-repo/flake.lock index 7185b24..72b1626 100644 --- a/nix/fixtures/module-repo/flake.lock +++ b/nix/fixtures/module-repo/flake.lock @@ -612,7 +612,7 @@ }, "locked": { "lastModified": 0, - "narHash": "sha256-GZyqpHKfaLr4wRhS3WkwvZPhh9Yhl1T9uMH6q2Yjmxg=", + "narHash": "sha256-//W7IdSoINO+cP3UiQTT1bZJuXzt7zbQVmJJGTZi9A4=", "path": "../../..", "type": "path" }, diff --git a/nix/fixtures/module-repo/zome/src/lib.rs b/nix/fixtures/module-repo/zome/src/lib.rs index d816f2b..b9984e1 100644 --- a/nix/fixtures/module-repo/zome/src/lib.rs +++ b/nix/fixtures/module-repo/zome/src/lib.rs @@ -2,5 +2,5 @@ use hdk::prelude::*; #[hdk_extern] pub fn hello(_: ()) -> ExternResult { - Ok(String::from("hi")) + Ok(String::from("hello")) } diff --git a/nix/sweettest.nix b/nix/sweettest.nix index 665ed09..d7f2e26 100644 --- a/nix/sweettest.nix +++ b/nix/sweettest.nix @@ -6,32 +6,26 @@ let src = craneLib.cleanCargoSource (craneLib.path workspacePath); - workspaceCargoArtifacts = - (craneLib.callPackage ./buildDepsOnlyWithArtifacts.nix { }) { - inherit cargoArtifacts buildInputs nativeBuildInputs src; - - # RUSTFLAGS = rustFlags; - cargoExtraArgs = ""; - cargoBuildCommand = - "cargo build --profile release --tests --locked --workspace"; - cargoCheckCommand = ""; + commonArgs = { + inherit cargoArtifacts buildInputs nativeBuildInputs src; + strictDeps = true; + CARGO_PROFILE = "release"; + }; - # CARGO_PROFILE = "release"; + workspaceCargoArtifacts = + (craneLib.callPackage ./buildDepsOnlyWithArtifacts.nix { }) (commonArgs // { doCheck = false; - # CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS = - # " -Clink-arg=-fuse-ld=mold"; pname = "workspace-sweettest"; + cargoExtraArgs = "--workspace --tests"; version = cargoToml.package.version; - }; + }); -in craneLib.cargoNextest { - inherit buildInputs nativeBuildInputs src; +in craneLib.cargoNextest (commonArgs // { cargoArtifacts = workspaceCargoArtifacts; pname = "${crate}-sweettest"; version = cargoToml.package.version; - cargoExtraArgs = ""; - cargoNextestExtraArgs = "-p ${crate} --locked -j 1"; + cargoNextestExtraArgs = "-p ${crate} -j 1"; DNA_PATH = dna; -} +}) diff --git a/nix/zome.nix b/nix/zome.nix index 760c94d..4b7479a 100644 --- a/nix/zome.nix +++ b/nix/zome.nix @@ -45,17 +45,14 @@ let commonArgs = { inherit src; doCheck = false; + strictDeps = true; CARGO_BUILD_TARGET = "wasm32-unknown-unknown"; pname = "workspace"; version = cargoToml.package.version; - cargoExtraArgs = ""; - cargoCheckCommand = ""; - cargoBuildCommand = - "cargo build --profile release --locked --workspace ${excludedCrates}"; + cargoExtraArgs = "--workspace ${excludedCrates}"; }; buildPackageCommonArgs = commonArgs // { - cargoBuildCommand = "cargo build --profile release -p ${crate} --locked"; pname = crate; version = cargoToml.package.version; cargoToml = crateCargoToml; @@ -75,10 +72,7 @@ let }; cargoArtifacts = (deterministicCraneLib.callPackage ./buildDepsOnlyWithArtifacts.nix { }) - (commonArgs // { - cargoArtifacts = zca; - cargoBuildCommand = "cargo build --profile release --locked"; - }); + (commonArgs // { cargoArtifacts = zca; }); wasm = deterministicCraneLib.buildPackage (buildPackageCommonArgs // { inherit cargoArtifacts; });