Skip to content

Conversation

lefou
Copy link
Member

@lefou lefou commented Aug 19, 2025

For each main class, we need an additional linking task. Due to the fact, that we don't know the name of the main class to run before, we currently can't cache the result of the linking task for user-provided main classes.

See discussion for a potential solution:

Also replaced the directly defined run task by implementing runner(): Runner, so that users can run native mains in more situations. The run method is now obsolete and is kept to do the same as super.run() to preserve binary compatibility.

Fix #5461

@lefou lefou marked this pull request as ready for review August 23, 2025 09:17
@lefou lefou requested review from lolgab and lihaoyi August 23, 2025 13:16
@lefou lefou merged commit dde8086 into com-lihaoyi:main Aug 24, 2025
33 checks passed
@lefou lefou deleted the tr-fix-scala-native-run-main branch August 24, 2025 20:27
@lefou lefou added this to the 1.0.4 milestone Aug 24, 2025
vaslabs pushed a commit to vaslabs-ltd/mill that referenced this pull request Aug 26, 2025
For each main class, we need an additional linking task. Due to the
fact, that we don't know the name of the main class to run before, we
currently can't cache the result of the linking task for user-provided
main classes.

See discussion for a potential solution:
*
com-lihaoyi#4595 (comment)
*
com-lihaoyi#4595 (comment)

Also replaced the directly defined `run` task by implementing `runner():
Runner`, so that users can run native mains in more situations. The
`run` method is now obsolete and is kept to do the same as `super.run()`
to preserve binary compatibility.

Fix com-lihaoyi#5461

Pull request: com-lihaoyi#5723
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.

runMain for ScalaNativeModule runs a JVM launcher
2 participants