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

build: vendor = true seems to not work anymore #100364

Closed
semarie opened this issue Aug 10, 2022 · 8 comments · Fixed by #101835
Closed

build: vendor = true seems to not work anymore #100364

semarie opened this issue Aug 10, 2022 · 8 comments · Fixed by #101835
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

@semarie
Copy link
Contributor

semarie commented Aug 10, 2022

When downloading a tarball (rustc-beta-src.tar.gz from https://static.rust-lang.org/dist/) and building it with config.toml file with vendor = true, the build fails early with:

Tue Aug  9 18:10:24 CEST 2022: starting rustbuild dist --jobs=4
detected default triple x86_64-unknown-openbsd from pre-installed rustc
Building rustbuild
running: /usr/local/bin/cargo build --manifest-path /data/semarie/build-rust/build_dir/rustc-beta-src/src/bootstrap/Cargo.toml --verbose --frozen
error: Unable to update registry `crates-io`

Caused by:
  attempting to make an HTTP request, but --frozen was specified
Traceback (most recent call last):
  File "/data/semarie/build-rust/build_dir/rustc-beta-src/x.py", line 48, in <module>
    bootstrap.main()
  File "/data/semarie/build-rust/build_dir/rustc-beta-src/src/bootstrap/bootstrap.py", line 926, in main
    bootstrap(help_triggered)
  File "/data/semarie/build-rust/build_dir/rustc-beta-src/src/bootstrap/bootstrap.py", line 903, in bootstrap
    build.build_bootstrap(args.color)
  File "/data/semarie/build-rust/build_dir/rustc-beta-src/src/bootstrap/bootstrap.py", line 774, in build_bootstrap
    run(args, env=env, verbose=self.verbose)
  File "/data/semarie/build-rust/build_dir/rustc-beta-src/src/bootstrap/bootstrap.py", line 166, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /usr/local/bin/cargo build --manifest-path /data/semarie/build-rust/build_dir/rustc-beta-src/src/bootstrap/Cargo.toml --verbose --frozen

I have this behaviour in beta since 2022-08-09, and with nightly since 2022-06-25.

My config.toml file is:

changelog-seen = 2

[build]
rustc = "/usr/local/bin/rustc"
cargo = "/usr/local/bin/cargo"
rustfmt = "/usr/local/bin/rustfmt"
python = "/usr/local/bin/python3"
gdb = "/usr/local/bin/egdb"
#docs = false
vendor = true
extended = true
verbose = 1

[install]
prefix = "/data/semarie/build-rust/install_dir/beta"

[dist]
src-tarball = false
missing-tools = true

[rust]
channel = "beta"
codegen-tests = false
verbose-tests = true

[target.x86_64-unknown-openbsd]
llvm-config = "/usr/local/bin/llvm-config"

[llvm]
static-libstdcpp = false
ninja = true

rustc and cargo binaries are 1.62.1-stable. The build is done on OpenBSD (but as it is failing at first cargo invocation, I think it is OS agnostic).

@bjorn3 bjorn3 added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. labels Aug 19, 2022
@bjorn3
Copy link
Member

bjorn3 commented Aug 19, 2022

Which directory are you invoking ./x.py from? Is it the source directory or somewhere else? I think the .cargo/config.toml necessary for vendoring to work may be missed if you invoke it from another directory than the source directory.

cc @jyn514

@semarie
Copy link
Contributor Author

semarie commented Aug 19, 2022

x.py is invoked from outside the source directory. I will check that

@semarie
Copy link
Contributor Author

semarie commented Aug 19, 2022

ok, I confirm that invoking from inside the source directory solves the problem. now I need to use --config and --build-dir to keep my original behavior to build outside the source directory, but it isn't a big deal.

it might be something to mention in changelog file. I think it is common in downstream dsitribution to use a different build and source directories.

thanks for the help @bjorn3

@bjorn3
Copy link
Member

bjorn3 commented Aug 19, 2022

I think we should support building outside the source directory again.

@jyn514
Copy link
Member

jyn514 commented Aug 19, 2022

#98526 fixed a bunch of these issues - @semarie can you try with a tarball from the latest nightly and see if it's fixed there?

@bjorn3
Copy link
Member

bjorn3 commented Aug 19, 2022

That PR only changes the rust code of rustbuild, not the python code. This issue is while compiling rustbuild. The problem is that .cargo/config.toml is not in the current working directory when compiling rustbuild and as such ignored.

@semarie
Copy link
Contributor Author

semarie commented Aug 19, 2022

I confirm that the latest nightly doesn't build outside the directory.

also, please note that currently the problem is in both beta and nightly channels.

@jyn514
Copy link
Member

jyn514 commented Aug 19, 2022

The problem is that .cargo/config.toml is not in the current working directory

Ah, I see. That seems possible to fix, we can run the command from the source root. The working directory of the build itself shouldn't affect any of the runtime configuration.

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