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

Include non-rustup artifacts in the manifest #78486

Merged
merged 1 commit into from
Oct 29, 2020

Conversation

pietroalbini
Copy link
Member

@pietroalbini pietroalbini commented Oct 28, 2020

This PR fixes rust-lang/promote-release#22 by including all the files we ship in the generated manifests, even the ones that are not installable through rustup. In practice this adds the following "artifacts":

  • source-code: the tarball containing the full source code used to build the release (rustc-{channel}-src.tar.xz)
  • installer-msi: the MSI installer for Windows systems (rust-{channel}-{target}.msi)
  • installer-pkg: the PKG installer for macOS systems (rust-{channel}-{target}.pkg)

These files are included in a new artifacts table of the manifest, like so:

[[artifacts.installer-msi.target.aarch64-pc-windows-msvc]]
url = "https://example.com/2020-10-28/rust-nightly-aarch64-pc-windows-msvc.msi"
hash-sha256 = "6b41d5b829d20834c5d93628d008ec618f8914ee79303363bd13a86fd5f305dd"

[[artifacts.installer-msi.target.i686-pc-windows-gnu]]
url = "https://example.com/2020-10-28/rust-nightly-i686-pc-windows-gnu.msi"
hash-sha256 = "83f020de6e180c155add9fce1cea2ac6e5f744edbd6dc1581e24de8f56b2ca7a"

[[artifacts.installer-msi.target.i686-pc-windows-msvc]]
url = "https://example.com/2020-10-28/rust-nightly-i686-pc-windows-msvc.msi"
hash-sha256 = "dbc80c24e9d5df01616c6f216114b4351f51a94218e2368b5cebe4165b270702"

[[artifacts.installer-msi.target.x86_64-pc-windows-gnu]]
url = "https://example.com/2020-10-28/rust-nightly-x86_64-pc-windows-gnu.msi"
hash-sha256 = "8196eca3f02d72d4c8776ad4fcc72897125e2cf6404ae933e31c07e197e3c9fa"

[[artifacts.installer-msi.target.x86_64-pc-windows-msvc]]
url = "https://example.com/2020-10-28/rust-nightly-x86_64-pc-windows-msvc.msi"
hash-sha256 = "b2e7fd6463790732fcf9c726b9448068712341943199cb40fc11d1138b8a207b"

[[artifacts.installer-pkg.target.aarch64-apple-darwin]]
url = "https://example.com/2020-10-28/rust-nightly-aarch64-apple-darwin.pkg"
hash-sha256 = "70421c191752fb33886f8033b029e634bcc993b72308cef52a38405840e91f5c"

[[artifacts.installer-pkg.target.x86_64-apple-darwin]]
url = "https://example.com/2020-10-28/rust-nightly-x86_64-apple-darwin.pkg"
hash-sha256 = "ebd7a5acb61e82d85e855146cc9bd856f32228ee7f40dd94c659b00614ed4f1f"

[[artifacts.source-code.target."*"]]
url = "https://example.com/2020-10-28/rustc-nightly-src.tar.gz"
hash-sha256 = "5fcc487ee4c15c689de8ddf7daac7ff6a65c80498197b9aea58622dc2b3bca10"

[[artifacts.source-code.target."*"]]
url = "https://example.com/2020-10-28/rustc-nightly-src.tar.xz"
hash-sha256 = "0c618ef0ec5f64da1801e9d0df6c755f6ed1a8780ec5c8ee75e55614be51d42c"

Each artifact can be available for multiple targets, and each target can have multiple versions of the same file (for example, a gz-compressed one and a xz-compressed one). In the future rustup might add functionality to let users retrieve the artifacts, but that's not needed to land this PR, and whether to do the implementation is up to the rustup maintainers.

r? @kinnison
cc @Mark-Simulacrum

This commit adds to the generated manifest all files we ship that are
not rustup components, namely:

* Source code tarballs (rustc-{channel}-src.tar.xz)
* Windows installers (rust-{channel}-{target}.msi)
* macOS installers (rust-{channel}-{target}.pkg)

Those files are included in a new "artifacts" table of the manifest, to
avoid interfering with existing rustup installations.
@kinnison
Copy link
Contributor

From my perspective this looks good, and so long as it doesn't adversely affect any of the rest of the toml, rustup shouldn't have any problems. Obviously if you can actually run a quick test against such a manifest then that'd give me more confidence, but I don't see how it could break off the top of my head.

@pietroalbini
Copy link
Member Author

r? @Mark-Simulacrum

@@ -111,6 +139,27 @@ impl Serialize for FileHash {
}
}

fn tarball_variant(builder: &mut Builder, base: &Path, ext: &str) -> Option<PathBuf> {
let mut path = base.to_path_buf();
path.set_extension(ext);
Copy link
Member

Choose a reason for hiding this comment

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

Where does the .tar come in here?

Copy link
Member Author

Choose a reason for hiding this comment

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

The function receives foo.tar.gz, and the stdlib's Path only treats gz as its extension. So, when the function is called with ext = "gz" this line does nothing, and when it's called with ext = "xz" it replaces foo.tar.gz with foo.tar.xz.

Copy link
Member

Choose a reason for hiding this comment

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

Ok. I guess probably not worth a comment.

@Mark-Simulacrum
Copy link
Member

r=me, but I would like to see us do a dev-static release and check rustup just in case.

@bors try

@bors
Copy link
Contributor

bors commented Oct 28, 2020

⌛ Trying commit 92fc1f8 with merge 5e112f430fc0d48e8b63bc32e723f8c798af6939...

@bors
Copy link
Contributor

bors commented Oct 28, 2020

☀️ Try build successful - checks-actions
Build commit: 5e112f430fc0d48e8b63bc32e723f8c798af6939 (5e112f430fc0d48e8b63bc32e723f8c798af6939)

@pietroalbini
Copy link
Member Author

Started a dev nightly release.

@pietroalbini
Copy link
Member Author

Dev release done, you can install it with:

RUSTUP_DIST_SERVER="https://dev-static.rust-lang.org" rustup update nightly

It seems to work just fine on my machine.

@Mark-Simulacrum
Copy link
Member

Seems to work fine for me as well.

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Oct 28, 2020

📌 Commit 92fc1f8 has been approved by Mark-Simulacrum

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 28, 2020
@bors
Copy link
Contributor

bors commented Oct 29, 2020

⌛ Testing commit 92fc1f8 with merge 1d6a0b0...

@bors
Copy link
Contributor

bors commented Oct 29, 2020

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing 1d6a0b0 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 29, 2020
@bors bors merged commit 1d6a0b0 into rust-lang:master Oct 29, 2020
@rustbot rustbot added this to the 1.49.0 milestone Oct 29, 2020
@pietroalbini pietroalbini deleted the manifest-artifacts branch October 29, 2020 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include all shipped files in the manifest
5 participants