BROKEN: rewrite dockerfile for improved caching
- build stage depends on an image which already has Rust present - perform all stage-initalization steps before copying any data, preserving maximum caching - build all deps in a separate cached stage so changes only require rebuilding the affected code - build each module independently in reverse topo order so unaffected build stages can in principle retain their cache Unfortunately, the steps above still don't work: despite the presence of log lines like ``` ---> 104821d12748 Step 32/54 : RUN cargo build --$PROFILE -p polkadot-primitives ---> Running in a78deef9950c Finished release [optimized] target(s) in 0.97s Removing intermediate container a78deef9950c ``` we still end up with errors like ``` Step 37/54 : RUN cargo build --$PROFILE -p polkadot-runtime-common ---> Running in 9f65497b7c6d Compiling polkadot-runtime-common v0.7.17 (/polkadot/runtime/common) error[E0432]: unresolved imports `primitives::Hash`, `primitives::parachain` --> runtime/common/src/attestations.rs:26:18 | 26 | use primitives::{Hash, parachain::{AttestedCandidate, CandidateReceipt, Id as ParaId}}; | ^^^^ ^^^^^^^^^ could not find `parachain` in `primitives` | | | no `Hash` in the root ``` This optimization has now consumed more dev time than it's worth. I'm preserving it in git just in case, but it's time to simplify.
parent
263e04a0
Please register or sign in to comment