Skip to content

Commit

Permalink
Fixed sweettest
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Jun 3, 2024
1 parent 0f82362 commit 8b1e283
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 48 deletions.
15 changes: 4 additions & 11 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
};
Expand Down
16 changes: 8 additions & 8 deletions nix/fixtures/module-repo/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nix/fixtures/module-repo/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nix/fixtures/module-repo/zome/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ use hdk::prelude::*;

#[hdk_extern]
pub fn hello(_: ()) -> ExternResult<String> {
Ok(String::from("hi"))
Ok(String::from("hello"))
}
30 changes: 12 additions & 18 deletions nix/sweettest.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
})
12 changes: 3 additions & 9 deletions nix/zome.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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; });
Expand Down

0 comments on commit 8b1e283

Please sign in to comment.