forked from higherkindness/rules_scala
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround libraryClassName non-determinism
- Loading branch information
James Judd
committed
Jul 5, 2024
1 parent
eb2991a
commit fbe7b5c
Showing
2 changed files
with
33 additions
and
5 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
src/main/scala/higherkindness/rules_scala/workers/zinc/compile/FilteredRelations.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package sbt.internal.inc | ||
|
||
/** | ||
* Zinc's libraryClassName is a map from a library jar to class names. Problem is | ||
* it's not deterministic. You only get a single class in the map and it's not always | ||
* the same class. Until that bug in Zinc is fixed, we're setting the libraryClassName | ||
* to an empty libraryClassName because empty is better than non-deterministic. | ||
* | ||
* This class is in the sbt.internal.inc package to get access to the MRelationsNameHashing | ||
* class, which is private to that package. Super duper hacky, but I wasn't able to find a | ||
* better way to change the libraryClassName for the relation. | ||
*/ | ||
object FilteredRelations { | ||
def getFilteredRelations(relations: Relations): Relations = { | ||
val emptyRelations = Relations.empty | ||
|
||
relations.asInstanceOf[MRelationsNameHashing].copy( | ||
libraryClassName = emptyRelations.libraryClassName | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters