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

haskell_stack-1.0 PG: Fix architecture checks on M1 #13503

Closed
wants to merge 1 commit into from

Conversation

essandess
Copy link
Contributor

stack builds x86_64 binaries on both arm64 and x86_64 architectures

Description

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

macOS 12.1 21C52 arm64
Xcode 13.2.1 13C100

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?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?

@kencu
Copy link
Contributor

kencu commented Dec 31, 2021

I can't exactly guess, so when the arm mac builds a haskell port using this addition, what do they look like?

Does macports think it installed an arm port (and registered it as such)?

But is it really arch x86_64?

@essandess
Copy link
Contributor Author

essandess commented Jan 1, 2022

I can't exactly guess, so when the arm mac builds a haskell port using this addition, what do they look like?

Does macports think it installed an arm port (and registered it as such)?

But is it really arch x86_64?

This is stated both in the code and above:

stack builds x86_64 binaries on both arm64 and x86_64 architectures

The binaries it builds run on both arm64 and x86_64 architectures.

@kencu
Copy link
Contributor

kencu commented Jan 1, 2022

does port think it installed an arm arch? Is it it really x86_64?

If so, no bueno.

@essandess
Copy link
Contributor Author

does port think it installed an arm arch? Is it it really x86_64?

If so, no bueno.

Yes, bueno. x86_64 binaries run on arm; therefore, haskell-built ports supports both arm64 and x86_64. Otherwise there’s a bug in MacPorts identified in the trac ticket.

@kencu
Copy link
Contributor

kencu commented Jan 1, 2022

sell it to Ryan, then. He turned this idea down 10 times already :)

@essandess
Copy link
Contributor Author

I do not know what you are referring to.

The only fixes I'm aware for the haskell-related arm/intel install issues is to:

  1. Add the supported_archs for both Arm and Intel because both work.
  2. Remove the supported_archs directive completely.
  3. Fix whatever MacPorts issue causes https://trac.macports.org/ticket/63944

The first is the obvious, simplest and I believe correct approach.

@essandess
Copy link
Contributor Author

@ryandesign May we please get some of your cycles on this PR?

As it stands on M1, haskell_stack port builds fail with an architecture mismatch error, e.g.

sudo port -pNc destroot adblock2privoxy
Error: Cannot install adblock2privoxy for the arch 'x86_64' because
Error: its dependency stack is only installed for the arch 'arm64'
Error: and does not have a universal variant.
Error: Unable to execute port: architecture mismatch

I'm happy to kick this upstairs to a general MacPorts bug if necessary, but something is definitely broken in the logic of building with stack on M1, and this PR fixes it.

@essandess
Copy link
Contributor Author

Fixed by b1e5f73

@essandess essandess closed this Mar 12, 2022
@essandess essandess deleted the haskell_stack branch March 12, 2022 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants