-
Notifications
You must be signed in to change notification settings - Fork 13k
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
building beta with vendor=true fail due to network dependencies #42719
Comments
I just ran into this too. :/ FWIW, on rust master |
Under nightly, I have the same: only cargo error now.
|
Either we fix alexcrichton/cargo-vendor#30 or we stop depending on git deps somehow. |
hmm digging a bit more, it seems the git dependency in Cargo.lock is due to rls requiring it in its Cargo.toml. It is being replaced in the src/Cargo.toml of this repo, but apparently Cargo still needs the git repo for some reason. So that may be a Cargo bug? |
This would be a pretty unfortunate thing to hit stable. Anybody have ideas about how we can automatically test this on CI? |
We could create a source tarball and download the stage0, remove network by doing |
A possible emergency mitigation of this issue: we could point beta to a branch/fork of rls that points to cargo as a relative path dependency instead of a git dependency. Alternatively we simply remove rls but not sure how much changes of rustbuild that entails. Long term one can think about either giving cargo-vendor support to git deps or fixing cargo itself to worh with the current situation (not syncing git repos if they get |
Are there any hacks we can do to automatically mangle the rls deps during vendoring? e.g. |
There are no hacks I know of to get this to work. If we want this fixed I believe we need to remove the rls from the repository on the beta branch. |
There's also a 1.19 milestone issue that I'd forgotten about to disable RLS packaging: #42357 |
cc @rillian seems like this might impact you. |
If dropping the network doesn't work on travis because e.g. it outputs the log via the network, we might have to use docker, but we already use it for android and stuff, so it should be no big deal. |
the current error is present even with network access: cargo catch it needs network for git whereas it should also respect But I agree that be able to drop the network would catch more errors. Another possibility is to setup firewall rules to forbid outgoing connection. |
FWIW, I usually try to do a test build of beta on all Fedora arches by this time in the release cycle, but this bug is blocking me. |
@cuviper it should be simple to patch out:
Not tried it however. Note that I'm only suggesting this to help you with testing. It would be pretty disastrous if we attempted to release 1.20 with this bug present. |
Fair enough, I can patch it. There's also rls->rustfmt to deal with, but I think I can just comment out these dependencies for now and leave rls broken. IIRC it's not part of a normal build yet... |
@cuviper Would you be willing to get a patch up to remove |
Yeah, I can - if not today then tomorrow. |
In general we shouldn't depend on git deps at all. Cargo should be replaced by the local version and rustfmt should be a crates.io dependency. It was temporarily pointed at a branch to land a libsyntax change. We just need to update the rls submodule to go back to a crates.io dep (I have a PR doing this, but it also turns on tests and so is having trouble landing). |
Its git dependencies don't work when building with vendored crates, so for now it will just be removed from the workspace and disabled in the rustbuild rules. cc rust-lang#42719
See #43199. |
Its git dependencies don't work when building with vendored crates, so for now it will just be removed from the workspace and disabled in the rustbuild rules. cc rust-lang#42719
Its git dependencies don't work when building with vendored crates, so for now it will just be removed from the workspace and disabled in the rustbuild rules. cc rust-lang#42719
Should be fixed on current beta.4. Can anyone confirm? |
Seems good so far: https://koji.fedoraproject.org/koji/taskinfo?taskID=20529669 |
I could confirm 1.19.0-beta.4 is fixed. |
There is #43218 to track the issue for the 1.20 release. |
oh, TIL about alexcrichton/cargo-vendor#42 and rust-lang/cargo#3992 . Those are probably the long term fixes for this issue... |
same the problem again with nightly. should I open a new issue, or should I reopen this one (but tags would be wrong: it is a nightly problem currently) ? |
tidy: add a new test for external dependencies ensure all packages in Cargo.lock will be vendored, and fail if the source packages isn't whitelisted. the purpose is to avoid such kind of issues: - #52029 Rustfmt isn't vendored correctly - #42719 building beta with vendor=true fail due to network dependencies as Rust comes with several external dependencies (clippy, miri, rustfmt, rls), it is important to have a way to catch some errors in the update of this submodules. The new check in tidy quickly reads `Cargo.lock` to search for the `source` of all packages. This attribute is present when the package comes from external source (like `crates.io-index` or some `git` repository). Some sources are whitelisted (like `crates.io-index`) as the crates are vendored. `Cargo.lock` extract with several cases (git, crates.io, and local). ``` [[package]] name = "rustfmt-nightly" version = "0.8.2" source = "git+https://github.com/rust-lang-nursery/rustfmt?rev=5e5992517d3591e2708d4ca6b155dfcbdf3344b9#5e5992517d3591e2708d4ca6b155dfcbdf3344b9" dependencies = [ ... ] [[package]] name = "same-file" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ ... ] [[package]] name = "rustdoc-themes" version = "0.1.0" ``` r? @alexcrichton
Trying to build beta using downloaded tarball and
vendor=true
(in order to test and prepare distribution for OpenBSD packages), I have the following error:My config.toml is:
The error could be about
rustfmt
orcargo
dependency.It seems that rls have git dependencies defined for them. From
src/tools/rls/Cargo.toml
:And even if
src/Cargo.toml
has a[replace]
section, it is only for 0.20.0 (and not git head):So when cargo tries to resolv dependencies, it tries to download them from network, but fail due to
--frozen
.Please note that when testing, my
CARGO_HOME
(~/.cargo
) is empty.The text was updated successfully, but these errors were encountered: