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

Update Scala Native to 0.5.1 #2862

Merged
merged 15 commits into from Apr 23, 2024

Conversation

scala-steward
Copy link
Contributor

About this PR

πŸ“¦ Updates

from 0.4.17 to 0.5.1

πŸ“œ GitHub Release Notes - Version Diff

Usage

βœ… Please merge!

I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.

If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.

Configure Scala Steward for your repository with a .scala-steward.conf file.

Have a fantastic day writing Scala!

πŸ” Files still referring to the old version number

The following files still refer to the old version number (0.4.17).
You might want to review and update them manually.

website/docs/reference/cli-options.md
website/docs/reference/scala-command/cli-options.md
website/docs/reference/scala-command/runner-specification.md
website/docs/release_notes.md
βš™ Adjust future updates

Add this to your .scala-steward.conf file to ignore future updates of this dependency:

updates.ignore = [ { groupId = "org.scala-native" } ]

Or, add this to slow down future updates of this dependency:

dependencyOverrides = [{
  pullRequests = { frequency = "30 days" },
  dependency = { groupId = "org.scala-native" }
}]
labels: library-update, early-semver-major, semver-spec-minor, old-version-remains, commit-count:1

@Gedochao Gedochao changed the title Update test-runner, tools to 0.5.1 Update Scala Native to 0.5.1 Apr 18, 2024
@Gedochao Gedochao self-assigned this Apr 18, 2024
@Gedochao Gedochao self-requested a review April 18, 2024 09:04
@Gedochao Gedochao force-pushed the update/test-runner-0.5.1 branch 2 times, most recently from d65d652 to 82c80ba Compare April 22, 2024 14:54
@Gedochao
Copy link
Contributor

If any Scala CLI integration does not support Scala Native 0.5.x, the default Scala Native version will be downgraded to 0.4.17 now.

scala-cli run --native -e 'println("Hello")' --toolkit default
# [warn] Scala Toolkit does not support Scala Native 0.5.1, 0.4.17 should be used instead.
# [warn] Scala Native default version 0.5.1 is not supported in this build. Using 0.4.17 instead.
# Compiling project (Scala 3.4.1, Scala Native 0.4.17)
# Compiled project (Scala 3.4.1, Scala Native 0.4.17)
# [info] Linking (933 ms)
# [info] Checking intermediate code (quick) (59 ms)
# [info] Discovered 743 classes and 4242 methods
# [info] Optimizing (debug mode) (771 ms)
# [info] Generating intermediate code (553 ms)
# [info] Produced 10 files
# [info] Compiling to native code (1941 ms)
# [info] Linking with [pthread, dl]
# [info] Total (4386 ms)
# Hello

Mind that this only affect the default Scala Native version.
If the version is provided explicitly, it will be respected (and fail).

scala-cli run --native -e 'println("Hello")' --toolkit default --native-version 0.5.1
# Downloading 4 dependencies and 2 internal dependencies
# [error]  Error downloading org.scala-lang:toolkit_native0.5_3:0.2.1
# [error]   not found: /Users/pchabelski/.ivy2/local/org.scala-lang/toolkit_native0.5_3/0.2.1/ivys/ivy.xml
# [error]   not found: https://repo1.maven.org/maven2/org/scala-lang/toolkit_native0.5_3/0.2.1/toolkit_native0.5_3-0.2.1.pom
# [error]   not found: /Users/pchabelski/Library/Caches/ScalaCli/local-repo/1.2.2-26-82c80b/org.scala-lang/toolkit_native0.5_3/0.2.1/ivys/ivy.xml
# [error]   No fallback URL found
# [error] COMMAND_LINE

Similarly, no warning would be printed when 0.4.17 is deliberately passed by the user as the native version.

scala-cli run --native -e 'println("Hello")' --toolkit default --native-version 0.4.17
# Compiling project (Scala 3.4.1, Scala Native 0.4.17)
# Compiled project (Scala 3.4.1, Scala Native 0.4.17)
# [info] Linking (890 ms)
# [info] Checking intermediate code (quick) (65 ms)
# [info] Discovered 743 classes and 4242 methods
# [info] Optimizing (debug mode) (649 ms)
# [info] Generating intermediate code (643 ms)
# [info] Produced 10 files
# [info] Compiling to native code (1757 ms)
# [info] Linking with [pthread, dl]
# [info] Total (4123 ms)
# Hello

Finally, if no troublesome dependencies are being passed, Scala Native 0.5.1 is now the default.

scala-cli run --native -e 'println("Hello")'                                          
# Compiling project (Scala 3.4.1, Scala Native 0.5.1)
# Compiled project (Scala 3.4.1, Scala Native 0.5.1)
# [info] Linking (multithreadingEnabled=true, disable if not used) (909 ms)
# [info] Discovered 882 classes and 5388 methods after classloading
# [info] Checking intermediate code (quick) (38 ms)
# [info] Multithreading was not explicitly enabled - initial class loading has not detected any usage of system threads. Multithreading support will be disabled to improve performance.
# [info] Linking (multithreadingEnabled=false) (311 ms)
# [info] Discovered 499 classes and 2501 methods after classloading
# [info] Checking intermediate code (quick) (10 ms)
# [info] Discovered 478 classes and 1916 methods after optimization
# [info] Optimizing (debug mode) (423 ms)
# [info] Produced 9 LLVM IR files
# [info] Generating intermediate code (442 ms)
# [info] Compiling to native code (1431 ms)
# [info] Linking with [pthread, dl]
# [info] Linking native code (immix gc, none lto) (64 ms)
# [info] Postprocessing (0 ms)
# [info] Total (3587 ms)
# Hello

Copy link
Member

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

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

Super minor otherwise ok. Don't love the need for adding this error, but I guess there is no better way :/

@Gedochao Gedochao merged commit 3e59ef1 into VirtusLab:main Apr 23, 2024
75 checks passed
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

4 participants