You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been trying to factor out some common code to define cross-platform builds in a maximally concise way. In at least one configuration involving rather involved trait inheritance to define Mill modules, I get the following exception:
There is a small-ish repo with code that reproduces the problem here: https://github.com/braunse/mill-timsort-repro
The error occurs on current versions of Eclipse Temurin 17, 21, 22 and 23, but not on Temurin 8 or 11.
The error occurs with Mill 0.12.5 and a recent checkout of the Mill git repository.
as the given comparison function does not correctly define a total order (compare java.util.Comparator Javadoc, specifying that a total ordering is required). Specifically, referring to the definition on Wikipedia, at least the following properties are violated:
Irreflexivity: the given comparison will return true if called with identical arguments, implying m1 < m2
Asymmetry: the given comparison will return m1 < m2 and m2 < m1 if m1 and m2 are declared in the same class and have identical return types
It seems that many real-world projects do not trigger the conditions leading to the exception in this case. I do not know what exactly happens in my code that causes TimSort to throw while Mill handles much more complex builds without triggering this problem.
I have experimented with a cluelessly-patched mill build that contains an extended comparison function, and while I have zero familiarity with the mill code base, it seemed to fix this problem:
$ ./mill dist.run ../repro -i resolve __
[3025/3025] dist.run
Mill version SNAPSHOT is different than configured for this directory!
Configured version is 0.12.5 (.../repro/.mill-version)
============================== resolve __ ==============================
[mill-build/build.mill-64/68] compile
[mill-build/build.mill-64] [info] compiling 1 Scala source to /.../repro/out/mill-build/mill-build/compile.dest/classes ...
[mill-build/build.mill-64] [info] done compiling
[build.mill-64/68] compile
[build.mill-64] [info] compiling 4 Scala sources to /.../repro/out/mill-build/compile.dest/classes ...
[build.mill-64] [info] done compiling
[1/1] resolve
clean
init
inspect
mod1
[...many lines...]
mod1.tests.testFramework
path
plan
resolve
selective
selective.prepare
selective.resolve
selective.run
show
showNamed
shutdown
version
visualize
visualizePlan
The text was updated successfully, but these errors were encountered:
Can confirm it now builds both the repro I shared and the unpublished original repo which surfaced the bug for me. Thank you for the super-quick fix @lihaoyi!
I have been trying to factor out some common code to define cross-platform builds in a maximally concise way. In at least one configuration involving rather involved trait inheritance to define Mill modules, I get the following exception:
Full Stack Trace
There is a small-ish repo with code that reproduces the problem here: https://github.com/braunse/mill-timsort-repro
The error occurs on current versions of Eclipse Temurin 17, 21, 22 and 23, but not on Temurin 8 or 11.
The error occurs with Mill 0.12.5 and a recent checkout of the Mill git repository.
I believe that the error is caused by this code snippet: Reflect.scala, lines 60-66
as the given comparison function does not correctly define a total order (compare java.util.Comparator Javadoc, specifying that a total ordering is required). Specifically, referring to the definition on Wikipedia, at least the following properties are violated:
true
if called with identical arguments, implying m1 < m2It seems that many real-world projects do not trigger the conditions leading to the exception in this case. I do not know what exactly happens in my code that causes TimSort to throw while Mill handles much more complex builds without triggering this problem.
I have experimented with a cluelessly-patched mill build that contains an extended comparison function, and while I have zero familiarity with the mill code base, it seemed to fix this problem:
The text was updated successfully, but these errors were encountered: