rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
99.12k stars 12.79k forks source link

config.example.toml: use vendor directory by default when compiling from https://static.rust-lang.org/dist/rustc-1.x.y-src.tar.xz #133664

Open dilyanpalauzov opened 2 days ago

dilyanpalauzov commented 2 days ago

The file https://static.rust-lang.org/dist/rustc-1.83.0-src.tar.xz — config.example.toml contains

[build]
# Indicate whether the vendored sources are used for Rust dependencies or not.
#
# Vendoring requires additional setup. We recommend using the pre-generated source tarballs if you
# want to use vendoring. See
# https://forge.rust-lang.org/infra/other-installation-methods.html#source-code.
#vendor = false

[dist]
# Whether to vendor dependencies for the dist tarball.
#vendor = if "is a tarball source" || "is a git repository" { true } else { false }

My reading is that the vendor/ directory from rustc-1.83.0-src.tar.xz by default is not used. By default, this directory should be used, when compiling from the .tar file.

dilyanpalauzov commented 2 days ago

… or if the default is false then do not include the vendor/ directory in the stable, distributed tarball.

bjorn3 commented 1 day ago

Omitting the vendor directory would make it impossible to do a vendored build when you have an offline build environment. There is something to be said for using vendoring by default when building from a tarball though, although you did still need some manual configuration to set a bootstrap compiler when you want to do an offline build anyway.