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
chore: Add support for Scala Native 0.5.0 #2293
Conversation
87bc9ed
to
a7e4533
Compare
The failing tests are unrelated, I am fixing it I hope in #2295 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good as far as I can tell. Perhaps @kyouko-taiga would like to chime in?
case LinkerMode.Release if bloop.util.CrossPlatform.isMac => build.LTO.full | ||
case LinkerMode.Release => build.LTO.thin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems pretty weird to do something different for Mac than others? Is that something the sbt plugin does as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's mostly related to LLVM compilation errors happening only on MacOS with LTO=thin
scala-native/scala-native#3833 No idea how to fix it currently.
I have no idea about rest of the codebase and I guess there is no way to configure LTO directly, however we might detect the LTO using env variables? There is a dedicated method to do it, it's used in the sbt plugin.
https://github.com/scala-native/scala-native/blob/4b9f6314a90336d448e0b5cb0fdcb3f122f5c47b/tools/src/main/scala/scala/scalanative/build/Discover.scala#L25
It might be beneficial, because LTO.full can be sometimes slow, so maybe defaulting to LTO.none would be a good choice?
Also, in some configurations LTO=thin might work on MacOS, (see our nightly builds https://github.com/scala-native/scala-native/actions/runs/8226709422/job/22494744082 where we use LLVM linker lld
and LLVM distribution of clang
instead of the one shipped with MacOS (it does not work on M1 chips though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... so for now only change in tests? OR default to none, which would be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defaulting to none is the safest option in my opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched to none as a default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me
I don't know how it my affect the bloop sbt integration but the ScalaNativeKeys
were removed from sbt plugin in 0.5.0 (see PR )
Och, that would not be easy to replace, we use that heavily 😨 https://github.com/scalacenter/bloop/blob/main/integrations/sbt-bloop/src/main/scala/bloop/integrations/sbt/SbtBloop.scala#L741 Why were they removed? How to get the native configuration now? |
In the whole 0.4.x line these were just a legacy settings and used special order of their initialization to copy their values to If you have access to |
I will try and do a follow up to handle that. |
No description provided.