Skip to content

Commit

Permalink
Use a dummy output to block concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
staktrace committed Nov 5, 2024
1 parent 38f95b2 commit fbd1517
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 6 additions & 4 deletions misk-admin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@ val buildMiskWeb = tasks.register("buildMiskWeb", MiskWebBuildTask::class.java)
rootDir.set(project.rootDir)
inputFiles.setFrom(inputs)
outputFiles.setFrom(outputs)

// misk-admin:web-actions:build uses a different version of node compared to
// misk-admin:buildMiskWeb, and running them concurrently may result in weird
// errors. Adding this dummy output ensures tasks that share this output do
// not run concurrently.
this.outputs.dir(rootProject.layout.buildDirectory.dir("node.concurrency-blocker.dummy"))
}

// buildMiskWeb is expensive and generally not needed locally. Only build it on CI, or if
Expand All @@ -183,10 +189,6 @@ tasks.register<Copy>("buildAndCopyWebActions") {
})
into(project.layout.buildDirectory.dir("resources/main/web/_tab/web-actions-v4"))
dependsOn(":misk-admin:web-actions:build")
// misk-admin:web-actions:build uses a different version of node compared to
// misk-admin:buildMiskWeb, and running them concurrently may result in weird
// errors.
mustRunAfter("buildMiskWeb")
}

sourceSets {
Expand Down
6 changes: 6 additions & 0 deletions misk-admin/web-actions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ tasks.register<MiskConsoleBuildTask>("build") {
)

outputFiles.setFrom(projectDir.resolve("lib"))

// misk-admin:web-actions:build uses a different version of node compared to
// misk-admin:buildMiskWeb, and running them concurrently may result in weird
// errors. Adding this dummy output ensures tasks that share this output do
// not run concurrently.
this.outputs.dir(rootProject.layout.buildDirectory.dir("node.concurrency-blocker.dummy"))
}

@CacheableTask
Expand Down

0 comments on commit fbd1517

Please sign in to comment.