GoogleContainerTools / jib

🏗 Build container images for your Java applications.
Apache License 2.0
13.64k stars 1.44k forks source link

Convert Gradle config parameters `jib.container.environment` to use lazy evaluation #4067

Open FrogDevelopper opened 1 year ago

FrogDevelopper commented 1 year ago

Just like the like the jib.container.labels , the jib.container.environment property should use lazy evaluation. This will avoid having a mix of lazy/direct parameters set in the configuration

diegomarquezp commented 1 year ago

Hi @FrogDevelopper, thanks for bringing this up. We are welcoming contributions to jib and we will gladly review any incoming PRs.

We have had similar situations with other fields (e.g. #3094 and #3709) - they may be a good start point.

Thanks!

FrogDevelopper commented 1 year ago

@diegomarquezp I'm trying to compile locally the project (from last tag 3.3.2) but got this error

/Users/XXXXXX/jib/jib-core/src/main/java/com/google/cloud/tools/jib/configuration/ContainerConfiguration.java:41: error: An unhandled exception was thrown by the Error Prone static analysis plugin. public class ContainerConfiguration { ^ Please report this at https://github.com/google/error-prone/issues/new and include the following: error-prone version: 2.10.0 BugPattern: NullAway Stack Trace: java.lang.ExceptionInInitializerError at com.uber.nullaway.NullAway.collectEntities(NullAway.java:2054) at com.uber.nullaway.NullAway.checkFieldInitialization(NullAway.java:1717) at com.uber.nullaway.NullAway.matchClass(NullAway.java:1424) at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:449) at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:547) at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:150) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:818) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82) at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74) at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48) at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:106) at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:114) at jdk.compiler/com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:145) at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:560) at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:150) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:601) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:56) at com.google.errorprone.scanner.Scanner.scan(Scanner.java:58) at com.google.errorprone.scanner.ErrorProneScannerTransformer.apply(ErrorProneScannerTransformer.java:43) at com.google.errorprone.ErrorProneAnalyzer.finished(ErrorProneAnalyzer.java:152) at jdk.compiler/com.sun.tools.javac.api.MultiTaskListener.finished(MultiTaskListener.java:132) at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1423) at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1370) at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:959) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:147) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94) .... (a lot more follows)

Any idea why I got this and how to fix it ?

paulvdbles commented 2 days ago

hello there, I'd love to tackle this issue!