Comments (8)
Thanks a ton for you work on tracking this down and for explaining it. This makes sense and seems doable. I've just been playing around a bit with Mill so this will be good for me to try and figure out and fix. If it's alright I'll leave this open a bit just to reference until I get it fixed. Thanks again @alexarchambault π .
from apps.
This is taken care of now in com-lihaoyi/mill#941
from apps.
@ckipp01 Could it be a mill version mismatch? I'm getting the following:
$ cs launch mill:0.7.3 -- app.run
Compiling /Users/alexandre/projects/test/minimalApplication-0.7.3/build.sc
[26/36] app.compile
Compiling compiler interface...
9 warnings
[info] Compiling 1 Scala source to /Users/alexandre/projects/test/minimalApplication-0.7.3/out/app/compile/dest/classes ...
[info] Done compiling.
[36/36] app.run
juil. 27, 2020 3:52:07 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.8.Final
juil. 27, 2020 3:52:07 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.8.Final
^C
$ cs launch mill:0.8.0 -- app.run
[26/36] app.compile
[info] Compiling 1 Scala source to /Users/alexandre/projects/test/minimalApplication-0.7.3/out/app/compile/dest/classes ...
[info] Done compiling.
[28/36] app.finalMainClass
1 targets failed
app.finalMainClass No main class specified or found
Right now, the mill
binary installed by cs
isn't really a universal mill launcher⦠It only launches its own mill version, which may not be the one of the project at hand.
from apps.
Yes so that's exactly what I see as well @alexarchambault. I guess the thing that confuses me is that in the minimalApplication-0.7.3
the DEFAULT_MILL_VERSION
is set to 0.7.3
and again, this works. If I manually change that value for it to default to 0.8.0
and then run ./mill app.run
it still works. But then when again running from mill app.run
it doesn't find the main class.
Just to be super clear:
- Freshly unzip the project and run with coursier installed mill
β― cs launch mill:0.8.0 -- app.run
Compiling /Users/ckipp/Downloads/minimalApplication-0.7.3/build.sc
[26/36] app.compile
[info] Compiling 1 Scala source to /Users/ckipp/Downloads/minimalApplication-0.7.3/out/app/compile/dest/classes ...
[info] Done compiling.
[28/36] app.finalMainClass
1 targets failed
app.finalMainClass No main class specified or found
- Try with mill wrapper, see version change and it works
β― ./mill app.run
Mill version changed (0.8.0 -> 0.7.3), re-starting server
[36/36] app.run
Jul 27, 2020 4:05:44 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.8.Final
Jul 27, 2020 4:05:44 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.8.Final
- So then manually change
DEFAULT_MILL_VERSION
to0.8.0
in wrapper and try again
β― ./mill --version
Mill Build Tool version 0.8.0
Java version: 1.8.0_242, vendor: BellSoft, runtime: /Users/ckipp/.sdkman/candidates/java/8.0.242-librca/jre
Default locale: en_NL, platform encoding: UTF-8
OS name: "Mac OS X", version: 10.15.5, arch: x86_64
...
β― ./mill app.run
Compiling /Users/ckipp/Downloads/minimalApplication-0.7.3/build.sc
[36/36] app.run
Jul 27, 2020 4:08:37 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.8.Final
Jul 27, 2020 4:08:37 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.8.Final
- Then try again with mill installed via coursier
β― cs launch mill:0.8.0 -- app.run
Compiling /Users/ckipp/Downloads/minimalApplication-0.7.3/build.sc
[26/36] app.compile
[info] Compiling 1 Scala source to /Users/ckipp/Downloads/minimalApplication-0.7.3/out/app/compile/dest/classes ...
[info] Done compiling.
[28/36] app.finalMainClass
1 targets failed
app.finalMainClass No main class specified or found
So I just don't get why using ./mill app.run
here and cs launch mill:0.8.0 -- app.run
don't act the same when they are using 0.8.0
. If you don't think this has anything to do with Coursier, by all means close it, but when I pointed this out to Li Haoyi he pointed me here.
from apps.
Mmmhhβ¦ Something may have changed in the way mill starts, or maybe we don't fetch the exact same class path as the one it generates its assembly withβ¦
Bisected that to those commits:
$ cs launch mill:0.7.4-5-438ebc -- app.run
[26/36] app.compile
Compiling compiler interface...
9 warnings
[info] Compiling 1 Scala source to /Users/alexandre/projects/test/minimalApplication-0.7.3/out/app/compile/dest/classes ...
[info] Done compiling.
[36/36] app.run
juil. 27, 2020 5:18:06 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.8.Final
juil. 27, 2020 5:18:06 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.8.Final
^C
$ cs launch mill:0.7.4-7-6b492a -- app.run
[26/36] app.compile
[info] Compiling 1 Scala source to /Users/alexandre/projects/test/minimalApplication-0.7.3/out/app/compile/dest/classes ...
[info] Done compiling.
[28/36] app.finalMainClass
1 targets failed
app.finalMainClass No main class specified or found
from apps.
Possibly a class path issue then⦠Those forced versions do not end up in the POM, so we don't respect them when fetching mill from coursier.
from apps.
Yeah, confirmed:
$ cs launch mill:0.7.4-7-6b492a -V org.scalameta:trees_2.13:4.3.7 -- app.run
Compiling /Users/alexandre/projects/test/minimalApplication-0.7.3/build.sc
[26/36] app.compile
Compiling compiler interface...
9 warnings
[info] Compiling 1 Scala source to /Users/alexandre/projects/test/minimalApplication-0.7.3/out/app/compile/dest/classes ...
[info] Done compiling.
[36/36] app.run
juil. 27, 2020 5:23:20 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.8.Final
juil. 27, 2020 5:23:20 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.8.Final
^C
from apps.
Basically, to fix that, mill itself should exclude org.scalameta::trees
when it depends on com.lihaoyi:::ammonite-interp
:
$ cs resolve mill:0.7.4-7-6b492a --what-depends-on org.scalameta:trees_2.13
Result:
ββ org.scalameta:trees_2.13:4.3.20
ββ com.lihaoyi:ammonite-interp_2.13.2:2.2.0
β ββ com.lihaoyi:ammonite-repl_2.13.2:2.2.0
β β ββ com.lihaoyi:ammonite_2.13.2:2.2.0
β β ββ com.lihaoyi:mill-main-core_2.13:0.7.4-7-6b492a
β β ββ com.lihaoyi:mill-main_2.13:0.7.4-7-6b492a
β β ββ com.lihaoyi:mill-scalalib_2.13:0.7.4-7-6b492a
β β ββ com.lihaoyi:mill-dev_2.13:0.7.4-7-6b492a
β β ββ com.lihaoyi:mill-scalajslib_2.13:0.7.4-7-6b492a
β β β ββ com.lihaoyi:mill-dev_2.13:0.7.4-7-6b492a
β β ββ com.lihaoyi:mill-scalanativelib_2.13:0.7.4-7-6b492a
β β ββ com.lihaoyi:mill-dev_2.13:0.7.4-7-6b492a
β ββ com.lihaoyi:ammonite_2.13.2:2.2.0
β ββ com.lihaoyi:mill-main-core_2.13:0.7.4-7-6b492a
β ββ com.lihaoyi:mill-main_2.13:0.7.4-7-6b492a
β ββ com.lihaoyi:mill-scalalib_2.13:0.7.4-7-6b492a
β ββ com.lihaoyi:mill-dev_2.13:0.7.4-7-6b492a
β ββ com.lihaoyi:mill-scalajslib_2.13:0.7.4-7-6b492a
β β ββ com.lihaoyi:mill-dev_2.13:0.7.4-7-6b492a
β ββ com.lihaoyi:mill-scalanativelib_2.13:0.7.4-7-6b492a
β ββ com.lihaoyi:mill-dev_2.13:0.7.4-7-6b492a
ββ com.lihaoyi:mill-main-core_2.13:0.7.4-7-6b492a org.scalameta:trees_2.13:4.3.7 -> 4.3.20
ββ com.lihaoyi:mill-main_2.13:0.7.4-7-6b492a
ββ com.lihaoyi:mill-scalalib_2.13:0.7.4-7-6b492a
ββ com.lihaoyi:mill-dev_2.13:0.7.4-7-6b492a
ββ com.lihaoyi:mill-scalajslib_2.13:0.7.4-7-6b492a
β ββ com.lihaoyi:mill-dev_2.13:0.7.4-7-6b492a
ββ com.lihaoyi:mill-scalanativelib_2.13:0.7.4-7-6b492a
ββ com.lihaoyi:mill-dev_2.13:0.7.4-7-6b492a
That way, org.scalameta::trees
would stay on 4.3.7
and wouldn't be bumped to 4.3.20
, and the forceVersion()
wouldn't be necessary.
from apps.
Related Issues (16)
- MalformedURLException when installing scala-cli HOT 1
- Use latest.stable for scala3 instead of latest.release HOT 1
- How to run Scala 3 version of Ammonite? HOT 5
- cs install bloop fails HOT 3
- scala:[3.0.0-3.1.0) can not launch due to missing class
- scalac:3.x does not support -print-tasty flag HOT 3
- Error installing scala-cli HOT 1
- Unable to cs install mill HOT 2
- Fails to install `scala-update`. HOT 1
- Is there a way to "install" a snapshot? HOT 2
- converge `scala` and `scala-experimental`
- cannot install spark-repl HOT 1
- Add kotlin compiler (Kotlinc) app HOT 2
- Consider using latest.stable version of ammonite instead of latest.release
- `cs install seed` fails on macOS
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apps.