Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 25cc75c

Browse files
committed
build-manifest: accept the Rust version instead of the monorepo path
This commit changes the way build-manifest is invoked, to let it accept the Rust version directly instead of requiring the path of the Rust monorepo and letting build-manifest figure out the path on its own. This allows to run build-manifest without a clone of the monorepo.
1 parent f3ab6f0 commit 25cc75c

File tree

5 files changed

+9
-16
lines changed

5 files changed

+9
-16
lines changed

src/bootstrap/dist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2353,7 +2353,7 @@ impl Step for HashSign {
23532353
cmd.arg(today.trim());
23542354
cmd.arg(addr);
23552355
cmd.arg(&builder.config.channel);
2356-
cmd.arg(&builder.src);
2356+
cmd.arg(&builder.version);
23572357
cmd.env("BUILD_MANIFEST_LEGACY", "1");
23582358

23592359
builder.create_dir(&distdir(builder));

src/bootstrap/run.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl Step for BuildManifest {
7777
cmd.arg(today.trim());
7878
cmd.arg(addr);
7979
cmd.arg(&builder.config.channel);
80-
cmd.arg(&builder.src);
80+
cmd.arg(&builder.version);
8181

8282
builder.create_dir(&distdir(builder));
8383
builder.run(&mut cmd);

src/tools/build-manifest/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Then, you can generate the manifest and all the packages from `path/to/dist` to
2121

2222
```
2323
$ cargo +nightly run path/to/dist path/to/output 1970-01-01 http://example.com \
24-
CHANNEL path/to/rust/repo
24+
CHANNEL VERSION
2525
```
2626

2727
Remember to replace `CHANNEL` with the channel you produced dist artifacts of
28-
and `path/to/rust/repo` with the path to your checkout of the Rust repository.
28+
and `VERSION` with the current Rust version.

src/tools/build-manifest/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ fn main() {
221221
let date = args.next().unwrap();
222222
let s3_address = args.next().unwrap();
223223
let channel = args.next().unwrap();
224-
let monorepo_path = args.next().unwrap();
224+
let rustc_version = args.next().unwrap();
225225

226226
// Do not ask for a passphrase while manually testing
227227
let mut passphrase = String::new();
@@ -231,7 +231,7 @@ fn main() {
231231
}
232232

233233
Builder {
234-
versions: Versions::new(&channel, &input, Path::new(&monorepo_path)).unwrap(),
234+
versions: Versions::new(&channel, &rustc_version, &input).unwrap(),
235235

236236
input,
237237
output,

src/tools/build-manifest/src/versions.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use anyhow::{Context, Error};
1+
use anyhow::Error;
22
use flate2::read::GzDecoder;
33
use std::collections::HashMap;
44
use std::fs::File;
@@ -93,17 +93,10 @@ pub(crate) struct Versions {
9393
}
9494

9595
impl Versions {
96-
pub(crate) fn new(
97-
channel: &str,
98-
dist_path: &Path,
99-
monorepo_root: &Path,
100-
) -> Result<Self, Error> {
96+
pub(crate) fn new(channel: &str, rustc_version: &str, dist_path: &Path) -> Result<Self, Error> {
10197
Ok(Self {
10298
channel: channel.into(),
103-
rustc_version: std::fs::read_to_string(monorepo_root.join("src").join("version"))
104-
.context("failed to read the rustc version from src/version")?
105-
.trim()
106-
.to_string(),
99+
rustc_version: rustc_version.into(),
107100
dist_path: dist_path.into(),
108101
versions: HashMap::new(),
109102
})

0 commit comments

Comments
 (0)