-
Notifications
You must be signed in to change notification settings - Fork 931
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
sbt doesn't start on arm64-macos #6162
Comments
@catap Thanks for the report. This is somewhat expected since modern sbt uses a lot of native code to access functionalities not provided by the JVM out-of-box. For this specific error, maybe you could try: serverConnectionType := ConnectionType.Tcp, In general though we should make sure to provide pure-Java fallbacks for all critical features. |
This might be fixed by #6165 though I'm not sure where else we may be using the jna in transitive dependencies. |
I've tried 13b09bc as root that I've published as It is crashed but at another place.
|
Created an issue on Swoval - swoval/swoval#141 |
I made small investigation and looks like sbt-1.0.x works fine. |
@catap if you apply the following patches to your local sbt build, I'm hoping a snapshot version might startup: diff --git a/build.sbt b/build.sbt
index 443a3661b..2995c87f4 100644
--- a/build.sbt
+++ b/build.sbt
@@ -917,6 +917,7 @@ lazy val mainProj = (project in file("main"))
case v if v.startsWith("2.12.") => List(compilerPlugin(silencerPlugin))
case _ => List()
}),
+ libraryDependencies += "com.swoval" % "file-tree-views" % "2.1.6",
managedSourceDirectories in Compile +=
baseDirectory.value / "src" / "main" / "contraband-scala",
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
diff --git a/project/Dependencies.scala b/project/Dependencies.scala
index 2dce163ae..51b43f482 100644
--- a/project/Dependencies.scala
+++ b/project/Dependencies.scala
@@ -26,7 +26,7 @@ object Dependencies {
val launcherInterface = "org.scala-sbt" % "launcher-interface" % launcherVersion
val rawLauncher = "org.scala-sbt" % "launcher" % launcherVersion
val testInterface = "org.scala-sbt" % "test-interface" % "1.0"
- val ipcSocket = "org.scala-sbt.ipcsocket" % "ipcsocket" % "1.1.0"
+ val ipcSocket = "org.scala-sbt.ipcsocket" % "ipcsocket" % "1.2.0"
private val compilerInterface = "org.scala-sbt" % "compiler-interface" % zincVersion
private val compilerClasspath = "org.scala-sbt" %% "zinc-classpath" % zincVersion
|
@eatkins patch doesn't work, it crashed as it was at #6162 (comment). I did small investigation to proof that the first chunk at the patch isn't enough:
|
That was mistaken. I am confused though because the patch definitely works for me. I published a local version with a snapshot version of swoval that added a println and I did see a println when I ran sbt. |
@eatkins anyway, I suprised that it has 4 different versions. Not two for sbt that I run and that I build. |
What do you see when you run |
I move by easy way when: It allows to start Anyway, it do not crash. What is very good news.
|
I guess we almost here, in the world where |
Great. It looks like we need one more small ipcsocket fix to avoid that particular crash. In the meantime, you should be able to workaround that with |
@eatkins let make it right ;) It doesn't block me because this machine was bought special for experiments and it makes tons of fun for last week :) |
Yea. The check introduced in #3932 is using JNA? Maybe we can hardcode some known max length when JNI is used. https://linux.die.net/man/7/unix
#define UNIX_PATH_MAX 108
struct sockaddr_un {
sa_family_t sun_family; /* AF_UNIX */
char sun_path[UNIX_PATH_MAX]; /* pathname */
}; macOS / BSD uses 104 characters - https://unix.stackexchange.com/questions/367008/why-is-socket-path-length-limited-to-a-hundred-chars |
These experiments will prove useful for lots of future users! |
@eed3si9n it is very bad idea to hardcode this value. Very bad. |
If Linux or macOS already hardcoded it in |
@eed3si9n yes, this is header and it is used on compilation time. Can it be changed? Yes, and SBT should follow this changes that is quite difficult to do. From another hand I feel that I miss this constant with I made a small grep on all available systems and looks like you right: |
BTW with |
@catap now that you have the server running, I am curious if the thin client works. Assuming you have the sbt script installed, does sbt --client work? Or you could try the apple binary from https://github.com/sbt/sbtn-dist/releases/download/v1.4.4/sbtn-x86_64-apple-darwin-1.4.4.tar.gz. I think it's supposed to work with rosetta since it's an executable (I think dlopen doesn't work with rosetta which was why we had to publish new versions of swoval and ipcsocket) but it would be nice to have confirmation (apparently a graal binary should work: oracle/graal#2666.). |
@eatkins I assume that Anyway, if you can provide a way to start it via Rosseta is quite tricky. It depends on version of java. If java is installed that is for |
@eatkins about
|
Not really.
The client mode allows you to connect to an already running server to issue commands. This allows you to run sbt commands from the shell without having to start a new server, which we all know is very slow. You can see what it looks like here https://twitter.com/eed3si9n/status/1302754076841648134 and here #5620. The steps to test that don't involve the sbt script are
|
@eatkins am I right that current master should work without hack? |
Not quite. The current master needs a new version of https://github.com/sbt/io which I don't think has been published yet. Because of that, you would still need the hack to add diff --git a/build.sbt b/build.sbt
index 443a3661b..2995c87f4 100644
--- a/build.sbt
+++ b/build.sbt
@@ -917,6 +917,7 @@ lazy val mainProj = (project in file("main"))
case v if v.startsWith("2.12.") => List(compilerPlugin(silencerPlugin))
case _ => List()
}),
+ libraryDependencies += "com.swoval" % "file-tree-views" % "2.1.6",
managedSourceDirectories in Compile +=
baseDirectory.value / "src" / "main" / "contraband-scala",
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala", |
@eatkins let's wait when until everything is ready :) Feel free ping me here to confirm that it is working from master branch. |
@eatkins I just realised that master is |
Yeah, 1.4.x has all of the required fixes. |
@eed3si9n any plan to release 1.4.5? |
For the 1.4.x series, we have been releasing on a roughly weekly to biweekly schedule. We just made a new release last weekend so I would imagine this release should be out at worse within the next 10-14 days. |
Not sure how |
@eed3si9n it was installed via macports and it is I'm waiting until you released |
Could you try the launcher in sbt 1.4.4? https://github.com/sbt/sbt/releases/tag/v1.4.4 That should be able to launch both nightlies and 0.13 builds. |
|
@eed3si9n and the say issue happened if I use |
I think you specified |
@eed3si9n I definitely need a wine! Anyway, without a typo it doesn't work neither.
|
https://dl.bintray.com/sbt/maven-snapshots/org/scala-sbt/sbt/1.5.0-bin-20201127T081401/ 1.5.0-20201127T081401 is missing |
Yes, |
Awesome. Thanks for testing! |
Just chiming in to say thanks for doing this work folks, very timely. The following works perfectly compiling cats source for me 🙏
|
Sorry for hijacking this thread, but:
|
@hrj enabled Discussions. |
Hi, |
The support for Apple silicon M1 (AArch64, ARM64) was added in sbt 1.4.5. In general you should use the latest stable version, which is 1.4.7 now. The version of sbt is determined both by the launcher and the project-specific declaration in |
steps
java -jar /opt/local/share/sbt/sbt-launch.jar
problem
expectation
It should work.
notes
I've opened a linked ticket sbt/ipcsocket#10, anyway I feel that it might be fixed also in sbt some how.
The text was updated successfully, but these errors were encountered: