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

support x fmt for sub and outside of rust directories #108004

Closed
onur-ozkan opened this issue Feb 13, 2023 · 1 comment · Fixed by #108404
Closed

support x fmt for sub and outside of rust directories #108004

onur-ozkan opened this issue Feb 13, 2023 · 1 comment · Fixed by #108404
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@onur-ozkan
Copy link
Member

When we run ../x fmt compiler in library directory, the following error will occur:

thread 'main' panicked at 'entry failed with compiler: No such file or directory (os error 2)', format.rs:257:25

Same problem will occur also when we are outside of the rust directory like:

~/devspace/personal/rust-dist/tools  $ ../../rust/x fmt library/std --check

thread 'main' panicked at 'entry failed with library/std: No such file or directory (os error 2)', format.rs:257:25

The problem here is, x fmt expects the complete path for target directory in order to work. For example, instead of running ../../rust/x fmt library/std --check, if we run ../../rust/x fmt ../../rust/library/std --check, it will work without any problem.

Related zulip topic: https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/uncomfortable.20use.20of.20.60x.20fmt.60.20from.20outside.20of.20rust.20dir

@onur-ozkan onur-ozkan added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. labels Feb 13, 2023
@onur-ozkan
Copy link
Member Author

since #107948 (comment) is merged, shortcut functionality should be supported as well for sub and parent rust directories.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 24, 2023
support `x fmt` for sub and outside of rust directories

This PR makes `x fmt` to be succesfully work from sub or outside dir of rust.

The following cases are tested and the results were successful.
```sh
# from rust/library directory
../x fmt compiler --check
../x fmt compiler/rustc

# from outside of rust directory
../../rust/x fmt library/std library/core --check
../../rust/x fmt library/std
```

Resolves rust-lang#108004

r? `@albertlarsan68`
@bors bors closed this as completed in 91a8496 Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. 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.

1 participant