Skip to content

x setup doesn't work if ./build is a symlink to a non-existent directory #139800

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

Closed
WaffleLapkin opened this issue Apr 14, 2025 · 0 comments · Fixed by #139804
Closed

x setup doesn't work if ./build is a symlink to a non-existent directory #139800

WaffleLapkin opened this issue Apr 14, 2025 · 0 comments · Fixed by #139804
Labels
A-python Area: python, like bootstrap/CI scripts or linters/formatters, etc. C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@WaffleLapkin
Copy link
Member

Summary

x setup crashes when ./build is a symlink to a non-existent directory.

Command used

x setup

Expected behaviour

x should create the directory linked to by the symlink.

Actual behaviour

: ~/p/rust-lib (+ sxq 470 empty); x setup
Traceback (most recent call last):
  File "/home/wffl/prog/rust-lib/x.py", line 53, in <module>
    bootstrap.main()
  File "/home/wffl/prog/rust-lib/src/bootstrap/bootstrap.py", line 1339, in main
    bootstrap(args)
  File "/home/wffl/prog/rust-lib/src/bootstrap/bootstrap.py", line 1301, in bootstrap
    os.makedirs(build.build_dir)
  File "<frozen os>", line 225, in makedirs
FileExistsError: [Errno 17] File exists: '/home/wffl/prog/rust-lib/build'

Operating system

NixOS

HEAD

30f168e

@WaffleLapkin WaffleLapkin added C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Apr 14, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 14, 2025
@WaffleLapkin WaffleLapkin added A-python Area: python, like bootstrap/CI scripts or linters/formatters, etc. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 14, 2025
@bors bors closed this as completed in b70e119 Apr 14, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Apr 14, 2025
Rollup merge of rust-lang#139804 - WaffleLapkin:real, r=jieyouxu

use `realpath` in `bootstrap.py` when creating build-dir

Fixes rust-lang#139800
r? `@jieyouxu`

My use case for `./build` being a symlink is this: my "default" ~~partition~~ btrfs subvolume is snapshotted/backed up. I don't want to backup target-likes, so I move them to a special subvolume which isn't backed up. `./build` is a symlink into that subvolume. (`build.build-dir` configuration is not fully sufficient, it is still nice to be able to check build files with `ls ./build` or call tools from there)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-python Area: python, like bootstrap/CI scripts or linters/formatters, etc. 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.

2 participants