forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#102565 - jyn514:refactor-build-manifest, r=Ma…
…rk-Simulacrum Refactor build-manifest to minimize the number of changes needed to add a new component - Add all components to `PkgType` - Automate functionality wherever possible, so functions often don't have to be manually edited - Where that's not possible, use exhaustive matches on `PkgType` instead of adding individual strings. - Add documentation for how to add a component. Improve the existing documentation for how to test changes. I tested locally that this generates an identical manifest before and after my change, as follows: ```sh git checkout d44e142 cargo +nightly run --manifest-path src/tools/build-manifest/Cargo.toml build/dist build/manifest-before 1970-01-01 http://example.com nightly git checkout refactor-build-manifest cargo +nightly run --manifest-path src/tools/build-manifest/Cargo.toml build/dist build/manifest-before 1970-01-01 http://example.com nightly sort -u build/manifest-before/channel-rust-nightly.toml | diff - <(sort -u build/manifest-after/channel-rust-nightly.toml) ``` I then verified by hand that the differences before sorting are inconsequential (mostly targets being slightly reordered). The only change in behavior is that `llvm-tools` is now properly renamed to `llvm-tools-preview`: ``` ; sort -u build/manifest-before/channel-rust-nightly.toml | diff - <(sort -u build/manifest-after/channel-rust-nightly.toml) 784a785 > [renames.llvm-tools] 894a896 > to = "llvm-tools-preview" ``` This is based on rust-lang#102241 and should not be merged before.
- Loading branch information
Showing
4 changed files
with
208 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,33 @@ | ||
# build-manifest | ||
|
||
This tool generates the manifests uploaded to static.rust-lang.org and used by | ||
rustup. The tool is invoked by the bootstrap tool. | ||
This tool generates the manifests uploaded to static.rust-lang.org and used by rustup. | ||
You can see a full list of all manifests at <https://static.rust-lang.org/manifests.txt>. | ||
This listing is updated by <https://github.com/rust-lang/generate-manifest-list> every 7 days. | ||
|
||
This gets called by `promote-release` <https://github.com/rust-lang/promote-release> via `x.py dist hash-and-sign`. | ||
|
||
## Adding a new component | ||
|
||
1. Add a new `Step` to `dist.rs`. This should usually be named after the filename of the uploaded tarball. See https://github.com/rust-lang/rust/pull/101799/files#diff-2c56335faa24486df09ba392d8900c57e2fac4633e1f7038469bcf9ed3feb871 for an example. | ||
a. If appropriate, call `tarball.is_preview(true)` for the component. | ||
2. Add a new `PkgType` to build-manifest. Fix all the compile errors as appropriate. | ||
|
||
## Testing changes locally | ||
|
||
In order to test the changes locally you need to have a valid dist directory | ||
available locally. If you don't want to build all the compiler, you can easily | ||
create one from the nightly artifacts with: | ||
|
||
``` | ||
#!/bin/bash | ||
for cmpn in rust rustc rust-std rust-docs cargo; do | ||
wget https://static.rust-lang.org/dist/${cmpn}-nightly-x86_64-unknown-linux-gnu.tar.gz | ||
```sh | ||
for component in rust rustc rust-std rust-docs cargo; do | ||
wget -P build/dist https://static.rust-lang.org/dist/${component}-nightly-x86_64-unknown-linux-gnu.tar.gz | ||
done | ||
``` | ||
|
||
Then, you can generate the manifest and all the packages from `path/to/dist` to | ||
`path/to/output` with: | ||
Then, you can generate the manifest and all the packages from `build/dist` to | ||
`build/manifest` with: | ||
|
||
```sh | ||
mkdir -p build/manifest | ||
cargo +nightly run --release -p build-manifest build/dist build/manifest 1970-01-01 http://example.com nightly | ||
``` | ||
$ cargo +nightly run path/to/dist path/to/output 1970-01-01 http://example.com CHANNEL | ||
``` | ||
|
||
Remember to replace `CHANNEL` with the channel you produced dist artifacts of | ||
and `VERSION` with the current Rust version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.