Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Mar 8, 2024
1 parent af0b17c commit be2afe1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
4 changes: 2 additions & 2 deletions nix/fixture/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cargo-features = ["trim-paths"]
cargo-features = ["trim-paths"]

[workspace]
members = ["zome"]
Expand All @@ -12,6 +12,6 @@ serde = "1"

[profile.release]
opt-level = "z"
# trim-paths = true
trim-paths = true
codegen-units = 1
# remap-debuginfo = true
2 changes: 1 addition & 1 deletion nix/fixture/flake.lock

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

21 changes: 19 additions & 2 deletions nix/zome.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,20 @@ let
# pname = crate;
# version = cargoToml.package.version;
# });
wasm = pkgs.rustPlatform.buildRustPackage {
rustToolchain = pkgs.rust-bin.nightly."2024-01-29".minimal.override {
# Set the build targets supported by the toolchain,
# wasm32-unknown-unknown is required for trunk.
targets = [ "wasm32-unknown-unknown" ];
};
rustPlatform = pkgs.makeRustPlatform {
cargo = rustToolchain;
rustc = rustToolchain;
};

wasm = rustPlatform.buildRustPackage {
nativeBuildInputs = [
pkgs.llvmPackages.bintools
];
src = workspacePath;
pname = crate;
version = cargoToml.package.version;
Expand All @@ -70,14 +83,18 @@ let
};
cargoBuildFlags = "--target wasm32-unknown-unknown";
doCheck = false;
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER = "lld";
installPhase = ''
mkdir -p $out/lib
cp target/wasm32-unknown-unknown/release/*.wasm $out/lib/
'';
};
in
runCommandLocal "${crate}-deterministic" {
meta = {
holochainPackageType = "zome";
};
} ''
ls ${wasm}/lib
cp ${wasm}/lib/${crate}.wasm $out
'';
in
Expand Down

0 comments on commit be2afe1

Please sign in to comment.