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

--meta-level 1 show sources triggers compilation #3834

Open
lefou opened this issue Oct 24, 2024 · 1 comment
Open

--meta-level 1 show sources triggers compilation #3834

lefou opened this issue Oct 24, 2024 · 1 comment
Labels
bug The issue represents an bug

Comments

@lefou
Copy link
Member

lefou commented Oct 24, 2024

In an existing project with a meta-build, running mill --meta-level 1 show sources triggers compilation in the same meta-level. This comes to a surprise, as compilation depends on the sources and I was in the process to analyze a compile error, for which I wanted to inspect the sources.

Reproducer:

// build.sc
import $meta._

this is a build error
// mill-build/build.sc
object `package` extends MillBuildRootModule
> mill --meta-level 1 show "{sources,allSourceFiles}"
No mill version specified.
You should provide a version via '.mill-version' file or --mill-version option.
Using mill version 0.12.0
[mill-build/build.mill-57/61] compile
[mill-build/build.mill-57] [info] compiling 1 Scala source to /tmp/mill2/out/mill-build/mill-build/compile.dest/classes ...
[mill-build/build.mill-57] [info] done compiling
[build.mill-57/61] compile
[build.mill-57] [info] compiling 1 Scala source to /tmp/mill2/out/mill-build/compile.dest/classes ...
[build.mill-57] [error] /tmp/mill2/build.mill:6:6: value is is not a member of build_.package_
[build.mill-57] [error] this is a build error
[build.mill-57] [error]      ^
[build.mill-57] [error] /tmp/mill2/build.mill:6:9: not found: value a
[build.mill-57] [error] this is a build error
[build.mill-57] [error]         ^
[build.mill-57] [error] /tmp/mill2/build.mill:6:17: not found: value error
[build.mill-57] [error] this is a build error
[build.mill-57] [error]                 ^
[build.mill-57] [error] three errors found
[61/61] ====================================================================================================== show {sources,allSourceFiles} ==========================================================================================================
1 tasks failed
compile Compilation failed

I would expect to see just the sources files, so I can examine them to probably spot any issues resulting in the compile error.

@lefou
Copy link
Member Author

lefou commented Oct 24, 2024

Seem this isn't a newly introduced issue. I can reproduce this with Mill 0.11.0 too.

> MILL_VERSION="0.11.0" mill --meta-level 1 show sources
[mill-build/build.sc] [41/49] compile 
[info] compiling 1 Scala source to /tmp/mill2/out/mill-build/mill-build/compile.dest/classes ...
[info] done compiling
[build.sc] [41/49] compile 
[info] compiling 1 Scala source to /tmp/mill2/out/mill-build/compile.dest/classes ...
[error] /tmp/mill2/build.sc:3:6: value is is not a member of millbuild.build
[error] this is a build error
[error]      ^
[error] /tmp/mill2/build.sc:3:9: not found: value a
[error] this is a build error
[error]         ^
[error] /tmp/mill2/build.sc:3:17: not found: value error
[error] this is a build error
[error]                 ^
[error] three errors found
1 targets failed
compile Compilation failed

@lefou lefou added the bug The issue represents an bug label Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue represents an bug
Projects
None yet
Development

No branches or pull requests

1 participant