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: support build under rosetta2 #21015

Closed
wants to merge 1 commit into from

Conversation

lukaso
Copy link
Contributor

@lukaso lukaso commented Oct 21, 2023

Description

Support building rust under rosetta2 (for x86_64). Otherwise it fails.

See bug report: https://trac.macports.org/ticket/68185

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 13.6 22G120 arm64
Xcode 15.0.1 15A507

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL?
  • checked your Portfile with port lint --nitpick?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?
  • checked that the Portfile's most important variants haven't been broken?

@macportsbot
Copy link

Notifying maintainers:
@MarcusCalhoun-Lopez for port rust.

@macportsbot macportsbot added type: bugfix maintainer: open Affects an openmaintainer port labels Oct 21, 2023
@kencu
Copy link
Contributor

kencu commented Oct 22, 2023

I am suspicious this error is probably coming from our old friend, the misconfiguration of jemalloc running under rosetta due to LG_VADDR not being detected correctly when running under the rosetta emulator.

The block that fixes this in the rust portfile:

if { ${os.arch} eq "arm" } {

will not be activated when you build it with the terminal set to an x86_64 arch, as IIRC, {${os.arch} eq "arm" } does not return true when you run macports in that fashion on an M1.

So another way around this might be to force those env vars that fix this to activate...

build.env-append JEMALLOC_SYS_WITH_LG_VADDR=48
destroot.env-append JEMALLOC_SYS_WITH_LG_VADDR=48

@lukaso
Copy link
Contributor Author

lukaso commented Oct 24, 2023

I'll try this.

@lukaso
Copy link
Contributor Author

lukaso commented Oct 24, 2023

I've tried this and it's not worked.

@kencu
Copy link
Contributor

kencu commented Oct 25, 2023

I've tried this and it's not worked.

That's odd -- because we 100% know that fixes the build of rust when running under rosetta2 and building muniversal with jemalloc enabled...I wonder if the env vars applied...

When @MarcusCalhoun-Lopez does come around again, I can't help but feel fairly sure this is going to be reverted, if it is committed.

But he's not here, and I'm not going to set up another installation of macports running under an x86_64 terminal just to work on this...

Are we sure this PR doesn't break the universal build of rust we have now? We don't want that build to change, for example by building rust two different ways (jemalloc on and jemalloc off).

@lukaso
Copy link
Contributor Author

lukaso commented Oct 25, 2023

I'll be honest, once I changed the Portfile, it stopped building under any circumstances, so I'm not confident anymore. Now I'm trying to figure out how to get any debugging info out of Portfiles. using ui_debug doesn't work. What is the best way to see what is happening when a Portfile is executed? Is there a way to print debugging info to a screen or log?

@lukaso
Copy link
Contributor Author

lukaso commented Nov 1, 2023

I'll be honest, once I changed the Portfile, it stopped building under any circumstances, so I'm not confident anymore. Now I'm trying to figure out how to get any debugging info out of Portfiles. using ui_debug doesn't work. What is the best way to see what is happening when a Portfile is executed? Is there a way to print debugging info to a screen or log?

To answer my own question: use ui_error and the message you want to print. This seems to work in getting a printout without a super excessive debug log.

@kencu
Copy link
Contributor

kencu commented Nov 1, 2023

ui_debug output is visible when you build with the “-d” flag added (debug)

@pmetzger
Copy link
Member

How do we either finish this or close it?

@kencu
Copy link
Contributor

kencu commented Jan 20, 2024

This needs to be re-examined from a fresh start.

@pmetzger
Copy link
Member

@kencu So does that mean we close it and someone starts over? (What is the next concrete action that should be taken?)

@kencu
Copy link
Contributor

kencu commented Jan 20, 2024

sure, I guess.

@kencu kencu closed this Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer: open Affects an openmaintainer port type: bugfix
5 participants