-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Describe the bug
The order of -Wconf options is important in evaluating which warning configuration rules apply. In Scala 2.13.15 the last matching rule will apply. In Gradle everything works and the order we specify the -Wconf is respected, however when we export the Bloop build, the order is completely changed.
That's because this plugin converts the list of options into a set and then sorts the set.
gradle-bloop/src/main/scala/bloop/integrations/gradle/model/BloopConverter.scala
Lines 1237 to 1254 in be6e34b
| val additionalOptions: Set[String] = { | |
| val opts = options.getAdditionalParameters | |
| if (opts == null) Set.empty | |
| else { | |
| // scalac options are passed back as Strings but under the hood can be GStringImpls which aren't Strings - so cope with that | |
| val optionList = | |
| opts.asScala.toList | |
| .asInstanceOf[List[Object]] | |
| .filter(_ != null) | |
| .map(_.toString) | |
| fuseOptionsWithArguments(optionList).toSet | |
| } | |
| } | |
| // Sort compiler flags to get a deterministic order when extracting the project | |
| splitFlags( | |
| baseOptions.union(loggingPhases).union(additionalOptions).toList.sorted | |
| ) |
Expected behavior
The order of Scala compiler options should match exactly what Gradle uses to compile Scala.
Operating system
macOS
Version of Gradle
7.6.4
Version of gradle-bloop
1.6.2
Version of Bloop
1.5.15
Metadata
Metadata
Assignees
Labels
No labels