Skip to content

x.py build fails to find bootstrap if global cargo config has target set #44914

@vi

Description

@vi
$ cat ~/.cargo/config 
[build]
target = "x86_64-unknown-linux-gnu"
...

$ ./x.py build --help
   Compiling build_helper v0.1.0 (file:///mnt/src/git/rust/src/build_helper)
   Compiling bootstrap v0.0.0 (file:///mnt/src/git/rust/src/bootstrap)
    Finished dev [unoptimized] target(s) in 33.65 secs
Traceback (most recent call last):
  File "./x.py", line 20, in <module>
    bootstrap.main()
  File "/mnt/src/git/rust/src/bootstrap/bootstrap.py", line 756, in main
    bootstrap()
  File "/mnt/src/git/rust/src/bootstrap/bootstrap.py", line 747, in bootstrap
    run(args, env=env, verbose=build.verbose)
  File "/mnt/src/git/rust/src/bootstrap/bootstrap.py", line 143, in run
    ret = subprocess.Popen(args, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Similar to DanielKeep/cargo-script#37

Like in cargo-script, the correct way is probably to set taret explicitly and/or request JSON output from Cargo to find the actual bootstrap executable location.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions