Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Commit

Permalink
Workaround for wrong compiler version check in KLIBs
Browse files Browse the repository at this point in the history
  • Loading branch information
ddolovov committed Sep 14, 2018
1 parent 2cb6e8e commit a14476f
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ internal fun SearchPathResolverWithTarget.libraryMatch(candidate: KonanLibraryIm

if (candidateCompilerVersion == null ||
knownCompilerVersions != null &&
!knownCompilerVersions!!.contains(candidateCompilerVersion)) {
!knownCompilerVersions!!.containsFIXME(candidateCompilerVersion)) {
logger("skipping $candidatePath. The compiler versions don't match. Expected '${knownCompilerVersions?.map { it.toString(true, true) }}', found '${candidateCompilerVersion?.toString(true, true)}'")
return false
}
Expand All @@ -204,3 +204,13 @@ internal fun SearchPathResolverWithTarget.libraryMatch(candidate: KonanLibraryIm

return true
}

private fun Collection<KonanVersion>.containsFIXME(candidate: KonanVersion) =
this.any { it.isEqualToFIXME(candidate) }

// FIXME: Decide: Either need to store build number in KLIBs, or should ignore build number during version match check.
private fun KonanVersion.isEqualToFIXME(other: KonanVersion) =
this.major == other.major
&& this.minor == other.minor
&& this.maintenance == other.maintenance
&& this.meta == other.meta

0 comments on commit a14476f

Please sign in to comment.