You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of rust-lang#102565 - jyn514:refactor-build-manifest, r=Mark-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.
Copy file name to clipboardexpand all lines: src/tools/build-manifest/README.md
+19-13
Original file line number
Diff line number
Diff line change
@@ -1,27 +1,33 @@
1
1
# build-manifest
2
2
3
-
This tool generates the manifests uploaded to static.rust-lang.org and used by
4
-
rustup. The tool is invoked by the bootstrap tool.
3
+
This tool generates the manifests uploaded to static.rust-lang.org and used by rustup.
4
+
You can see a full list of all manifests at <https://static.rust-lang.org/manifests.txt>.
5
+
This listing is updated by <https://github.com/rust-lang/generate-manifest-list> every 7 days.
6
+
7
+
This gets called by `promote-release`<https://github.com/rust-lang/promote-release> via `x.py dist hash-and-sign`.
8
+
9
+
## Adding a new component
10
+
11
+
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.
12
+
a. If appropriate, call `tarball.is_preview(true)` for the component.
13
+
2. Add a new `PkgType` to build-manifest. Fix all the compile errors as appropriate.
5
14
6
15
## Testing changes locally
7
16
8
17
In order to test the changes locally you need to have a valid dist directory
9
18
available locally. If you don't want to build all the compiler, you can easily
10
19
create one from the nightly artifacts with:
11
20
12
-
```
13
-
#!/bin/bash
14
-
for cmpn in rust rustc rust-std rust-docs cargo; do
0 commit comments