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 upeclass/{rust, rust-utils, cargo}: add support for rust multi-target #9388
Conversation
gibix
changed the title
Rust eclass
eclass/{rust, rust-utils, cargo}: add support for rust multi-target
Jul 30, 2018
This comment has been minimized.
This comment has been minimized.
gentoo-bot
commented
Jul 30, 2018
|
Pull Request assignment Areas affected: ebuilds, eclasses, profiles dev-lang/rust: @gentoo/rust No bugs to link found. If your pull request references any of the Gentoo bug reports, please add appropriate GLEP 66 tags to the commit message and ping us to reset the assignment. If you do not receive any reply to this pull request, please open or link a bug to attract the attention of maintainers. In order to force reassignment and/or bug reference scan, please append |
gentoo-bot
added
assigned
no bug found
labels
Jul 30, 2018
gibix
force-pushed the
gibix:rust-eclass
branch
8 times, most recently
from
ea66c5c
to
2eeb917
Jul 30, 2018
gibix
added some commits
Jul 31, 2018
gibix
force-pushed the
gibix:rust-eclass
branch
from
2eeb917
to
376eb6a
Jul 31, 2018
This comment has been minimized.
This comment has been minimized.
|
call for review! @aliceinwire @lu-zero @cardoe @cnd @gentoo90 |
cardoe
requested changes
Aug 4, 2018
|
What's the big gain we're getting from having to mark supported rust versions in an eclass? I have plenty of binaries that I've built under older Rust's and they continue to work fine. Given the forward compatible nature I don't see it breaking code either. You mention rustfmt, clippy, and bindgen. I will agree that the two prior matter but now Rust bundles those two components with a release. The push that @djc has made for "fat" rust ebuilds that include the necessary utilities would seem to make more sense here. Or this has been solved previously with slot dependencies and rebuilding packages as necessary. clippy is a special snowflake since it works with a nightly as well. As far as bindgen goes, it doesn't have any inherent dependency on a rustc version. It even takes arguments to allow you to target a specific version. At work we often don't use the absolute latest version of rustc but due use the latest bindgen and we make sure we supply the version we're using and all is well. Overall I don't like the addition of |
| @@ -13,13 +13,13 @@ if [[ ${PV} = *beta* ]]; then | |||
| MY_P="rustc-beta" | |||
| SLOT="beta/${PV}" | |||
| SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.gz" | |||
| KEYWORDS="amd64 x86" | |||
| KEYWORDS="~amd64 ~x86" | |||
This comment has been minimized.
This comment has been minimized.
| else | ||
| ABI_VER="$(get_version_component_range 1-2)" | ||
| SLOT="stable/${ABI_VER}" | ||
| MY_P="rustc-${PV}" | ||
| SRC="${MY_P}-src.tar.gz" | ||
| KEYWORDS="amd64 ~arm64 x86" | ||
| KEYWORDS="~amd64 ~arm64 ~x86" |
This comment has been minimized.
This comment has been minimized.
cardoe
Aug 4, 2018
Contributor
If you want to make changes to an existing ebuild rev bump it and change the keyword there.
| ${PYTHON_DEPS} | ||
| || ( | ||
| >=sys-devel/gcc-4.7 | ||
| >=sys-devel/clang-3.5 |
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.
|
No, "fat" rustc would work only for the software sync-released with the compiler. The libsyntax consumers aren't in sync with rustc releases and nothing prevents new of them to appear and stay outside of the nursery. Probably would be better to clarify that most rust code won't require the whole setup described here. |
This comment has been minimized.
This comment has been minimized.
|
So as I asked on the mailing list; what |
gibix
force-pushed the
gibix:rust-eclass
branch
from
376eb6a
to
a568af0
Aug 6, 2018
This comment has been minimized.
This comment has been minimized.
|
@lu-zero I too am curious what uses libsyntax and isn't released with the compiler? rustfmt and clippy now days are. They're still in preview so they might have changes separate from the compiler. clippy has always had a tight coupling to the compiler which is why they're now advising folks to not even bindgen isn't https://crates.io/crates/bindgen dependent on libsyntax and it supports a range of rustc versions (it explicitly has a getopt flag for it). |
This comment has been minimized.
This comment has been minimized.
|
Bindgen used to have a quite brittle dependency to rustfmt, now it is less brittle and luckily optional. I have to doublecheck the status of doxydize and the many rust->${language} bindings generators to see if it would make sense to distribute them already. I'm not aware of additional widespread code-analysis tools at the moment, but they would have the same issue. If we restrict the scope to the rustup-provided optional software we have: Having those 3 available as stand-alone ebuilds spares you up to 3x the rustc compile time if we assume those 3 are release-synchronous with the actual compiler. What is exactly the problem in making easier to, hopefully, skip some long rebuilds? |
This comment has been minimized.
This comment has been minimized.
|
Of course skipping rebuilds is nice, but you're acting as if there are no downsides to the approach proposed here, which I disagree with. As I've argued before, there are two in particular:
Finally, I don't see a big advantage to skipping those rebuilds. These extra tools are extremely short builds compared with the main rustc build. Currently the dev-lang/rust build system builds the tools anyway, so you're paying for that cost even if you don't install them. On every minor version bump to rust, you have to rebuild the tools anyway. There's some added cost if you want to change the set of tools installed, but I just don't think that's a common enough scenario to optimize for. |
This comment has been minimized.
This comment has been minimized.
|
Just a note about the complexity on of maintenance we are talking about editing two lines in |
gibix
force-pushed the
gibix:rust-eclass
branch
from
a568af0
to
df065e0
Aug 7, 2018
gibix
added some commits
Aug 7, 2018
gibix
added some commits
Jul 31, 2018
gibix
force-pushed the
gibix:rust-eclass
branch
from
df065e0
to
7f55c9c
Aug 7, 2018
This comment has been minimized.
This comment has been minimized.
|
Pull request CI report Report generated at: 2018-08-07 15:37 UTC New issues caused by PR: |
This comment has been minimized.
This comment has been minimized.
Could you tell me how that would be different from the alternative work-wise? To me it seems pretty much equivalent.
How having a way to do If you are targeting
I just tested on the current nightly, always building those tools would add about 1/6 of the build time, not negligible but also not extremely terrible. rustc
rustfmt
rls
clippy
|
This comment has been minimized.
This comment has been minimized.
So here are the reasons as I can see them:
So, in my view, it's (a) more work, (b) for little gain, (c) and if the feces hit the ventilating device, we (I) get to keep the pieces. |
This comment has been minimized.
This comment has been minimized.
|
Does not look like so:
The assumption that those components are release-synchronized is not correct as well. |
This comment has been minimized.
This comment has been minimized.
|
All of those are preview components. I think it's likely they will also end up with the rustc version numbers before they get out of preview. In general, we can keep chewing on this, but I'm pretty firm in my belief that upstream intends to release all of these tools together as a single package. That doesn't make it impossible to split them out again for our build system, but it does require a whole bunch of effort and continually swimming against the stream if there are issues. I'm not willing to spend that effort. If you are, feel free to put the separate components into the tree and keep them up to date. |
This comment has been minimized.
This comment has been minimized.
|
I care about the current status, IF rustfmt/rls/clippy end up part of rustc I have no problems in fitting them in. Right now that's not the case and having the ability to package programs with strong dependencies on specific rustc version is good in itself. |
This comment has been minimized.
This comment has been minimized.
|
Fine, go ahead and write and maintain separate ebuilds for these other components. I still don't think that warrants all this |
gibix commentedJul 30, 2018
This will allows projects like rustfmt, clippy, bindgen that need runtime linking with the proper rust version to work correctly. Beyond this while rust is getting older as project we will see more projects that will require a specific rust version for compilation.
This PR replaces the need for rustup in gentoo for toolchain handling and components.
requires:
see first discussion on gentoo-rust