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

Add support from installing toolchains from try builds. #83

Merged
merged 4 commits into from
Jun 9, 2017

Conversation

tomprince
Copy link
Member

This is initial implementation of #64.

@tomprince tomprince requested a review from frewsxcv June 4, 2017 17:08
[
("rustc", "rustc-nightly-x86_64-unknown-linux-gnu.tar.gz"),
("rust-std-x86_64-unknown-linux-gnu", "rust-std-nightly-x86_64-unknown-linux-gnu.tar.gz"),
("cargo", "cargo-nightly-x86_64-unknown-linux-gnu.tar.gz"),
Copy link
Member

Choose a reason for hiding this comment

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

Using the xz tarballs which I believe rustup also supports will probably be a little faster, though I doubt it matters at cargobomb's current length of time and quantity of downloads.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've pinned rustup to 1.3.0 which doesn't support xz yet. I've filed #85 to upgrade once there is a new release.

tx = dist::component::TarGzPackage::new(response, &cfg)?
.install(&target, component, None, tx)?;
}
tx.commit();
Copy link
Contributor

Choose a reason for hiding this comment

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

This is doing some weird stuff with the rustup internal metadata, that I'm not sure how I feel about. It looks like it is creating a toolchain named after the sha by commandeering the rustup APIs. The result is not something rustup can do itself, so it's basically creating a corrupted rustup installation, and ... maybe it works.

The way I expected this to work, and that I think would be easier, is to download the 'combined' installer, that contains both rustc and cargo, untar it somewhere in the cargobomb directory structure, then call rustup toolchain link on it.

I am worried that this is creating some technical debt.

Copy link
Member Author

Choose a reason for hiding this comment

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

It looks like there are a number of code paths (apparently dead, though) that do installation about like I did. It also doesn't appear to care whether the toolchain directory is symlink, but just its name.

tx = dist::component::TarGzPackage::new(response, &cfg)?
.install(&target, component, None, tx)?;
}
tx.commit();
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, untarring is not sufficient, one also has to run install.sh to put it into the proper form.

tx = dist::component::TarGzPackage::new(response, &cfg)?
.install(&target, component, None, tx)?;
}
tx.commit();
Copy link
Contributor

@brson brson Jun 5, 2017

Choose a reason for hiding this comment

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

Heh, this could actually do exactly what it's doing to install the toolchain to some non-rustup location (instead of calling install.sh), then call 'toolchain link' to turn it into a rustup toolchain.

[
("rustc", "rustc-nightly-x86_64-unknown-linux-gnu.tar.gz"),
("rust-std-x86_64-unknown-linux-gnu", "rust-std-nightly-x86_64-unknown-linux-gnu.tar.gz"),
("cargo", "cargo-nightly-x86_64-unknown-linux-gnu.tar.gz"),
Copy link
Contributor

Choose a reason for hiding this comment

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

The single rust-nightly tarball would also work here as it contains all these components. Not sure if one approach is better.

tx = dist::component::TarGzPackage::new(response, &cfg)?
.install(&target, component, None, tx)?;
}
tx.commit();
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't think of anything that will obviously not work with this formulation, as long as deleting these toolchains works correctly, but it does seem subject to breakage if rustup changes. I think it would be slightly more correct to install these toolchains to a cargobomb directory, not a rustup directory, and link them into rustup.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that it would be better to teach rustup about this kind of toolchain (as suggested in rust-lang/rustup#1099).

@tomprince
Copy link
Member Author

I'm going to land this, as it has been used in production.

@tomprince tomprince merged commit c9f927b into rust-lang:master Jun 9, 2017
@tomprince tomprince deleted the custom-toolchain branch June 9, 2017 23:25
@tomprince
Copy link
Member Author

(Although a post-merge review wouldn't be amiss.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants