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

rust: update to 1.73.0 #22380

Merged
merged 1 commit into from
Oct 14, 2023
Merged

rust: update to 1.73.0 #22380

merged 1 commit into from
Oct 14, 2023

Conversation

oskarirauta
Copy link
Contributor

changelog at https://github.com/rust-lang/rust/releases/tag/1.73.0

Maintainer: @lu-zero
Compile tested: x86_64, latest git
Run tested: x86_64, latest git

@oskarirauta
Copy link
Contributor Author

Also preparation to conversation started here about musl host support, but this just updates to 1.73.0.

@Ansuel
rust has been long supported with musl(host) with various repositories, such as alpine. Also if openwrt is supported as a build host, by using openwrt/openwrt#12667 and as it seems, with gentoo as well now that 1.73.0 is out, by just patching it to use newer libc from gentoo at here

support provided by alpine is a bit too complex, I was never able to adopt it to openwrt packages. With 1.73.0 and libc patch, it worked like a charm with --set=target.$(RUSTC_TARGET_ARCH).crt-static=false in TARGET_CONFIGURE_ARGS - using that with glibc does not hurt, but I think it would be nicer to retain it as it is and use it only if build host is musl.

But this is just conversation about topic. Hopefully idea gets some hope, but let's update rust first.

@oskarirauta oskarirauta marked this pull request as draft October 12, 2023 13:54
@oskarirauta oskarirauta marked this pull request as ready for review October 12, 2023 15:11
@lu-zero
Copy link
Contributor

lu-zero commented Oct 12, 2023

support provided by alpine is a bit too complex, I was never able to adopt it to openwrt packages. With 1.73.0 and libc patch, it worked like a charm with --set=target.$(RUSTC_TARGET_ARCH).crt-static=false in TARGET_CONFIGURE_ARGS - using that with glibc does not hurt, but I think it would be nicer to retain it as it is and use it only if build host is musl.

Doesn't hurt and since OpenWrt favours shared libraries it is future proof for when we'll have to consider other libcs.

let llvm_assertions = self.llvm_assertions;

let cache_prefix = format!("llvm-{}-{}", llvm_sha, llvm_assertions);
let cache_prefix = format!("llvm-{llvm_sha}-{llvm_assertions}");
- let cache_dst = self.out.join("cache");
+ let cache_dst = match env::var_os("OPENWRT_RUSTC_BOOTSTRAP_CACHE") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably we could float it towards upstream using a less os-specific name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll put there whatever you want- that is just refreshed patch that appeared in previous package release update (1.72.0-3) without me doing any actual changes.

Copy link
Contributor

@lu-zero lu-zero left a comment

Choose a reason for hiding this comment

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

Looks fine, thank you for updating it :)

@oskarirauta
Copy link
Contributor Author

oskarirauta commented Oct 12, 2023

Doesn't hurt and since OpenWrt favours shared libraries it is future proof for when we'll have to consider other libcs.

Should I then add it to this already?
Did you by any chance see this patch? With combination of added configuration argument and patch, it builds without issues on latest musl too as a build host. Any opinions on it?

@lu-zero
Copy link
Contributor

lu-zero commented Oct 12, 2023

I'm fine with folding it in :) (and also your change for crt-static)

@oskarirauta
Copy link
Contributor Author

Okay, thanks.. I'll make the necessary adjustment to PR..

patches refreshed.
changelog at https://github.com/rust-lang/rust/releases/tag/1.73.0

Also added a configuration ardument and patch
from https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-lang/rust/files/1.72.0-bump-libc-deps-to-0.2.146.patch?id=515b5920046117355d88b3494c74da269ce9b30a
to provide support for building rust on musl hosts.

Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>

rust: add support for musl build hosts

Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>
@oskarirauta
Copy link
Contributor Author

@lu-zero

Where are we at with that os branding topic within patch 0002-rustc-bootstrap-cache.patch?

@jefferyto
Copy link
Member

Re: 0002-rustc-bootstrap-cache.patch - the bootstrap already "caches" downloaded files in the build directory. I imagine this is fine for normal users but for us the build directory is not persisted between builds. I'm not sure upstream would be interested in adding more customization (like an environment variable) for where to save this cache, but then again I never asked.

@lu-zero
Copy link
Contributor

lu-zero commented Oct 13, 2023

I think it is a good idea overall, sometimes you may have more than a tree around even in other scenarios :)

@oskarirauta
Copy link
Contributor Author

So, how do we proceed?

@lu-zero
Copy link
Contributor

lu-zero commented Oct 13, 2023

I'd land this set, anybody willing to change the env name to RUSTC_BOOTSTRAP_CACHE and send upstream for the future?

@jefferyto
Copy link
Member

I'd land this set, anybody willing to change the env name to RUSTC_BOOTSTRAP_CACHE and send upstream for the future?

I opened rust-lang/rust#116697. I think the patch here can stay as it is until if/when the change is merged upstream.

@oskarirauta
Copy link
Contributor Author

Though I thought that I don't participate in decision about it, I have to say that I agree; maybe it's not topic of this PR. Do good.

@1715173329 1715173329 merged commit d3b1b0d into openwrt:master Oct 14, 2023
12 checks passed
@oskarirauta oskarirauta deleted the rust branch November 18, 2023 15:18
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.

4 participants