-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
community_build_a fails intermittently with corrupt scalatest artifacts #11604
Comments
The issue appears to be caused by a race condition in the The race condition seems to have been introduced by sbt/sbt-osgi#64 in sbt-osgi 0.9.5. The scalatest build upgraded sbt-osgi from 0.9.4 to 0.9.6 for JDK 15 compatability (scalatest/scalatest#1899). The BuildThe problem arises when an sbt project has a build structure similar to: lazy val parent = project
.enablePlugins(SbtOsgi)
.settings(osgiSettings)
.dependsOn(child)
.aggregate(child)
lazy val child = project
.enablePlugins(SbtOsgi)
.settings(osgiSettings) In particular, there must be a project which both aggregates and depends on another project in a multi-project build, and both projects must enable the SbtOsgi plugin and use In the scalatest build, the role of The Trigger
The Race
def osgiSettings: Seq[Setting[_]] = Seq(
packagedArtifact in (Compile, packageBin) := Scoped.mkTuple2(
(artifact in (Compile, packageBin)).value, // the jar artifact
OsgiKeys.bundle.value // built with a custom task `osgiBundle`
)
...
)
The issue is that items 4 and 6 may happen concurrently, and the jar that is copied from the The Culpritsbt/sbt-osgi#64 included the following change: bundle := Osgi.bundleTask(
manifestHeaders.value,
additionalHeaders.value,
- (fullClasspath in Compile).value,
+ (dependencyClasspathAsJars in Compile).value.map(_.data) ++ (products in Compile).value,
(artifactPath in (Compile, packageBin)).value,
(resourceDirectories in Compile).value,
embeddedJars.value,
explodedJars.value,
failOnUndecidedPackage.value,
(sourceDirectories in Compile).value,
(packageOptions in (Compile, packageBin)).value,
streams.value) Without this change, (6) does not occur, as the |
Fix #11604: Downgrade sbt-osgi in scalatest build to work around race condition
Amazing detective work!
packagedArtifact in (Compile, packageBin) := ((artifact in (Compile, packageBin)).value -> (packageBin in Compile).value) |
Ref: scala/scala3#11604 (cherry picked from commit d3b7db9)
Ref: scala/scala3#11604 (cherry picked from commit d3b7db9) (cherry picked from commit 96650cf)
Ref: scala/scala3#11604 (cherry picked from commit d3b7db9) (cherry picked from commit 96650cf)
Ref: scala/scala3#11604 (cherry picked from commit d3b7db9) (cherry picked from commit 96650cf)
For some weeks or months now,
community_build_a
fails intermittently in CI with corrupt scalatest artifacts. The issue seems to arise more often when the CI is under heavy load.Examples of error messages observed in the CI logs:
Links to some failing CI runs:
https://github.com/lampepfl/dotty/runs/2034290606?check_suite_focus=true#step:7:3717
https://github.com/lampepfl/dotty/runs/1814806014?check_suite_focus=true#step:7:2520
https://github.com/lampepfl/dotty/runs/1806534005?check_suite_focus=true#step:7:2488
https://github.com/lampepfl/dotty/runs/1701458513?check_suite_focus=true#step:7:2530
https://github.com/lampepfl/dotty/runs/1720784830?check_suite_focus=true#step:7:2533
https://github.com/lampepfl/dotty/runs/1715832346?check_suite_focus=true#step:7:2532
https://github.com/lampepfl/dotty/runs/1588578361?check_suite_focus=true#step:7:2480
The text was updated successfully, but these errors were encountered: