From 9ea9fd56e614d8e4372981cb781ec479140545c9 Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Fri, 10 Feb 2023 23:14:43 +0100 Subject: [PATCH] Fix separate compilation for ConstantsGen (#5630) A combination of commands triggered separate compilation that only recompiled part of builtins. A mechanism that workaround annotation processor's problems with separate compilation was updated to include changes from https://github.com/enso-org/enso/pull/4111. This was pretty tough to find given the rather unusual circumstances in CI. # Important Notes This eliminates the _random_ failures in CI related to separate compilation. To reproduce a specific set of steps has to be executed: ``` sbt> all buildEngineDistribution engine-runner/assembly runtime/Benchmark/compile language-server/Benchmark/compile searcher/Benchmark/compile (exit sbt) sbt> test ``` --- .../enso/interpreter/dsl/TypeProcessor.java | 38 +++++++++---------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/lib/scala/interpreter-dsl/src/main/java/org/enso/interpreter/dsl/TypeProcessor.java b/lib/scala/interpreter-dsl/src/main/java/org/enso/interpreter/dsl/TypeProcessor.java index 206fa5fc623..9cac5c11d2d 100644 --- a/lib/scala/interpreter-dsl/src/main/java/org/enso/interpreter/dsl/TypeProcessor.java +++ b/lib/scala/interpreter-dsl/src/main/java/org/enso/interpreter/dsl/TypeProcessor.java @@ -115,19 +115,7 @@ public class TypeProcessor extends BuiltinsMetadataProcessor entry : builtinTypes.get(f).entrySet()) { BuiltinTypeConstr constr = entry.getValue(); if (!constr.getFullName().isEmpty()) { - out.println( - " public static final String " - + entry.getKey().toUpperCase() - + " = \"" - + constr.getFullName() - + "\";"); - - out.println( - " public static final String " - + entry.getKey().toUpperCase() + "_BUILTIN" - + " = " - + toBuiltinName(constr.getFullName()) - + ";"); + generateEntry(entry.getKey().toUpperCase(), constr.getFullName(), out); } } } @@ -136,14 +124,7 @@ public class TypeProcessor extends BuiltinsMetadataProcessor - entry.stdlibName().ifPresent(n -> - out.println( - " public static final String " - + entry.ensoName().toUpperCase() - + " = \"" - + n - + "\";") - ) + entry.stdlibName().ifPresent(n -> generateEntry(entry.ensoName().toUpperCase(), n, out)) ); out.println(); @@ -151,6 +132,21 @@ public class TypeProcessor extends BuiltinsMetadataProcessor