-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
use Cargo.toml & Cargo.lock for sccache build dependency #3709
Conversation
[build-dependencies] | ||
# sccache's handling of the /fp:fast MSVC compiler option is broken, but this is fixed in the master branch. | ||
# https://github.com/mozilla/sccache/pull/962 | ||
sccache = { git = "https://github.com/mozilla/sccache.git", branch = "master" } |
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.
sccache = { git = "https://github.com/mozilla/sccache.git", branch = "master" } | |
sccache = { git = "https://github.com/mozilla/sccache.git", branch = "master" } | |
[lib] | |
path = "non-existent" # required so `cargo update` runs | |
If you add this, you can remove the main.rs
file. works on my machine but try it yourself as well please.
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.
cool, thanks for this hack
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 lets cargo update
work but I think what we actually need on CI is cargo build
.
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.
Can't say much about that. I don't understand what this PR is supposed to do anyways. I just figured there must be a better way than leaving a dummy main.rs
in the repo.
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.
The purpose of this PR is to use Cargo.lock as the cache key instead of the ugly hack of a git commit hash which won't work well as we add more Rust dependencies.
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.
Right, but why do we need to change cargo install --git https://github.com/mozilla/sccache.git --branch master
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.
Sorry for asking stupid questions. The solution seems overcomplicated to me, but thats usually a sign that I don't know enough about the actual topic.
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.
The current solution works for now. But it won't work when we also have other Rust dependencies to cache.
b44d2ef
to
cb6ea07
Compare
de453f1
to
3e3c324
Compare
It seems that adding a binary as a dependency doesn't install it to $PATH:
|
Cargo installs to the home dir (on Linux: This is why we do |
|
I think cargo might not support this use case yet but it will be implemented soon... rust-lang/cargo#9096 |
Can't we define an env var |
I agree. Referencing the git ref directly instead of using a dummy project might be the way to go in this special case. I didn't think about that. Maybe obsolete then: Be-ing#55 |
That would be a bit more complicated than the current implementation for no benefit. Maybe we could just cache |
I started a thread on the Rust forum asking for help. |
Why? It would be a ~10 line diff, not a >3K line diff. |
Your proposal has no advantage over simply using the commit hash as the cache key and referencing the Git branch with |
That is exactly what I proposed?! Just save the commit hash in an env var to avoid duplication of that value for cache key and and cargo install. That way we don't have the risk of updating one but not the other. |
There is no duplication of the commit hash currently. |
We should pin a specific commit. I don't want our CI builds failing because they introduced a breaking change or broke main upstream. |
Okay then you can open another PR to do that. |
No description provided.