Skip to content

Add different entry points for x.py #80596

@jyn514

Description

@jyn514

Summary

As shown by #78466, https://internals.rust-lang.org/t/experience-report-contributing-to-rust-lang-rust/12012, and #59864 (comment) have shown, people are still having trouble with bootstrapping even after the changes to defaults and the new explanations in the bootstrapping chapter of the dev-guide. Part of the issue is that x.py's job is inherently complicated, and that most of the commands are ambiguous once you take stages into account. It would be great to have smaller commands that are focused on specific groups of contributors, so you can choose the build steps unambiguously and give helpful errors when they don't make sense.

Proposed Solution

Have an x.py in many different directories that has settings for that directory. For example, library/x.py build would be the same as x.py build library/test --stage 0 today, and library/x.py doc would be the same as x.py doc --stage 0 library/std today. For other more complicated tools, the defaults would be different: src/tools/rustdoc/x.py doc would be the same as x.py doc --stage 1, compiler/x.py build would be the same as x.py build --stage 1 library/std.

These are the entrypoints I propose:

.
├── compiler
│   ├── rustc
│   └── x.py
├── library
│   ├── std
│   └── x.py
├── Makefile
├── src
│   └── tools
│       └── rustdoc
│           └── x.py
└── x.py

The top-level x.py would still be the same as it is today.

For library/ especially, I think this would be a low-maintenance, high-impact way to greatly simplify the build process.

Metadata

Metadata

Assignees

Labels

A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustC-feature-requestCategory: A feature request, i.e: not implemented / a PR.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