Skip to content

sloth: bump to 0.1.0-M2 & patch loose class files at -cp - #4404

Draft
Gedochao wants to merge 2 commits into
VirtusLab:mainfrom
Gedochao:feature/sloth-patch-cp
Draft

sloth: bump to 0.1.0-M2 & patch loose class files at -cp#4404
Gedochao wants to merge 2 commits into
VirtusLab:mainfrom
Gedochao:feature/sloth-patch-cp

Conversation

@Gedochao

@Gedochao Gedochao commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

This makes Sloth patch loose classfiles passed via -cp.
It also bumps Sloth to 0.1.0-M2: https://github.com/VirtusLab/sloth/releases/tag/v0.1.0-M2

Behaviour without this change

Given a lazy.scala file:

lazy val hah = true
def slothful: Boolean = hah

when

scala-cli compile --server=false lazy.scala -S lts --jvm 8 -d cp
scala-cli run --server=false -e 'println(slothful)' -cp cp --sloth --power --jvm 25  

we still get the warning

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by scala.runtime.LazyVals$ 
(file:(...)/scala-library-3.8.4.jar)
WARNING: Please consider reporting this to the maintainers of class scala.runtime.LazyVals$
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release

Checklist

  • tested the solution locally and it works
  • ran the code formatter (scala-cli fmt .)
  • ran scalafix (./mill -i __.fix)

How much have your relied on LLM-based tools in this contribution?

extensively

How was the solution tested?

included automated tests

@Gedochao Gedochao changed the title sloth: patch loose class files at -cp [WIP] sloth: patch loose class files at -cp Jul 31, 2026
@Gedochao
Gedochao force-pushed the feature/sloth-patch-cp branch 2 times, most recently from 188d0c8 to 44bd2fb Compare August 5, 2026 13:13
@Gedochao
Gedochao marked this pull request as ready for review August 5, 2026 13:15
@Gedochao
Gedochao force-pushed the feature/sloth-patch-cp branch from 44bd2fb to 1128325 Compare August 5, 2026 13:15
@Gedochao Gedochao changed the title [WIP] sloth: patch loose class files at -cp sloth: patch loose class files at -cp Aug 5, 2026
@Gedochao

Gedochao commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

The native image failures seem to be caused by a bug in Sloth's JarProcessor.
They're not directly related to the fix here, but seem to have been activated by the changes.
While we could theoretically work around it here, I'm thinking it's actually best to fix it upstream first:

Moving this PR to draft for now.

@warcholjakub warcholjakub left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Things I noticed before the PR got drafted

Comment thread modules/cli/src/main/scala/scala/cli/commands/util/BuildCommandHelpers.scala Outdated
Comment thread modules/cli/src/main/scala/scala/cli/commands/package0/Package.scala Outdated
@Gedochao

Gedochao commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

@Gedochao
Gedochao force-pushed the feature/sloth-patch-cp branch 3 times, most recently from 2fd40b8 to dc297b6 Compare August 11, 2026 07:49
@Gedochao Gedochao changed the title sloth: patch loose class files at -cp sloth: bump to 1.0.0-M2 & patch loose class files at -cp Aug 11, 2026
@Gedochao Gedochao changed the title sloth: bump to 1.0.0-M2 & patch loose class files at -cp sloth: bump to 0.1.0-M2 & patch loose class files at -cp Aug 11, 2026
@Gedochao
Gedochao force-pushed the feature/sloth-patch-cp branch from dc297b6 to 60088f4 Compare August 12, 2026 12:48
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.

2 participants