You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using docker we often setup a cache for things to download(eg cargo metadata & packages) and sometimes things that are compiled eg rust libs etc since rust can incrementally rebuild based on only what needs to be rebuilt. An example would be'
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/app/target \
cargo build --release
This allows for large projects to be build in minutes, especially when cross compiling for non-native archs(eg aarch64 on amd64) normally due having to clean build from scratch this cause build times to be almost half a day on medium/large size rust projects when cross compiling.
The text was updated successfully, but these errors were encountered:
It seems reasonable to have, but some care will have to be put into how the caches get maintained. I'm inclined to leave that as a concern outside melange itself, as different users will have different usecases.
There is already --cache-dir, which could be extended for this purpose. What do you think, @imjasonh?
In theory folks can already do this today at head, but it's a bit of a hack, and we could make it more sturdy and flexible.
The current implementation added in #143 just makes the directory /var/cache/melange accessible to the build environment, so if one build writes to /var/cache/melange/hello then a subsequent build can read it. This is used by fetch to avoid wgets if possible. If we decide to recommend this for broader usage we should document or require checksum checking to avoid cache poisoning.
When using docker we often setup a cache for things to download(eg cargo metadata & packages) and sometimes things that are compiled eg rust libs etc since rust can incrementally rebuild based on only what needs to be rebuilt. An example would be'
RUN --mount=type=cache,target=/usr/local/cargo/registry \ --mount=type=cache,target=/app/target \ cargo build --release
This allows for large projects to be build in minutes, especially when cross compiling for non-native archs(eg aarch64 on amd64) normally due having to clean build from scratch this cause build times to be almost half a day on medium/large size rust projects when cross compiling.
The text was updated successfully, but these errors were encountered: