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

Use effective_arch for rustflags #17597

Merged
merged 2 commits into from
Jul 1, 2024

Conversation

git-mann
Copy link
Contributor

@git-mann git-mann commented Jun 30, 2024

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Fix for issue: #17566

This PR adds a parameter to the rustflags_target_cpu method to provide the desired architecture rather than using a hard-coded value of oldest_cpu. This allows for bottles built locally using Rust to use the native CPU architecture.

I was able to test this locally by interactively installing a bottle and checking the RUSTFLAGS environment variable was set correctly.

@MikeMcQuaid
Copy link
Member

This allows for bottles built locally using Rust to use the native CPU architecture.

This means that bottles built locally and bottles built in CI may build different things, breaking both reproducibility and potentially having errors occur in one place and not the other.

@Bo98
Copy link
Member

Bo98 commented Jul 1, 2024

This allows for bottles built locally using Rust to use the native CPU architecture.

This means that bottles built locally and bottles built in CI may build different things, breaking both reproducibility and potentially having errors occur in one place and not the other.

I think they are referring to --build-from-source rather than --build-bottle and on Linux specifically, which is a combo that has always used native (#5505), likely because Homebrew does not have any minimum hardware requirements. Not even any soft-requirements in documentation (with macOS's requirements being consequencal to the minimum OS support so older machines aren't a concern there).

In any case, ENV.effective_arch is what we use for C/C++ so this correctly aligns it with that, and that also supports --bottle-arch.

@MikeMcQuaid
Copy link
Member

Ok, thanks @Bo98.

Thanks so much for your first contribution! Without people like you submitting PRs we couldn't run this project. You rock, @git-mann!

@MikeMcQuaid MikeMcQuaid merged commit 3b4fc69 into Homebrew:master Jul 1, 2024
25 checks passed
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.

None yet

3 participants