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

Fix installSbtn for apple silicon #7426

Closed

Conversation

keynmol
Copy link
Contributor

@keynmol keynmol commented Nov 3, 2023

  1. Handle ARM architecture for non-Linux architectures
  2. Provide a Rosetta fallback if the ARM binary is not available for Apple Silicon

(2) is possibly controversial, because using sbtn through rosetta is always problematic.
But I'm just replicating current behaviour

val isArmArchitecture: Boolean = sys.props
.getOrElse("os.arch", "")
.toLowerCase(java.util.Locale.ROOT) == "aarch64"
val arch = if (Properties.isLinux && isArmArchitecture) "aarch64" else "x86_64"
Copy link
Member

Choose a reason for hiding this comment

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

For ipcsocket we created a universal binary, but for sbtn we didn't?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doesn't look like it - I downloaded sbt-1.9.7.zip:

> file **/sbtn-*
sbt/bin/sbtn-aarch64-apple-darwin: Mach-O 64-bit executable arm64
sbt/bin/sbtn-aarch64-pc-linux:     ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=95129380deb32d427b65bed01926e14e03defe43, for GNU/Linux 3.7.0, with debug_info, not stripped
sbt/bin/sbtn-x86_64-apple-darwin:  Mach-O 64-bit executable x86_64
sbt/bin/sbtn-x86_64-pc-linux:      ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=c847d01e7dc66b4544e2f97cea0e46952b5554ae, for GNU/Linux 3.2.0, with debug_info, not stripped
sbt/bin/sbtn-x86_64-pc-win32.exe:  PE32+ executable (console) x86-64, for MS Windows

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But actually you're right - a fat binary would be much better here.
Can you please point me to the place where the binaries are built before archiving?

It took me embarassing amount of time to get the iterator logic right and I'm super sad to see it being discarded :D

Copy link
Member

Choose a reason for hiding this comment

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

There's a repo called sbt/sbtn-dist where we send CI job to Cirrus for aarch 64. Not sure how difficult it would be to create another job that waits and combines the outputs.

@eed3si9n
Copy link
Member

eed3si9n commented May 6, 2024

Closing this in favor of #7551

@eed3si9n eed3si9n closed this May 6, 2024
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

2 participants