Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upProduce source package in rust-installer format #34366
Conversation
rust-highfive
assigned
brson
Jun 19, 2016
This comment has been minimized.
This comment has been minimized.
|
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
|
Thanks! Could you also update |
This comment has been minimized.
This comment has been minimized.
|
The rustbuild system doesn't seem to produce a source tarball at all right now - should I make it produce the vanilla tarball in addition to the |
This comment has been minimized.
This comment has been minimized.
|
Oh whoops! Eh it's fine to not do that as part of this PR if you'd prefer, but if you wanna throw it in I'm also fine with that! |
brson
reviewed
Jun 20, 2016
| $(Q)$(S)src/rust-installer/gen-installer.sh \ | ||
| --product-name=Rust \ | ||
| --rel-manifest-dir=rustlib \ | ||
| --success-message=Awesome-Source. \ |
This comment has been minimized.
This comment has been minimized.
brson
reviewed
Jun 20, 2016
| $(PKG_TAR): $(PKG_FILES) | ||
| @$(call E, making dist dir) | ||
| $(Q)rm -Rf tmp/dist/$(PKG_NAME) | ||
| $(Q)mkdir -p tmp/dist/$(PKG_NAME) |
This comment has been minimized.
This comment has been minimized.
brson
Jun 20, 2016
Contributor
Unfortunately I think we need to keep producing both formats. The old format is for people building rust, the new one is for people installing it for other purposes.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Diggsey
Jun 21, 2016
Author
Contributor
Yep it should still produce the old .tar.gz exactly as before
brson
reviewed
Jun 20, 2016
| @@ -87,10 +88,11 @@ $(PKG_TAR): $(PKG_FILES) | |||
| --exclude=*/llvm/test/*/*/*.ll \ | |||
| --exclude=*/llvm/test/*/*/*.td \ | |||
| --exclude=*/llvm/test/*/*/*.s \ | |||
| -c $(UNROOTED_PKG_FILES) | tar -x -f - -C tmp/dist/$(PKG_NAME) | |||
| -c $(UNROOTED_PKG_FILES) | tar -x -f - -C tmp/dist/$(SRC_PKG_NAME)-image/lib/rust-lib/rust-src | |||
This comment has been minimized.
This comment has been minimized.
brson
Jun 20, 2016
Contributor
rust-lib should be rustlib. It's the name of the directory we stuff arbitrary things into.
This comment has been minimized.
This comment has been minimized.
brson
reviewed
Jun 20, 2016
| @$(call E, making $@) | ||
| $(Q)tar -czf $(PKG_TAR) -C tmp/dist $(PKG_NAME) | ||
| $(Q)rm -Rf tmp/dist/$(PKG_NAME) | ||
| $(Q)tar -czf $(PKG_TAR) -C tmp/dist/$(SRC_PKG_NAME)-image/lib/rust-lib rust-src --transform 's,^rust-src,$(PKG_NAME),S' |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Diggsey
Jun 21, 2016
Author
Contributor
Both source packages are built from the same image, and the directory name is rust-src, but tar uses the directory name as the root directory in the archive, whereas we used to name the root directory $(PKG_NAME), so the --transform option rewrites all the paths so that the resulting .tar.gz matches exactly the format we used before.
This comment has been minimized.
This comment has been minimized.
|
cc #19535 |
This comment has been minimized.
This comment has been minimized.
|
So after installation of the We've also discussed about the potential to need other source installations, but without concrete use cases. You might imagine that cc @phildawes @alexreg @MarkSwanson this PR is deciding the scheme for storing the installed Rust source on disk. Once we deploy it it will be very hard to change. |
This comment has been minimized.
This comment has been minimized.
|
It might also be worth considering the impact on side-by-side installation. Right now it's in theory vaguely possible to install multiple Rust's right on top of each other because of the disambiguated crate names, though in practice there are artifacts in rustlib that are not disambiguated. Putting a single copy of the source at a known location in rustlib means that only one can exist at a time. This is fine for rustup, but not fine for e.g. Linux distros. I think I'm kinda fine just saying that every |
This comment has been minimized.
This comment has been minimized.
|
cc @jauhien @vadimcn @sylvestre packaging people. This PR is trying to finalize the storage location for the Rust source code (#19535), for use by various tools, and I want to check what impact it might have on packagers. In rustup it'll be an optional package called The concern I have regarding distro packaging is the impact on side-by-side installation. In particular, if SxS is achieved by just installing multiple revisions of Rust directly on top of each other then this src location doesn't work because multiple revisions will want to put the source there. From previous conversations with @jauhien my impression was that at least Gentoo had a more sophisticated SxS installation scheme of their own. What I would like to do for simplicity is abandon any pretense that Of course distros may not want to use our scheme for installing the source at all, but then they are going to have to deal with the integration with tools separately. |
This comment has been minimized.
This comment has been minimized.
|
I've updated rustbuild to produce the two source distributions, and fixed the typo in rustlib. |
durka
reviewed
Jun 21, 2016
| @@ -287,6 +289,97 @@ pub fn std(build: &Build, compiler: &Compiler, target: &str) { | |||
| t!(fs::remove_dir_all(&image)); | |||
| } | |||
|
|
|||
| /// Creates the `rust-std` installer component as compiled by `compiler` for the | |||
| /// target `target`. | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I'd personally lean a bit towards |
This comment has been minimized.
This comment has been minimized.
MarkSwanson
commented
Jun 21, 2016
|
I'm glad this is being worked on! |
This comment has been minimized.
This comment has been minimized.
|
Let's go with |
Diggsey
force-pushed the
Diggsey:rust-src-pkg
branch
from
fc5b57c
to
bb938d1
Jun 23, 2016
This comment has been minimized.
This comment has been minimized.
|
Sorry for the dumb question but what is SxS ? |
Diggsey
force-pushed the
Diggsey:rust-src-pkg
branch
from
bb938d1
to
81673eb
Jun 25, 2016
This comment has been minimized.
This comment has been minimized.
|
@sylvestre side-by-side installation, in other words having more than one version of rust (e.g. nightly and stable) installed and usable on the same machine at the same time |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Something to consider re the std-aware cargo RFC: in order to teach cargo how to build std, we're most likely going to end up having cargo look in the sysroot for the source - that is, the source we're packaging in this PR. So far we've not made any particular commitments about what the 'shape' of that source will like, we're just dumping the source tree into ISTM there's also some overlap here with the idea of 'local crates.io mirrors' as well. @alexcrichton does it make sense for Cargo to treat part of the sysroot as a standard local crates.io mirror? I guess I see a few options here:
For the sake of expediency I think I'm inclined to just keep going forward with this patch and force tools like Cargo to do their bust to locate the crates in the source tree. cc @Ericson2314 |
This comment has been minimized.
This comment has been minimized.
|
@Diggsey what are the prospects for whipping this patch back into shape? |
This comment has been minimized.
This comment has been minimized.
|
Just need to fix the merge conflicts then in that case. |
This comment has been minimized.
This comment has been minimized.
|
@brson: Personally, I'd prefer option 3 - roll this out as is, but plan on adding structure. In the end, that results in the same two-phase lookup being written into tools, but rather than privileging rustc (and making every other compiler implementation take a perf hit unless they mimic a historical accident, and one that may change in the future if rustc's repo changes anything), it makes the fallback less and less frequently-hit over time. It's just as expedient for Rust (no extra work before rollout), more expedient for Cargo (implement only the "look for Cargo.toml" path now), and doesn't privilege rustc over future implementations (at least one is already being written as mrustc.) |
This comment has been minimized.
This comment has been minimized.
|
@brson this is basically already in the shape of a "path source" that Cargo expects today (or a git repository), so it should interoperate regardless. If we want to work with a local registry or vendored directory then we'd probably want more structure, but as you say I'm fine adding that later. |
Diggsey
force-pushed the
Diggsey:rust-src-pkg
branch
from
81673eb
to
21ccad9
Jul 9, 2016
This comment has been minimized.
This comment has been minimized.
|
Fixed conflicts. |
This comment has been minimized.
This comment has been minimized.
|
Failure looks to be spurious, and was caused by |
This comment has been minimized.
This comment has been minimized.
|
@bors retry |
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Aug 10, 2016
This comment has been minimized.
This comment has been minimized.
|
|
Diggsey
force-pushed the
Diggsey:rust-src-pkg
branch
from
777bd6f
to
511c0d1
Aug 11, 2016
This comment has been minimized.
This comment has been minimized.
|
Ugh... That should fix it for mac. |
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Aug 11, 2016
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
@bors: retry |
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Aug 12, 2016
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
I think this is caused by the addition of the |
This comment has been minimized.
This comment has been minimized.
|
Other PRs wouldn't be affected if they didn't change Cargo.toml as far as I know; I think this is true of most PRs. |
This comment has been minimized.
This comment has been minimized.
|
Lots of Cargo.lock exists that shouldn't in those logs, for example The Cargo in use to generate these is pinned, it's downloaded as part of the bootstrap process |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton Those files exist in the repository... |
Diggsey
force-pushed the
Diggsey:rust-src-pkg
branch
from
511c0d1
to
b3908d0
Aug 13, 2016
This comment has been minimized.
This comment has been minimized.
|
This should fix the tidy check. There were two problems:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Aug 14, 2016
This comment has been minimized.
This comment has been minimized.
bors
merged commit b3908d0
into
rust-lang:master
Aug 14, 2016
This comment has been minimized.
This comment has been minimized.
|
|
Diggsey commentedJun 19, 2016
See rust-lang-deprecated/rust-buildbot#102
There may be a better way to do this, wasn't sure how to clean-up the
rust-src-imagedirectory when it's used by multiple make rules.