-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
x.py test
try to access network when the compiler builds using vendored crates
#90764
Comments
Hm, that's strange! Unfortunately I am unable to reproduce. Can you provide exact instructions starting with downloading the source file? The following worked for me: wget https://static.rust-lang.org/dist/rustc-1.56.1-src.tar.gz
tar -xzf rustc-1.56.1-src.tar.gz
cd rustc-1.56.1-src
./configure --set rust.channel=stable --set build.vendor=true
# Download bootstrap
./x.py help
# Disconnect network here
./x.py test src/tools/tidy You may want to check that you are running the command from the correct directory (so that it can see |
Oh! ... that is good news as maybe I am doing something wrong. The full spec is here[1], but the tl;dr is like this:
I will try manually per your example in a different place. -- |
A minimal config that have the issue is this:
IIUC the differences from the working example are: I am using a provided local rustc and the system LLVM. |
Oh, I see the issue, I was a bit mistaken before (I had the git repo cached already). cc @bjorn3 The problem is that the cranelift workspace has several git dependencies. Those are not captured here. A simple reproduction is to run the following with vendoring enabled: CARGO_HOME=chome cargo tree --manifest-path compiler/rustc_codegen_cranelift/Cargo.toml --offline As a short-term workaround, you can add the following to [source."https://github.com/bjorn3/rust-ar.git"]
git = "https://github.com/bjorn3/rust-ar.git"
branch = "do_not_remove_cg_clif_ranlib"
replace-with = "vendored-sources"
[source."https://github.com/bytecodealliance/wasmtime.git"]
git = "https://github.com/bytecodealliance/wasmtime.git"
replace-with = "vendored-sources" I guess one option is to add those lines to Another option is to try to capture the vendor config to disk. I think I like that option the most, but will be harder since |
Generally it's our intent to remove those git dependencies as we move forward and not really introduce them in the future (I think it was probably an oversight/mistake to do so), so I don't think we need to design full-fledged solutions but having temporary patches would be good. It might be that the src tarball should replace cranelift with a stub (essentially empty) project to avoid this particular case, for example. |
I already replaced cranelift git dependencies with crates.io dependencies at https://github.com/bjorn3/rustc_codegen_cranelift (https://github.com/bjorn3/rustc_codegen_cranelift/pull/1201), which will fix part of the problem once I do another subtree sync. Unfortunately I am stuck on my own fork of rust-ar for now as upstream doesn't support writing a symbol table: https://github.com/bjorn3/rustc_codegen_cranelift/issues/1202 |
Thanks a lot for catching the bug so fast and so accurately! I am adding the workaround in the spec to enable tests against the system LLVM, this will help us. IMHO technically the bug has been solved after @bjorn3 comment. What can be the outcome here before closing it? Wait until it reach the repo? Provide a test that validate before each release that no dependency comes from git? |
It is not fully fixed yet unfortunately. Rust-ar is still used as git dependency. |
In some situations we should want on influence into the .cargo/config when we use vendored source. One example is rust-lang#90764, when we want to workaround some references to crates forked and living in git, that are missing in the vendor/ directory. This commit will create the .cargo/config file only when the .cargo/ directory needs to be created.
…mulacrum bootstap: create .cargo/config only if not present In some situations we should want on influence into the .cargo/config when we use vendored source. One example is rust-lang#90764, when we want to workaround some references to crates forked and living in git, that are missing in the vendor/ directory. This commit will create the .cargo/config file only when the .cargo/ directory needs to be created.
…mulacrum bootstap: create .cargo/config only if not present In some situations we should want on influence into the .cargo/config when we use vendored source. One example is rust-lang#90764, when we want to workaround some references to crates forked and living in git, that are missing in the vendor/ directory. This commit will create the .cargo/config file only when the .cargo/ directory needs to be created.
This is fixed in #97513, which saves the output of |
We are building the compiler and tools using the vendored crates properly (via
x.py build
) in systems with no network access. But when running the tests (x.py test
) it tries to access the network.Setting properly the envs vars that x.py set, this can be reproduced with:
Seems that the call is be present in
rust-tidy
(indeps.rs
). IIUC should use the--offline
parameter, and I do not think that is checking the presence of.cargo/config
per thear
error (that is present in thevendor
directory)The text was updated successfully, but these errors were encountered: