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

./x.py failed #70208

Closed
tesuji opened this issue Mar 21, 2020 · 5 comments · Fixed by #70228
Closed

./x.py failed #70208

tesuji opened this issue Mar 21, 2020 · 5 comments · Fixed by #70228
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

@tesuji
Copy link
Contributor

tesuji commented Mar 21, 2020

% python3 ./x.py 
info: Downloading and building bootstrap before processing --help
      command. See src/bootstrap/README.md for help with common
      commands.
Updating only changed submodules
Submodules updated in 0.03 seconds
    Finished dev [unoptimized] target(s) in 0.22s
Traceback (most recent call last):
  File "./x.py", line 11, in <module>
    bootstrap.main()
  File "/home/lzutao/fork/rust/compiler/src/bootstrap/bootstrap.py", line 950, in main
    bootstrap(help_triggered)
  File "/home/lzutao/fork/rust/compiler/src/bootstrap/bootstrap.py", line 936, in bootstrap
    run(args, env=env, verbose=build.verbose)
  File "/home/lzutao/fork/rust/compiler/src/bootstrap/bootstrap.py", line 136, in run
    ret = subprocess.Popen(args, **kwargs)
  File "/home/lzutao/.local/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/home/lzutao/.local/lib/python3.7/subprocess.py", line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/home/lzutao/fork/rust/compiler/build/bootstrap/debug/bootstrap': '/home/lzutao/fork/rust/compiler/build/bootstrap/debug/bootstrap'

cc @pietroalbini @Mark-Simulacrum

@Centril
Copy link
Contributor

Centril commented Mar 21, 2020

I've hit this many times, and using rm -rf build/bootstrap fixes the issue for me.

@tesuji
Copy link
Contributor Author

tesuji commented Mar 21, 2020

Unfortunately, that doesn't help. I got the same error again after removing entire build dir.
I think I find the problem. x.py does not encounter for CARGO_BUILD_TARGET env
(which I set in my ~/.profile file).

@tesuji
Copy link
Contributor Author

tesuji commented Mar 21, 2020

Hence the bootstrap should be in build/bootstrap/x86_64-unknown-linux-gnu/debug/bootstrap
rather than build/bootstrap/debug/bootstrap.

@tesuji
Copy link
Contributor Author

tesuji commented Mar 21, 2020

This line:

return os.path.join(self.build_dir, "bootstrap", "debug", "bootstrap")

We may need to remove CARGO_BUILD_TARGET in x.py. Or support it properly.

@jonas-schievink jonas-schievink 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 Mar 21, 2020
@Mark-Simulacrum
Copy link
Member

I personally consider this a "user error" in some sense, in that there's a bunch of cargo flags you can set (either in .cargo/config or environment) that'll break x.py -- I don't think we should be removing them ourselves, personally, since it seems like it's hard to be sure that they're really not necessary. I would also not want to support them, though...

However, with CARGO_BUILD_TARGET specifically, it seems fine to just drop it from the environment. I would accept a PR doing so in bootstrap.py.

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Mar 21, 2020
Remove CARGO_BUILD_TARGET from bootstrap.py

Closes rust-lang#70208
@bors bors closed this as completed in 6e9720d Mar 22, 2020
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.

4 participants