-
Notifications
You must be signed in to change notification settings - Fork 12
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
Adds +INIT and $OS_RELEASE to cache id #25
Conversation
Co-authored-by: Vlad A. Ionescu <[email protected]>
ARG OS_RELEASE=$(md5sum /etc/os-release | cut -d ' ' -f 1) | ||
ARG cache_id="${EARTHLY_TARGET_PROJECT_NO_TAG}#${OS_RELEASE}#earthly-cargo-cache" | ||
RUN echo "$cache_id">/earthly/cfg/cache_id | ||
ENV CARGO_HOME_CACHE_ID=$cache_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice as a workaround but can I suggest you consider making this a first class feature of Earthly UDCs. e.g.
IMPORT github.com/earthly/lib/rust AS rust-udc WITH --foo=bar --cache-id=foo
To set some ARG --global
declared at the top of the UDC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good feature to add for sure Ian, mind creating a ticket for it?
https://github.com/earthly/earthly/issues/new?assignees=&labels=type%3Aproposal&projects=&template=feature-proposal.md&title=
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR:
/etc/os-release
) in the cache id default value. This avoids the scenario of reusing the cache entries across potentially incompatibles shared libraries.+INIT
UDC used for initialize the build environment for the rest UDCs to be invoked.$CARGO_HOME_CACHE_ID