Closed vobruba-martin closed 5 months ago
Hi, sorry for the breakage - I'm looking into this & should be able to fix it today. We will probably stop open-sourcing src/com/google/javascript/jscomp/js/es6/asynccontext
as it's not ready for general usage yet.
Oops, https://github.com/google/closure-compiler/commit/827e3b208b085ff3d790a7521889ae354cf3c863 fixed the build but now actually running the compiler fails to load the polyfills.txt
resource. I have a followup change to fix it - just modifying https://github.com/google/closure-compiler/commit/827e3b208b085ff3d790a7521889ae354cf3c863#diff-7fc57714ef13c3325ce2a1130202edced92fcccc0c6db34a72f7b57f60d552a3 to generate it at src/java/com/google/javascript/jscomp/js/polyfills.txt.
On top of that I had to install nodejs to make the build process working again. Thank you!
It seems that the content related to polyfills.txt has not been fixed. I use
bazel run //:compiler_unshaded_no_runtime_libs -- --js="/data/workspace/closure-compiler/tmp/nmsl.js" --js_output_file=output.min.js
Loading:
Loading: 0 packages loaded
Analyzing: target //:compiler_unshaded_no_runtime_libs (1 packages loaded, 0 targets configured)
INFO: Analyzed target //:compiler_unshaded_no_runtime_libs (84 packages loaded, 2058 targets configured).
INFO: Found 1 target...
[0 / 1] [Prepa] BazelWorkspaceStatusAction stable-status.txt
[20 / 67] JavaToolchainCompileBootClasspath external/rules_java/toolchains/platformclasspath.jar; 0s local ... (2 actions running)
[21 / 67] JavaToolchainCompileBootClasspath external/rules_java/toolchains/platformclasspath.jar; 1s local ... (2 actions, 1 running)
[23 / 67] Building src/com/google/javascript/rhino/typed_ast/libtyped_ast_proto-speed.jar (1 source jar); 1s local ... (13 actions, 12 running)
[30 / 67] Building src/com/google/javascript/rhino/typed_ast/libtyped_ast_proto-speed.jar (1 source jar); 2s local ... (7 actions running)
[33 / 67] Building src/com/google/javascript/rhino/typed_ast/libtyped_ast_proto-speed.jar (1 source jar); 6s local ... (4 actions running)
[46 / 67] Building src/com/google/javascript/rhino/typed_ast/libtyped_ast_proto-speed.jar (1 source jar); 8s local ... (16 actions running)
[64 / 67] Building src/com/google/javascript/rhino/typed_ast/libtyped_ast_proto-speed.jar (1 source jar); 9s local ... (2 actions running)
[65 / 67] Building libcompiler_lib_no_runtime_libs-class.jar (784 source files) and running annotation processors (AutoAnnotationProcessor, AutoOneOfProcessor, AutoValueProcessor); 4s local
[65 / 67] Building libcompiler_lib_no_runtime_libs-class.jar (784 source files) and running annotation processors (AutoAnnotationProcessor, AutoOneOfProcessor, AutoValueProcessor); 12s local
INFO: From Building libcompiler_lib_no_runtime_libs-class.jar (784 source files) and running annotation processors (AutoAnnotationProcessor, AutoOneOfProcessor, AutoValueProcessor):
warning: [options] system modules path not set in conjunction with -source 11
[66 / 67] [Prepa] Building Java resource jar
Target //:compiler_unshaded_no_runtime_libs up-to-date:
bazel-bin/compiler_unshaded_no_runtime_libs.jar
bazel-bin/compiler_unshaded_no_runtime_libs
INFO: Elapsed time: 40.869s, Critical Path: 39.96s
INFO: 67 processes: 8 internal, 59 local.
INFO: Build completed successfully, 67 total actions
INFO: Running command line: bazel-bin/compiler_unshaded_no_runtime_libs '--js=/data/workspace/closure-compiler/tmp/nmsl.js' '--js_output_file=output.min.js'
INFO: Build Event Protocol files produced successfully.
INFO: Build completed successfully, 67 total actions
INFO: Build completed successfully, 67 total actions
java.lang.RuntimeException: No such resource: js/polyfills.txt
at com.google.javascript.jscomp.resources.ResourceLoader.loadTextResource(ResourceLoader.java:38)
at com.google.javascript.jscomp.RewritePolyfills.<init>(RewritePolyfills.java:68)
at com.google.javascript.jscomp.TranspilationPasses.lambda$static$2(TranspilationPasses.java:374)
at com.google.javascript.jscomp.PassFactory.create(PassFactory.java:90)
at com.google.javascript.jscomp.PhaseOptimizer$NamedPass.process(PhaseOptimizer.java:240)
at com.google.javascript.jscomp.PhaseOptimizer.process(PhaseOptimizer.java:179)
at com.google.javascript.jscomp.Compiler.performTranspilationAndOptimizations(Compiler.java:2968)
at com.google.javascript.jscomp.Compiler.lambda$stage2Passes$7(Compiler.java:1025)
at com.google.javascript.jscomp.CompilerExecutor.lambda$runInCompilerThread$0(CompilerExecutor.java:100)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
@vobruba-martin I'll note in the README that Node is now required to build from source, thanks for pointing that out.
@ltlly why are you using //:compiler_unshaded_no_runtime_libs
? It's intended for a specific step in our build process that builds the runtime library, but not for general use.
I see the same crash synced to a commit from a month ago https://github.com/google/closure-compiler/commit/5af748442b266a8e4331cfd4213cda39596e1b79. I believe this is WAI.
@vobruba-martin I'll note in the README that Node is now required to build from source, thanks for pointing that out.
@ltlly why are you using
//:compiler_unshaded_no_runtime_libs
? It's intended for a specific step in our build process that builds the runtime library, but not for general use.I see the same crash synced to a commit from a month ago 5af7484. I believe this is WAI.
In the README, I saw this.
So I used IDEA and the Bazel plugin. When I clicked run, it automatically executed the following command for me. What is the correct way to build CommandLineRunner from IDEA? Do Eclipse and IDEA behave differently when running a class?
/usr/bin/setsid --wait bazel run --tool_tag=ijwb:IDEA:ultimate --override_repository=intellij_aspect=/root/.local/share/JetBrains/IntelliJIdea2024.1/ijwb/aspect --curses=no --color=yes --progress_in_terminal_title=no --build_event_binary_file=/tmp/intellij-bep-87d9de58-39e7-4b81-8542-2b3d5f319240 --nobuild_event_binary_file_path_conversion -- //:compiler_unshaded_no_runtime_libs --js=/data/workspace/closure-compiler/tmp/nmsl.js --js_output_file=output.min.js
Loading:
Loading: 0 packages loaded
Analyzing: target //:compiler_unshaded_no_runtime_libs (0 packages loaded, 0 targets configured)
INFO: Analyzed target //:compiler_unshaded_no_runtime_libs (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
[1 / 4] [Prepa] BazelWorkspaceStatusAction stable-status.txt
[9 / 12] Building libcompiler_lib_no_runtime_libs-class.jar (785 source files) and running annotation processors (AutoAnnotationProcessor, AutoOneOfProcessor, AutoValueProcessor); 1s local
[9 / 12] Building libcompiler_lib_no_runtime_libs-class.jar (785 source files) and running annotation processors (AutoAnnotationProcessor, AutoOneOfProcessor, AutoValueProcessor); 11s local
INFO: From Building libcompiler_lib_no_runtime_libs-class.jar (785 source files) and running annotation processors (AutoAnnotationProcessor, AutoOneOfProcessor, AutoValueProcessor):
warning: [options] system modules path not set in conjunction with -source 11
[10 / 12] [Prepa] Building Java resource jar
Target //:compiler_unshaded_no_runtime_libs up-to-date:
bazel-bin/compiler_unshaded_no_runtime_libs.jar
bazel-bin/compiler_unshaded_no_runtime_libs
INFO: Elapsed time: 27.219s, Critical Path: 26.99s
INFO: 3 processes: 1 internal, 2 local.
INFO: Build completed successfully, 3 total actions
INFO: Running command line: bazel-bin/compiler_unshaded_no_runtime_libs '--js=/data/workspace/closure-compiler/tmp/nmsl.js' '--js_output_file=output.min.js'
INFO: Build Event Protocol files produced successfully.
INFO: Build completed successfully, 3 total actions
INFO: Build completed successfully, 3 total actions
java.lang.RuntimeException: No such resource: js/polyfills.txt
at com.google.javascript.jscomp.resources.ResourceLoader.loadTextResource(ResourceLoader.java:37)
at com.google.javascript.jscomp.RewritePolyfills.<init>(RewritePolyfills.java:68)
at com.google.javascript.jscomp.TranspilationPasses.lambda$static$2(TranspilationPasses.java:387)
at com.google.javascript.jscomp.PassFactory.create(PassFactory.java:90)
at com.google.javascript.jscomp.PhaseOptimizer$NamedPass.process(PhaseOptimizer.java:240)
at com.google.javascript.jscomp.PhaseOptimizer.process(PhaseOptimizer.java:179)
at com.google.javascript.jscomp.Compiler.performTranspilationAndOptimizations(Compiler.java:3017)
at com.google.javascript.jscomp.Compiler.lambda$stage2Passes$7(Compiler.java:1059)
at com.google.javascript.jscomp.CompilerExecutor.lambda$runInCompilerThread$0(CompilerExecutor.java:100)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
@vobruba-martin I'll note in the README that Node is now required to build from source, thanks for pointing that out. @ltlly why are you using
//:compiler_unshaded_no_runtime_libs
? It's intended for a specific step in our build process that builds the runtime library, but not for general use. I see the same crash synced to a commit from a month ago 5af7484. I believe this is WAI.In the README, I saw this.
So I used IDEA and the Bazel plugin. When I clicked run, it automatically executed the following command for me. What is the correct way to build CommandLineRunner from IDEA? Do Eclipse and IDEA behave differently when running a class?
/usr/bin/setsid --wait bazel run --tool_tag=ijwb:IDEA:ultimate --override_repository=intellij_aspect=/root/.local/share/JetBrains/IntelliJIdea2024.1/ijwb/aspect --curses=no --color=yes --progress_in_terminal_title=no --build_event_binary_file=/tmp/intellij-bep-87d9de58-39e7-4b81-8542-2b3d5f319240 --nobuild_event_binary_file_path_conversion -- //:compiler_unshaded_no_runtime_libs --js=/data/workspace/closure-compiler/tmp/nmsl.js --js_output_file=output.min.js Loading: Loading: 0 packages loaded Analyzing: target //:compiler_unshaded_no_runtime_libs (0 packages loaded, 0 targets configured) INFO: Analyzed target //:compiler_unshaded_no_runtime_libs (0 packages loaded, 0 targets configured). INFO: Found 1 target... [1 / 4] [Prepa] BazelWorkspaceStatusAction stable-status.txt [9 / 12] Building libcompiler_lib_no_runtime_libs-class.jar (785 source files) and running annotation processors (AutoAnnotationProcessor, AutoOneOfProcessor, AutoValueProcessor); 1s local [9 / 12] Building libcompiler_lib_no_runtime_libs-class.jar (785 source files) and running annotation processors (AutoAnnotationProcessor, AutoOneOfProcessor, AutoValueProcessor); 11s local INFO: From Building libcompiler_lib_no_runtime_libs-class.jar (785 source files) and running annotation processors (AutoAnnotationProcessor, AutoOneOfProcessor, AutoValueProcessor): warning: [options] system modules path not set in conjunction with -source 11 [10 / 12] [Prepa] Building Java resource jar Target //:compiler_unshaded_no_runtime_libs up-to-date: bazel-bin/compiler_unshaded_no_runtime_libs.jar bazel-bin/compiler_unshaded_no_runtime_libs INFO: Elapsed time: 27.219s, Critical Path: 26.99s INFO: 3 processes: 1 internal, 2 local. INFO: Build completed successfully, 3 total actions INFO: Running command line: bazel-bin/compiler_unshaded_no_runtime_libs '--js=/data/workspace/closure-compiler/tmp/nmsl.js' '--js_output_file=output.min.js' INFO: Build Event Protocol files produced successfully. INFO: Build completed successfully, 3 total actions INFO: Build completed successfully, 3 total actions java.lang.RuntimeException: No such resource: js/polyfills.txt at com.google.javascript.jscomp.resources.ResourceLoader.loadTextResource(ResourceLoader.java:37) at com.google.javascript.jscomp.RewritePolyfills.<init>(RewritePolyfills.java:68) at com.google.javascript.jscomp.TranspilationPasses.lambda$static$2(TranspilationPasses.java:387) at com.google.javascript.jscomp.PassFactory.create(PassFactory.java:90) at com.google.javascript.jscomp.PhaseOptimizer$NamedPass.process(PhaseOptimizer.java:240) at com.google.javascript.jscomp.PhaseOptimizer.process(PhaseOptimizer.java:179) at com.google.javascript.jscomp.Compiler.performTranspilationAndOptimizations(Compiler.java:3017) at com.google.javascript.jscomp.Compiler.lambda$stage2Passes$7(Compiler.java:1059) at com.google.javascript.jscomp.CompilerExecutor.lambda$runInCompilerThread$0(CompilerExecutor.java:100) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:840)
Apologies for the confusion. I realized the issue was due to clicking "run" in front of the class, which detected an incorrect target. The correct approach is to click "run" in front of compiler_uberjar in the BUILD.bazel file. This resolves the issue and ensures that the debug functionality in IntelliJ IDEA works as expected. Sorry for any inconvenience caused and thank you for your understanding.I am a beginner with Bazel
This is true
Since yesterday I'm not able to build Closure compiler from source. Am I doing something wrong?