-
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
Remove target locking #43
Conversation
@@ -1,96 +1,81 @@ | |||
VERSION --global-cache 0.7 | |||
VERSION --use-function-keyword --global-cache 0.7 |
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.
--use-function-keyword only available in version 0.8 repo and samples pinned to version 0.7
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.
Hi Alex, that feature flag is available since 0.7.22 https://github.com/earthly/earthly/blob/v0.7.22/features/features.go#L67
Maybe your CLI is not updated?
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.
ensuring that the artifacts of concurrent builds do not overwrite each other is left to the user.
What does this mean for a user in practice?
cargo
under the hood does lock things like the target dir, but is that enough for 90% of use cases? I'm not sure it is if you need to copy out the result.
Is DO rust+CARGO --args="build --release" --output="release/[^\./]+"
guaranteed to run the build and the copy in some sort of atomic fashion avoiding any possible overwrite? If not how can a user arrange to avoid races using Earthly functionality?
There's another side effect of this change which is that, due to cargo
locking the target directory, this will now effectively serialize all cargo-using jobs where previously they could run in parallel because they had their own target
directory. That seems like a pretty crucial downside.
IMPORT github.com/earthly/lib/rust:<version/commit> AS rust | ||
``` | ||
> :warning: Due to [this issue](https://github.com/earthly/earthly/issues/3490), make sure to enable `--global-cache` in the calling Earthfile, as shown above. | ||
> *Due to [this issue](https://github.com/earthly/earthly/issues/3490), make sure to enable `--global-cache` in the calling Earthfile, as shown above.* |
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 no longer shown above, probably because it's not needed with 0.8 any more?
I was assuming that Cargo locking was more fine gained (for target) than it apparently it is: rust-lang/cargo#2486. |
This PR removes the locking in target mount, and also introduces a single target mount as opposed to one per target as we had before.
This PR removes the fingerprinting deletion code, (now
--keep-ts
will be required inCOPY
commands), and the responsibility of ensuring that the artifacts of concurrent builds do not overwrite each other is left to the user.This results in a simpler API, and a reduced cache usage