From d4ae2988afd8c0a29a9acf462f668fafe3a44b86 Mon Sep 17 00:00:00 2001 From: pragatisukhija Date: Fri, 11 Oct 2024 21:18:58 -0700 Subject: [PATCH] Added necessary plugins and updated build command --- compiler/base/Dockerfile | 2 ++ compiler/base/pom.xml | 54 ++++++++++++++++++++++++++++++++++++++++ ui/frontend/yarn.lock | 8 +++--- ui/src/sandbox.rs | 18 ++++++++++++++ 4 files changed, 78 insertions(+), 4 deletions(-) diff --git a/compiler/base/Dockerfile b/compiler/base/Dockerfile index 9f6da01..829af89 100644 --- a/compiler/base/Dockerfile +++ b/compiler/base/Dockerfile @@ -5,6 +5,7 @@ FROM maven:3.9.4-amazoncorretto-21-al2023 AS dependencies COPY pom.xml pom.xml RUN mvn dependency:copy-dependencies +RUN mvn org.apache.maven.plugins:maven-dependency-plugin:3.2.0:copy@copy-plugin-dependencies FROM ubuntu:20.04 as jre @@ -39,6 +40,7 @@ RUN /playground/attach_notice.sh /playground/security_notice.txt /etc/passwd && rm -f /playground/attach_notice.sh COPY --chown=playground --from=dependencies target/dependency /playground/dependencies +COPY --chown=playground --from=dependencies target/plugins /playground/plugins COPY --chown=playground --from=jre jre /playground/jre USER playground diff --git a/compiler/base/pom.xml b/compiler/base/pom.xml index d86817a..ab4314d 100644 --- a/compiler/base/pom.xml +++ b/compiler/base/pom.xml @@ -240,4 +240,58 @@ + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.2.0 + + + copy-plugin-dependencies + prepare-package + + copy + + + ${project.build.directory}/plugins + + + com.google.errorprone + error_prone_core + 2.32.0 + with-dependencies + + + io.github.eisop + dataflow-errorprone + 3.42.0-eisop4 + + + com.uber.nullaway + nullaway + 0.10.25 + + + org.checkerframework + checker-qual + 3.9.1 + + + org.checkerframework + dataflow-nullaway + 3.47.0 + + + + + + + + + + diff --git a/ui/frontend/yarn.lock b/ui/frontend/yarn.lock index 698846a..b59134a 100644 --- a/ui/frontend/yarn.lock +++ b/ui/frontend/yarn.lock @@ -1978,10 +1978,10 @@ resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== -ace-builds@^1.23.0: - version "1.23.1" - resolved "https://registry.yarnpkg.com/ace-builds/-/ace-builds-1.23.1.tgz#2a1a2c2717c21cfd102f641552cf371ab6bce6e4" - integrity sha512-vmLfsfOOvEiQPri2Vz+76FvUalz/nHB7+X2GqonG7rc2V+WrHvqc4xYowt1+fxHH3aWw/pDF2jqKQrd8JNMmiQ== +ace-builds@^1.32.7: + version "1.36.2" + resolved "https://registry.yarnpkg.com/ace-builds/-/ace-builds-1.36.2.tgz#9499bd59e839a335ac4850e74549ca8d849dc554" + integrity sha512-eqqfbGwx/GKjM/EnFu4QtQ+d2NNBu84MGgxoG8R5iyFpcVeQ4p9YlTL+ZzdEJqhdkASqoqOxCSNNGyB6lvMm+A== acorn-import-assertions@^1.9.0: version "1.9.0" diff --git a/ui/src/sandbox.rs b/ui/src/sandbox.rs index 9b2e4cd..f09da88 100644 --- a/ui/src/sandbox.rs +++ b/ui/src/sandbox.rs @@ -177,6 +177,24 @@ fn build_execution_command( cmd.push("--enable-preview".to_string()); } + //Added for Error-prone integration + cmd.extend([ + "-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED".to_string(), + "-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED".to_string(), + "-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED".to_string(), + "-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED".to_string(), + "-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED".to_string(), + "-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED".to_string(), + "-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED".to_string(), + "-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED".to_string(), + "-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED".to_string(), + "-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED".to_string(), + "-XDcompilePolicy=simple".to_string(), + "-processorpath".to_string(), + "plugins/error_prone_core-2.32.0-with-dependencies.jar:plugins/dataflow-errorprone-3.42.0-eisop4.jar:plugins/nullaway-0.10.25.jar:plugins/jspecify-1.0.0.jar:plugins/dataflow-nullaway-3.47.0.jar:plugins/checker-qual-3.9.1.jar:plugins/jsr305-3.0.2.jar".to_string(), + "-Xplugin:ErrorProne -Xep:NullAway:ERROR -XepOpt:NullAway:AnnotatedPackages=com.example".to_string() + ]); + cmd.push("Main.java".to_string()); }