-
-
Notifications
You must be signed in to change notification settings - Fork 363
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
[WIP]Implement reproducible out/ folder contents across different filesystem layouts #3765
base: main
Are you sure you want to change the base?
[WIP]Implement reproducible out/ folder contents across different filesystem layouts #3765
Conversation
@lihaoyi, Can you take a top-level look at the changes and whether they are aligned with the solution or not in any way? (Also, If somehow you can tell why the tests are failing, it will be a great help!) |
@rahat2134 the top level changes look reasonable. The CI logs seem to be overloaded with all the printlns you added and won't load for me, you should try removing them and try to run the failing tests locally to debug further |
…older-content-reproducible
…rahat2134/mill into out-folder-content-reproducible
@rahat2134 FYI the test jobs are arranged roughly in dependency order, so the first failing job |
…older-content-reproducible
…al.test "mill.eval.JavaCompileJarTests.javac" are passing now
…us tests are passing
…older-content-reproducible
…rahat2134/mill into out-folder-content-reproducible
@rahat2134 BTW feel free to ask if you have any questions or get stuck |
Ya, Sure. Thanks :) |
Hi @lihaoyi I've made progress with two tests passing:
However, we're struggling with HelloWorldTests. When running scala.MatchError: Left(scala.reflect.internal.FatalError:
bad constant pool index: 0 at pos: 49842
while compiling: <no file>
during phase: globalPhase=<no phase>, enteringPhase=<some phase>
library version: version 2.12.6
compiler version: version 2.12.6
) We've tried:
The core issue seems to be that despite our path fixes, the Scala compiler is still getting paths with "compile.super" in the classpath:
We think the problem might be deeper than just path normalization, possibly related to how Mill handles compilation paths in test environments. Would appreciate any guidance on:
Thanks for your help! Any other thing if you want to say! p.s - Just saw right now that this test is passing on github actions - [09925-10] + mill.scalalib.HelloJavaTests.failures 3460ms I don't know why they are failing on local.... |
…older-content-reproducible
Could it be a java version thing? CI runs Java 17 and 11, if you are on 8 or 24 you might get different behaviors Your reported failure of
You didn't mention which Java version you are using, but try using either 11 or 17 to reproduce the issues locally, and hopefully it will be more consistent with what you are seeing in CI and better able to reproduce the failures |
Ya, I saw that the test is passing in github, May be it is due to java version... |
…rahat2134/mill into out-folder-content-reproducible
… pathRef for github action was not properly working
Hi, @lihaoyi I was working on fixing the failing tests in the reproducible out/ folder implementation. We've noticed an interesting issue with
Debug logs from GitHub Actions show: Could this be related to how test failures are captured/reported differently in the CI environment? Would appreciate any insights on why the test behavior differs between local and CI environments. p.s - All the other failures are similar in local and GitHub actions. |
… These changes are mostly debugging based
…rahat2134/mill into out-folder-content-reproducible
@rahat2134 so it seems like the test is trying to evaluate the task The tests in question are at I'm guessing there is something wrong with the configuration of the source paths, causing the test sources to not be picked up. To debug this, could you try applying the following patch lihaoyi mill$ git diff
diff --git a/scalalib/test/src/mill/scalalib/HelloJavaTests.scala b/scalalib/test/src/mill/scalalib/HelloJavaTests.scala
index 7c8a046108..c6effa9679 100644
--- a/scalalib/test/src/mill/scalalib/HelloJavaTests.scala
+++ b/scalalib/test/src/mill/scalalib/HelloJavaTests.scala
@@ -150,6 +150,8 @@ object HelloJavaTests extends TestSuite {
val eval = testEval()
val Left(Result.Failure(ref1, Some(v1))) = eval.apply(HelloJava.core.test.test())
+ pprint.log(eval.apply(HelloJava.core.test.sources))
+ pprint.log(eval.apply(HelloJava.core.test.allSourceFiles))
assert(
v1._2(0).fullyQualifiedName == "hello.MyCoreTests.lengthTest", This will print out the folder in which If you run that locally and in CI, hopefully it will give us a hint as to what is going wrong |
This PR addresses issue #3660 by making the
out/
folder contents more reproducible and filesystem layout agnostic. These changes allow for re-using theout/
folder as a build cache between different machines, supporting both coarse-grained (e.g., zip file transfer) and fine-grained (via Bazel remote cache protocol) caching strategies.Key Changes:
PathRef
to normalize paths relative to workspace, Coursier cache, and home directoryNonDeterministicFiles
to handle non-deterministic file contentJsonFormatters
to use the new path normalization methodsReproducibleOutTest
to verify reproducibilitybuild.mill
in the integration test to define the necessary project structureReproducibility is achieved by:
Testing:
ReproducibleOutTest
Documentation:
Performance Impact: