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

dev-lang/rust: Drop our custom package (1.80.0) in favour of upstream Gentoo's (1.80.1) #2237

Merged
merged 2 commits into from
Aug 15, 2024

Conversation

chewi
Copy link
Contributor

@chewi chewi commented Aug 15, 2024

Switch to Gentoo Rust package and upgrade to 1.80.1

It is not clear why this was forked originally. One reason was to avoid the sys-apps/lsb-release dependency, but it probably wasn't just that. It seems likely that the upstream package did not support cross targets at the time. Now it does.

The package builds significantly faster now that LTO is no longer enabled, especially given that it was the expensive "fat" LTO rather than "thin" LTO. The installed size is still kept down by masking rustdoc.

Cross targets are now handled via the admittedly experimental RUST_CROSS_TARGETS support. This has been in place for a while, and I think it is fairly widely used now. If it does disappear, it would almost certainly be for something even better.

How to use

Nothing much to see. Grab the new SDK and build some Rust.

Testing done

This has been through many Jenkins runs. Everything looks good.

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)
  • Inspected CI output for image differences: /boot and /usr size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.

@chewi chewi requested a review from a team August 15, 2024 12:49
@chewi chewi self-assigned this Aug 15, 2024
We have previously avoided this package because its /etc/lsb-release
clashes with the symlink created by our sys-apps/baselayout. This has
led to the need to fork some packages, such as dev-lang/rust, just to
avoid the dependency.

Instead, we can just stop it from installing /etc/lsb-release with
INSTALL_MASK. I also considered having it create the symlink instead of
baselayout, but baselayout has the tmpfiles.d handling, so this is
simpler.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
@chewi
Copy link
Contributor Author

chewi commented Aug 15, 2024

This would supersede #2229.

Copy link

Build action triggered: https://github.com/flatcar/scripts/actions/runs/10404098312

Copy link
Member

@krnowak krnowak left a comment

Choose a reason for hiding this comment

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

I think you'll need to also drop rust-apply-patch.sh and rust-release-main.yaml from .github/workflows - our package automation is going to take over updating rust.

It is not clear why this was forked originally. One reason was to avoid
the sys-apps/lsb-release dependency, but it probably wasn't just that.
It seems likely that the upstream package did not support cross targets
at the time. Now it does.

It appears that LTO was previously enabled by us following Gentoo rather
than through an explicit decision. They now disable it by default, so we
do likewise. It previously used "fat" LTO, which makes Rust especially
slow to build and reportedly made rustc slower than with "thin" LTO!
There seems little benefit in using thin LTO given that we rebuild Rust
almost as much as the packages that use it, plus we don't enable LTO
anywhere else.

We still avoid rustdoc to keep the size down using INSTALL_MASK. This
isn't as good as not building it in the first place, but this alone
isn't worth keeping a fork.

Cross targets are now handled via the admittedly experimental
RUST_CROSS_TARGETS support. This has been in place for a while, and I
think it is fairly widely used now. If it does disappear, it would
almost certainly be for something even better.

This also updates Rust from 1.80.0 to 1.80.1.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
@chewi chewi merged commit 2a70198 into main Aug 15, 2024
1 check failed
@chewi chewi deleted the chewi/gentoo-rust branch August 15, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

3 participants