Skip to content
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

rustc-src target does not include vendor/ when re-building rustc-src #94782

Closed
jonhoo opened this issue Mar 9, 2022 · 1 comment · Fixed by #116430
Closed

rustc-src target does not include vendor/ when re-building rustc-src #94782

jonhoo opened this issue Mar 9, 2022 · 1 comment · Fixed by #116430
Assignees
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jonhoo
Copy link
Contributor

jonhoo commented Mar 9, 2022

I tried this sequence of steps:

$ wget "https://static.rust-lang.org/dist/2022-02-24/rustc-1.59.0-src.tar.xz"
$ tar xf rustc-1.59.0-src.tar.xz
$ cd rustc-1.59.0-src
$ ./configure --enable-local-rust
$ ./x.py dist --stage 0 rustc-src

I expected to see this happen: rustc-1.59.0-src.tar.xz should be built, and should include a vendor/ subdirectory with the same entries as in the source tarball.

Instead, this happened: the produced rustc-1.59.0-src.tar.xz does not contain a vendor/ subdirectory, likely because of the logic here, which ties the inclusion of that directory to whether we're building from git:

rust/src/bootstrap/dist.rs

Lines 887 to 897 in 10dccdc

// If we're building from git sources, we need to vendor a complete distribution.
if builder.rust_info.is_git() {
// Vendor all Cargo dependencies
let mut cmd = Command::new(&builder.initial_cargo);
cmd.arg("vendor")
.arg("--sync")
.arg(builder.src.join("./src/tools/rust-analyzer/Cargo.toml"))
.arg(builder.src.join("./compiler/rustc_codegen_cranelift/Cargo.toml"))
.current_dir(&plain_dst_src);
builder.run(&mut cmd);
}

Note also that the same thing happens even if --enable-locked-deps and --enable-vendor are passed to ./configure.

Meta

rustc --version --verbose:

rustc 1.59.0 (9d1b2106e 2022-02-23)
binary: rustc
commit-hash: 9d1b2106e23b1abd32fce1f17267604a5102f57a
commit-date: 2022-02-23
host: x86_64-unknown-linux-gnu
release: 1.59.0
LLVM version: 13.0.0
@jonhoo jonhoo added the C-bug Category: This is a bug. label Mar 9, 2022
@jonhoo
Copy link
Contributor Author

jonhoo commented Mar 9, 2022

Ooops, I opened this a little too early, sorry about that. This is a bug, but the steps outlined currently hit #94781. It's possible to reproduce by doing a full dist build instead — the outcome is the same, it just takes a lot longer.

@jyn514 jyn514 added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Apr 27, 2023
@onur-ozkan onur-ozkan self-assigned this Sep 27, 2023
@bors bors closed this as completed in 6f9df29 Oct 16, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Oct 16, 2023
Rollup merge of rust-lang#116430 - onur-ozkan:vendoring-in-tarball-sources, r=clubby789

vendoring in tarball sources

fixes rust-lang#94782
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants