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 absolute source paths in bootstrap #126782

Merged

Conversation

mtilda
Copy link
Contributor

@mtilda mtilda commented Jun 21, 2024

Fixes #126765

x test [PATHS] should work when each path

  1. Is the name of a build step, such as tidy in x test tidy or
  2. Points to an existing file that is a descendant of the builder's source directory (root of this repository).

@rustbot
Copy link
Collaborator

rustbot commented Jun 21, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @albertlarsan68 (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jun 21, 2024
@onur-ozkan
Copy link
Member

prefix stripping will still fail when running from any directory other than the root of the repository.

Why? If I run x test /home/demo/asd/rust/tests/ui/impl-trait/precise-capturing/unexpected-token.rs, bootstrap should be able to get the rust source path from builder.src and strip that. We don't need to read the current directory in this case.

@onur-ozkan
Copy link
Member

@rustbot author

r? onur-ozkan

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 21, 2024
@rustbot rustbot assigned onur-ozkan and unassigned albertlarsan68 Jun 21, 2024
@mtilda
Copy link
Contributor Author

mtilda commented Jun 21, 2024

@onur-ozkan

prefix stripping will still fail when running from any directory other than the root of the repository.

Why?

I was pointing out a bug in my code that I did not have time to fix before going to bed. I believe I fixed it now.

If I run x test /home/demo/asd/rust/tests/ui/impl-trait/precise-capturing/unexpected-token.rs, bootstrap should be able to get the rust source path from builder.src and strip that. We don't need to read the current directory in this case.

Thanks for the suggestion. That is exactly what I ended up doing. This is my first contribution here, so I was unfamiliar with builder.src.

@mtilda mtilda marked this pull request as ready for review June 21, 2024 20:35
@mtilda mtilda requested a review from bjorn3 June 21, 2024 20:37
@mtilda
Copy link
Contributor Author

mtilda commented Jun 21, 2024

@rustbot review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 21, 2024
@mtilda mtilda changed the title Fix support for absolute paths in x.py Support absolute PATHS in x.py test [PATHS] Jun 22, 2024
Copy link
Member

@onur-ozkan onur-ozkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your help!

Once you fixed the last review note, please squash your commits (see the development guide for help https://rustc-dev-guide.rust-lang.org/git.html?highlight=squash#squash-your-commits), so we can merge this.

src/bootstrap/src/core/builder.rs Outdated Show resolved Hide resolved
@onur-ozkan onur-ozkan added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 22, 2024
@mtilda mtilda force-pushed the mtilda/patch/x-test-with-absolute-paths branch from e510971 to 2674f02 Compare June 23, 2024 00:11
@mtilda
Copy link
Contributor Author

mtilda commented Jun 23, 2024

@bors review

@mtilda mtilda force-pushed the mtilda/patch/x-test-with-absolute-paths branch from 2674f02 to 57cb0e2 Compare June 23, 2024 03:34
@onur-ozkan onur-ozkan changed the title Support absolute PATHS in x.py test [PATHS] Support absolute source paths in bootstrap Jun 23, 2024
@onur-ozkan
Copy link
Member

Looks good, thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Jun 23, 2024

📌 Commit 57cb0e2 has been approved by onur-ozkan

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 23, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 23, 2024
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#126720 (Ignore `branch-protection-check-IBT` run-make test)
 - rust-lang#126779 (Try to clarify the confusingly-named `RustDev` and `RustcDev` steps)
 - rust-lang#126782 (Support absolute source paths in bootstrap)
 - rust-lang#126783 (Fix issue number for the `tcplistener_into_incoming` feature)
 - rust-lang#126843 (Allow "C-unwind" fn to have C variadics)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 92af670 into rust-lang:master Jun 23, 2024
6 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jun 23, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jun 23, 2024
Rollup merge of rust-lang#126782 - mtilda:mtilda/patch/x-test-with-absolute-paths, r=onur-ozkan

Support absolute source paths in bootstrap

Fixes rust-lang#126765

`x test [PATHS]` should work when each path

1. Is the name of a build step, such as `tidy` in `x test tidy` or
2. Points to an existing file that is a descendant of the builder's source directory (root of this repository).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

x test doesn't work for absolute paths
7 participants