-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: supply external cache to build reproducible-wasm
with cargo-near
#308
Comments
build reproducible-wasm
with cargo-near
did some tests of sketch implementation in dj8yfo@f70a32c on https://github.com/dj8yfo/factory-rust/tree/stable_0.4.4 This leaves doing cargo near build reproducible-wasm --pass-docker-volume './target:/home/near/code/target' --manifest-path product-donation/Cargo.toml This saves around 12-13s on builds themselves (can be seen in the log, that dev + release stages 2nd time rerun are < 0.5s), but takes anywhere in the range of Doing (
cargo near build reproducible-wasm --pass-docker-volume './target:/home/near/code/target'
--pass-docker-volume /home/jerrick/.cargo/.crates2.json:/home/near/.cargo/.crates2.json
--pass-docker-volume /home/jerrick/.cargo/.crates.toml:/home/near/.cargo/.crates.toml
--pass-docker-volume /home/jerrick/.cargo/git:/home/near/.cargo/git
--pass-docker-volume /home/jerrick/.cargo/registry/cache:/home/near/.cargo/registry/cache
--pass-docker-volume /home/jerrick/.cargo/registry/index:/home/near/.cargo/registry/index
--manifest-path product-donation/Cargo.toml
) doesn't really budge quickly, it fails with some unclear permission errors. Also i ran cargo near build reproducible-wasm --manifest-path factory/Cargo.toml
vs
cargo near build reproducible-wasm --pass-docker-volume './target:/home/near/code/target' --manifest-path factory/Cargo.toml after the initial Also, if And, of course, this command by itself |
ok , this one (
cargo near build reproducible-wasm --pass-docker-volume './target:/home/near/code/target'
# .cargo/bin has to be skipped
--pass-docker-volume /home/jerrick/.cargo/.crates2.json:/home/near/.cargo/.crates2.json
--pass-docker-volume /home/jerrick/.cargo/.crates.toml:/home/near/.cargo/.crates.toml
--pass-docker-volume /home/jerrick/.cargo/git:/home/near/.cargo/git
--pass-docker-volume /home/jerrick/.cargo/registry:/home/near/.cargo/registry
--manifest-path product-donation/Cargo.toml
) doesn't result in permission errors and it takes 1s on rerun. doing the following after (
cargo near build reproducible-wasm --pass-docker-volume './target:/home/near/code/target'
--pass-docker-volume /home/jerrick/.cargo/.crates2.json:/home/near/.cargo/.crates2.json
--pass-docker-volume /home/jerrick/.cargo/.crates.toml:/home/near/.cargo/.crates.toml
--pass-docker-volume /home/jerrick/.cargo/git:/home/near/.cargo/git
--pass-docker-volume /home/jerrick/.cargo/registry:/home/near/.cargo/registry
--manifest-path factory/Cargo.toml
) takes 2m 50 s , |
this depends on running |
preliminary check shows this doesn't affect # with --pass-docker-volume
❯ : sha256sum target/near/donation/donation.wasm
e5b564bb863171a8e87df0ebb8f3f1f56ef60d0172c47a284b25ab6668d96d04 target/near/donation/donation.wasm
❯ : sha256sum target/near/factory/factory.wasm
fbd1c304d3bd2d1be4aa852e1a7dd4b4aceefc3a7d8de759c65a182c011ad22b target/near/factory/factory.wasm # without --pass-docker-volume
❯ : sha256sum target/near/donation/donation.wasm
e5b564bb863171a8e87df0ebb8f3f1f56ef60d0172c47a284b25ab6668d96d04 target/near/donation/donation.wasm
❯ : sha256sum target/near/factory/factory.wasm
fbd1c304d3bd2d1be4aa852e1a7dd4b4aceefc3a7d8de759c65a182c011ad22b target/near/factory/factory.wasm
|
relates to #301
this should at first try to pass external
./target
dir to the right place into container, and then, if that can be made to work,~/.cargo
folder tooNOTE: original discussion of docker volumes somewhere in tg only mentioned rebuilding the same crate after initial
build for reduced build times, the task has had an obvious scope extension, where a sequence of builds of crates in the same workspace have to be passed initial cache, and then all built sequentially, while sharing the same cache.
Original description:
1i
->1C
(C stands for Cache, 1i is non-cached build of crate 1, 1C is cached build of crate 1 with cache obtained during
1i
)Extended description:
sequential build of multiple crates or workspace:
EC
->1EC
,EC
->2EC
,EC
->3EC
...(EC stands for External Cache, 1EC is cached build of crate
1
with cache supplied externally)The text was updated successfully, but these errors were encountered: