mirror of
https://github.com/enso-org/enso.git
synced 2024-12-22 22:51:38 +03:00
Only single native image is built at a time (#11497)
#10783 introduced another definition of a buildnativeimage task. Since that time, our CI is transiently failing on out of memory error. This PR ensures that there can be just a single `buildNativeImage` task running at a time. # Important Notes Manually tested by running ``` sbt:enso> all engine-runner/buildNativeImage project-manager/buildNativeImage ``` And looking at spawn subprocesses. On develop, I have two `native-image` processes, on this PR, there is just a single one.
This commit is contained in:
parent
73abe909ef
commit
3df57557ca
@ -106,6 +106,11 @@ ThisBuild / publish / skip := true
|
||||
val simpleLibraryServerTag = Tags.Tag("simple-library-server")
|
||||
Global / concurrentRestrictions += Tags.limit(simpleLibraryServerTag, 1)
|
||||
|
||||
/** Tag limiting the concurrent spawning of `native-image` subprocess.
|
||||
*/
|
||||
val nativeImageBuildTag = NativeImage.nativeImageBuildTag
|
||||
Global / concurrentRestrictions += Tags.limit(nativeImageBuildTag, 1)
|
||||
|
||||
lazy val gatherLicenses =
|
||||
taskKey[Unit](
|
||||
"Gathers licensing information for relevant dependencies of all distributions"
|
||||
|
@ -49,6 +49,12 @@ object NativeImage {
|
||||
|
||||
val NATIVE_IMAGE_ARG_FILE = "native-image-args.txt"
|
||||
|
||||
/** Tag limiting the concurrent access to `native-image` subprocess spawning, i.e.,
|
||||
* there should be just a single such subprocess. This should ensure that we do
|
||||
* not run out of memory.
|
||||
*/
|
||||
val nativeImageBuildTag = Tags.Tag("native-image-build")
|
||||
|
||||
/** Creates a task that builds a native image for the current project.
|
||||
*
|
||||
* This task must be setup in such a way that the assembly JAR is built
|
||||
@ -262,6 +268,7 @@ object NativeImage {
|
||||
}
|
||||
log.info(s"$targetLoc native image build successful.")
|
||||
}
|
||||
.tag(nativeImageBuildTag)
|
||||
.dependsOn(Compile / compile)
|
||||
|
||||
/** Creates a task which watches for changes of any compiled files or
|
||||
|
Loading…
Reference in New Issue
Block a user