dart-lang / native

Dart packages related to FFI and native assets bundling.
BSD 3-Clause "New" or "Revised" License
93 stars 33 forks source link

Automatically building the ApiSummarizer in tests happens concurrently #782

Open dcharkes opened 1 year ago

dcharkes commented 1 year ago

When running dart test from scratch in jni_gen/: Cannot rename file to './.dart_tool/jni_gen/ApiSummarizer.jar', path = './.dart_tool/jni_gen/target/ApiSummarizer.jar' (OS Error: No such file or directory, errno = 2).

I believe we're trying to compile the ApiSummerizer multiple times concurrently, because the tests run concurrently.

We either need some kind of locking mechanism so that only one will try to concurrently do it, or we need to only check if it is built in the tests and print an error message with how to build if it is not built or not built since files where changed.

Full log:

jni_gen$ dart test
Building package executable... (8.3s)
Built test:test.
00:01 +0: loading test/simple_package_test/generated_files_test.dart                                                                                                                                                                              [exec] javac com/github/dart_lang/jni_gen/simple_package/Example.java com/github/dart_lang/jni_gen/pkg2/C2.java
[exec] dart run jni:setup
00:01 +0: test/yaml_config_test.dart: generate and compare bindings using YAML config                                                                                                                                                             Rebuilding ApiSummarizer component since sources have changed. This might take some time.
00:01 +20: test/yaml_config_test.dart: generate and compare bindings using YAML config                                                                                                                                                            Rebuilding ApiSummarizer component since sources have changed. This might take some time.
00:02 +20: test/yaml_config_test.dart: generate and compare bindings using YAML config                                                                                                                                                            
Built jni:setup.

+ [build/jni_libs] cmake /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni/src/
-- The C compiler identification is GNU 12.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Java: /usr/local/buildtools/java/jdk/bin/java (found version "11.0.13") 
00:03 +20: test/yaml_config_test.dart: generate and compare bindings using YAML config                                                                                                                                                            -- Found JNI: /usr/lib/jvm/default-java/include  found components: AWT JVM 
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/build/jni_libs

+ [build/jni_libs] cmake --build .
[ 50%] Building C object CMakeFiles/jni.dir/dartjni.c.o
[100%] Linking C shared library libdartjni.so
[100%] Built target jni
[INFO] Scanning for projects...
[exec] dart run jni:setup -S test/simple_package_test/src
[INFO] Scanning for projects...
[INFO] 
[INFO] -------------< com.github.dart_lang.jni_gen:ApiSummarizer >-------------
[INFO] Building ApiSummarizer 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] -------------< com.github.dart_lang.jni_gen:ApiSummarizer >-------------
[INFO] Building ApiSummarizer 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] >>> maven-assembly-plugin:2.2-beta-5:assembly (default-cli) > package @ ApiSummarizer >>>
[INFO] 
[INFO] >>> maven-assembly-plugin:2.2-beta-5:assembly (default-cli) > package @ ApiSummarizer >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ ApiSummarizer ---
Building package executable... [INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ ApiSummarizer ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ ApiSummarizer ---
00:04 +20: test/yaml_config_test.dart: generate and compare bindings using YAML config                                                                                                                                                            [INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ ApiSummarizer ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 27 source files to /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/.dart_tool/jni_gen/target/classes

Built jni:setup.
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 27 source files to /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/.dart_tool/jni_gen/target/classes

+ [build/jni_libs] cmake /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/test/simple_package_test/src
-- The C compiler identification is GNU 12.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Java: /usr/local/buildtools/java/jdk/bin/java (found version "11.0.13") 
-- Found JNI: /usr/lib/jvm/default-java/include  found components: AWT JVM 
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/build/jni_libs

+ [build/jni_libs] cmake --build .
[ 50%] Building C object CMakeFiles/simple_package.dir/simple_package.c.o
[100%] Linking C shared library libsimple_package.so
[100%] Built target simple_package
[exec] dart run jni:setup -S test/jackson_core_test/third_party/src
00:05 +20: test/yaml_config_test.dart: generate and compare bindings using YAML config                                                                                                                                                            Building package executable... [INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ ApiSummarizer ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ ApiSummarizer ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/.dart_tool/jni_gen/target/test-classes

Built jni:setup.
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ ApiSummarizer ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ ApiSummarizer ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/.dart_tool/jni_gen/target/test-classes

+ [build/jni_libs] cmake /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/test/jackson_core_test/third_party/src
00:06 +20: test/yaml_config_test.dart: generate and compare bindings using YAML config                                                                                                                                                            -- The C compiler identification is GNU 12.1.0
-- Detecting C compiler ABI info
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[7,57] package com.github.dart_lang.jni_gen.apisummarizer.doclet does not exist
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[8,59] package com.github.dart_lang.jni_gen.apisummarizer.elements does not exist
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[12,33] cannot find symbol
  symbol: class SummarizerDocletBase
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[18,22] cannot find symbol
  symbol:   class ClassDecl
  location: class com.github.dart_lang.jni_gen.apisummarizer.TestDoclet
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/DocletSummarizerTests.java:[10,59] package com.github.dart_lang.jni_gen.apisummarizer.elements does not exist
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/DocletSummarizerTests.java:[20,16] cannot find symbol
  symbol:   class ClassDecl
  location: class com.github.dart_lang.jni_gen.apisummarizer.DocletSummarizerTests
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/DocletSummarizerTests.java:[21,29] cannot find symbol
  symbol:   class ClassDecl
  location: class com.github.dart_lang.jni_gen.apisummarizer.DocletSummarizerTests
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[13,3] method does not override or implement a method from a supertype
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[15,12] cannot find symbol
  symbol:   variable super
  location: class com.github.dart_lang.jni_gen.apisummarizer.TestDoclet
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[19,12] cannot find symbol
  symbol:   variable types
  location: class com.github.dart_lang.jni_gen.apisummarizer.TestDoclet
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/DocletSummarizerTests.java:[25,24] package Main does not exist
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/DocletSummarizerTests.java:[32,5] cannot find symbol
  symbol:   variable Main
  location: class com.github.dart_lang.jni_gen.apisummarizer.DocletSummarizerTests
[INFO] 12 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.738 s
[INFO] Finished at: 2022-09-01T15:56:53Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:testCompile (default-testCompile) on project ApiSummarizer: Compilation failure: Compilation failure: 
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[7,57] package com.github.dart_lang.jni_gen.apisummarizer.doclet does not exist
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[8,59] package com.github.dart_lang.jni_gen.apisummarizer.elements does not exist
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[12,33] cannot find symbol
[ERROR]   symbol: class SummarizerDocletBase
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[18,22] cannot find symbol
[ERROR]   symbol:   class ClassDecl
[ERROR]   location: class com.github.dart_lang.jni_gen.apisummarizer.TestDoclet
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/DocletSummarizerTests.java:[10,59] package com.github.dart_lang.jni_gen.apisummarizer.elements does not exist
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/DocletSummarizerTests.java:[20,16] cannot find symbol
[ERROR]   symbol:   class ClassDecl
[ERROR]   location: class com.github.dart_lang.jni_gen.apisummarizer.DocletSummarizerTests
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/DocletSummarizerTests.java:[21,29] cannot find symbol
[ERROR]   symbol:   class ClassDecl
[ERROR]   location: class com.github.dart_lang.jni_gen.apisummarizer.DocletSummarizerTests
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[13,3] method does not override or implement a method from a supertype
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[15,12] cannot find symbol
[ERROR]   symbol:   variable super
[ERROR]   location: class com.github.dart_lang.jni_gen.apisummarizer.TestDoclet
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[19,12] cannot find symbol
[ERROR]   symbol:   variable types
[ERROR]   location: class com.github.dart_lang.jni_gen.apisummarizer.TestDoclet
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/DocletSummarizerTests.java:[25,24] package Main does not exist
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/DocletSummarizerTests.java:[32,5] cannot find symbol
[ERROR]   symbol:   variable Main
[ERROR]   location: class com.github.dart_lang.jni_gen.apisummarizer.DocletSummarizerTests
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
00:06 +20 -1: loading test/simple_package_test/generated_files_test.dart [E]                                                                                                                                                                      
  Failed to load "test/simple_package_test/generated_files_test.dart": Cannot rename file to './.dart_tool/jni_gen/ApiSummarizer.jar', path = './.dart_tool/jni_gen/target/ApiSummarizer.jar' (OS Error: No such file or directory, errno = 2)
  dart:io                                                  _File.renameSync
  package:jni_gen/src/tools/build_summarizer.dart 37:23    buildApiSummarizer
  ===== asynchronous gap ===========================
  package:jni_gen/src/tools/build_summarizer.dart 56:5     buildSummarizerIfNotExists
  ===== asynchronous gap ===========================
  package:jni_gen/src/generate_bindings.dart 15:3          generateJniBindings
  ===== asynchronous gap ===========================
  test/simple_package_test/generate.dart 49:3              generateSources
  ===== asynchronous gap ===========================
  test/simple_package_test/generated_files_test.dart 14:3  main

To run this test again: dart test test/simple_package_test/generated_files_test.dart -p vm --plain-name 'loading test/simple_package_test/generated_files_test.dart'
[INFO] Some messages have been simplified; recompile with -Xdiags:verbose to get full output
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[7,57] cannot find symbol
  symbol:   class SummarizerDocletBase
  location: package com.github.dart_lang.jni_gen.apisummarizer.doclet
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[8,59] package com.github.dart_lang.jni_gen.apisummarizer.elements does not exist
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[12,33] cannot find symbol
  symbol: class SummarizerDocletBase
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[18,22] cannot find symbol
  symbol:   class ClassDecl
  location: class com.github.dart_lang.jni_gen.apisummarizer.TestDoclet
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/DocletSummarizerTests.java:[10,59] package com.github.dart_lang.jni_gen.apisummarizer.elements does not exist
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/DocletSummarizerTests.java:[20,16] cannot find symbol
  symbol:   class ClassDecl
  location: class com.github.dart_lang.jni_gen.apisummarizer.DocletSummarizerTests
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/DocletSummarizerTests.java:[21,29] cannot find symbol
  symbol:   class ClassDecl
  location: class com.github.dart_lang.jni_gen.apisummarizer.DocletSummarizerTests
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[13,3] method does not override or implement a method from a supertype
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[15,12] cannot find symbol
  symbol:   variable super
  location: class com.github.dart_lang.jni_gen.apisummarizer.TestDoclet
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[19,12] cannot find symbol
  symbol:   variable types
  location: class com.github.dart_lang.jni_gen.apisummarizer.TestDoclet
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/DocletSummarizerTests.java:[32,39] incompatible types: java.lang.Class<com.github.dart_lang.jni_gen.apisummarizer.TestDoclet> cannot be converted to java.lang.Class<? extends jdk.javadoc.doclet.Doclet>
[INFO] 11 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
-- Found Java: /usr/local/buildtools/java/jdk/bin/java (found version "11.0.13") 
[INFO] Total time:  2.955 s
[INFO] Finished at: 2022-09-01T15:56:53Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:testCompile (default-testCompile) on project ApiSummarizer: Compilation failure: Compilation failure: 
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[7,57] cannot find symbol
[ERROR]   symbol:   class SummarizerDocletBase
[ERROR]   location: package com.github.dart_lang.jni_gen.apisummarizer.doclet
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[8,59] package com.github.dart_lang.jni_gen.apisummarizer.elements does not exist
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[12,33] cannot find symbol
[ERROR]   symbol: class SummarizerDocletBase
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[18,22] cannot find symbol
[ERROR]   symbol:   class ClassDecl
[ERROR]   location: class com.github.dart_lang.jni_gen.apisummarizer.TestDoclet
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/DocletSummarizerTests.java:[10,59] package com.github.dart_lang.jni_gen.apisummarizer.elements does not exist
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/DocletSummarizerTests.java:[20,16] cannot find symbol
[ERROR]   symbol:   class ClassDecl
[ERROR]   location: class com.github.dart_lang.jni_gen.apisummarizer.DocletSummarizerTests
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/DocletSummarizerTests.java:[21,29] cannot find symbol
[ERROR]   symbol:   class ClassDecl
[ERROR]   location: class com.github.dart_lang.jni_gen.apisummarizer.DocletSummarizerTests
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[13,3] method does not override or implement a method from a supertype
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[15,12] cannot find symbol
[ERROR]   symbol:   variable super
[ERROR]   location: class com.github.dart_lang.jni_gen.apisummarizer.TestDoclet
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/TestDoclet.java:[19,12] cannot find symbol
[ERROR]   symbol:   variable types
[ERROR]   location: class com.github.dart_lang.jni_gen.apisummarizer.TestDoclet
[ERROR] /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/java/src/test/java/com/github/dart_lang/jni_gen/apisummarizer/DocletSummarizerTests.java:[32,39] incompatible types: java.lang.Class<com.github.dart_lang.jni_gen.apisummarizer.TestDoclet> cannot be converted to java.lang.Class<? extends jdk.javadoc.doclet.Doclet>
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
-- Found JNI: /usr/lib/jvm/default-java/include  found components: AWT JVM 
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/google/home/dacoharkes/src/dart-lang/jni_gen/jni_gen/build/jni_libs

+ [build/jni_libs] cmake --build .
00:06 +20 -2: loading test/jackson_core_test/generated_files_test.dart [E]                                                                                                                                                                        
  Failed to load "test/jackson_core_test/generated_files_test.dart": Cannot rename file to './.dart_tool/jni_gen/ApiSummarizer.jar', path = './.dart_tool/jni_gen/target/ApiSummarizer.jar' (OS Error: No such file or directory, errno = 2)
  dart:io                                                _File.renameSync
  package:jni_gen/src/tools/build_summarizer.dart 37:23  buildApiSummarizer
  ===== asynchronous gap ===========================
  package:jni_gen/src/tools/build_summarizer.dart 56:5   buildSummarizerIfNotExists
  ===== asynchronous gap ===========================
  package:jni_gen/src/generate_bindings.dart 15:3        generateJniBindings
  ===== asynchronous gap ===========================
  test/jackson_core_test/generate.dart 72:3              generate
  ===== asynchronous gap ===========================
  test/jackson_core_test/generated_files_test.dart 19:3  main

To run this test again: dart test test/jackson_core_test/generated_files_test.dart -p vm --plain-name 'loading test/jackson_core_test/generated_files_test.dart'
[ 50%] Building C object CMakeFiles/jackson_core_test.dir/jackson_core_test.c.o
[100%] Linking C shared library libjackson_core_test.so
[100%] Built target jackson_core_test
[exec] javac dev/dart/simple_package/Example.java dev/dart/pkg2/C2.java
error: file not found: dev/dart/simple_package/Example.java
Usage: javac <options> <source files>
use --help for a list of possible options
00:07 +24 -2: test/yaml_config_test.dart: generate and compare bindings using YAML config                                                                                                                                                         
===== CRASH =====
si_signo=Segmentation fault(11), si_code=1, si_addr=(nil)
version=2.19.0-edge.c920695d36f4640c44f2ba47af07354d566759ac (be) (Tue Aug 30 06:26:48 2022 +0000) on "linux_x64"
pid=252629, thread=252965, isolate_group=main(0x564d8a739800), isolate=main(0x564d8a738800)
os=linux, arch=x64, comp=no, sim=no
isolate_instructions=564d860a82a0, vm_instructions=564d860a82a0
  pc 0x00007effb264ac90 fp 0x00007effb7e7d7b0 /usr/lib/jvm/default-java/lib/server/libjvm.so+0x570c90
  pc 0x00007effb29b7eaf fp 0x00007effb7e7d810 /usr/lib/jvm/default-java/lib/server/libjvm.so+0x8ddeaf
  pc 0x00007effbec38313 fp 0x00007effb7e7d850 build/jni_libs/libjackson_core_test.so+0x9313
  pc 0x00007effbec38521 fp 0x00007effb7e7d890 com_fasterxml_jackson_core_JsonFactory_ctor+0x5a
  pc 0x00007effbef85cdb fp 0x00007effb7e7d8b8 Unknown symbol
  pc 0x00007effb5e69d34 fp 0x00007effb7e7d8e0 Unknown symbol
  pc 0x00007effb5e69996 fp 0x00007effb7e7d920 Unknown symbol
  pc 0x00007effb5e689aa fp 0x00007effb7e7d980 Unknown symbol
  pc 0x00007effb5e5c90b fp 0x00007effb7e7d9d0 Unknown symbol
  pc 0x00007effb88d63d5 fp 0x00007effb7e7da20 Unknown symbol
  pc 0x00007effb88ce509 fp 0x00007effb7e7da98 Unknown symbol
  pc 0x00007effb88ce39c fp 0x00007effb7e7db00 Unknown symbol
  pc 0x00007effb88ce236 fp 0x00007effb7e7db98 Unknown symbol
  pc 0x00007effb88d60ce fp 0x00007effb7e7dbe8 Unknown symbol
  pc 0x00007effb88d5dee fp 0x00007effb7e7dc48 Unknown symbol
  pc 0x00007effb88d50f7 fp 0x00007effb7e7dcc8 Unknown symbol
  pc 0x00007effb88d3e1e fp 0x00007effb7e7dd10 Unknown symbol
  pc 0x00007effb5e3ba37 fp 0x00007effb7e7dd50 Unknown symbol
  pc 0x00007effbef86abe fp 0x00007effb7e7dd80 Unknown symbol
  pc 0x00007effb88d63d5 fp 0x00007effb7e7ddd0 Unknown symbol
  pc 0x00007effb88ce509 fp 0x00007effb7e7de48 Unknown symbol
  pc 0x00007effb88ce39c fp 0x00007effb7e7deb0 Unknown symbol
  pc 0x00007effb88ce236 fp 0x00007effb7e7df48 Unknown symbol
  pc 0x00007effb5e5df83 fp 0x00007effb7e7df98 Unknown symbol
  pc 0x00007effb88bede1 fp 0x00007effb7e7e008 Unknown symbol
  pc 0x00007effb88beb49 fp 0x00007effb7e7e068 Unknown symbol
  pc 0x00007effb88be453 fp 0x00007effb7e7e0f8 Unknown symbol
  pc 0x00007effb88d3a8f fp 0x00007effb7e7e168 Unknown symbol
  pc 0x00007effb88d398d fp 0x00007effb7e7e1a8 Unknown symbol
  pc 0x00007effb88d370f fp 0x00007effb7e7e1f0 Unknown symbol
  pc 0x00007effb88d335e fp 0x00007effb7e7e230 Unknown symbol
  pc 0x00007effb88d3289 fp 0x00007effb7e7e258 Unknown symbol
  pc 0x00007effb88cc4ae fp 0x00007effb7e7e298 Unknown symbol
  pc 0x00007effb5e030e5 fp 0x00007effb7e7e318 Unknown symbol
  pc 0x00007effb5e01689 fp 0x00007effb7e7e350 Unknown symbol
  pc 0x00007effb5e013fc fp 0x00007effb7e7e380 Unknown symbol
  pc 0x00007effb889f3cf fp 0x00007effb7e7e3e8 Unknown symbol
  pc 0x00007effb889ec43 fp 0x00007effb7e7e438 Unknown symbol
  pc 0x00007effbef82a0c fp 0x00007effb7e7e4b0 Unknown symbol
  pc 0x0000564d862227bd fp 0x00007effb7e7e550 dart::DartEntry::InvokeCode(dart::Code const&, unsigned long, dart::Array const&, dart::Array const&, dart::Thread*)+0x14d
  pc 0x0000564d8622260c fp 0x00007effb7e7e5b0 dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&, dart::Array const&, unsigned long)+0x14c
  pc 0x0000564d86224a2c fp 0x00007effb7e7e600 dart::DartLibraryCalls::HandleMessage(long, dart::Instance const&)+0x14c
  pc 0x0000564d8624aab0 fp 0x00007effb7e7eba0 dart::IsolateMessageHandler::HandleMessage(std::__2::unique_ptr<dart::Message, std::__2::default_delete<dart::Message> >)+0x350
  pc 0x0000564d86273f8d fp 0x00007effb7e7ec10 dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool)+0x14d
  pc 0x0000564d8627466f fp 0x00007effb7e7ec60 dart::MessageHandler::TaskCallback()+0x1df
  pc 0x0000564d86398e58 fp 0x00007effb7e7ece0 dart::ThreadPool::WorkerLoop(dart::ThreadPool::Worker*)+0x148
  pc 0x0000564d863992ad fp 0x00007effb7e7ed10 dart::ThreadPool::Worker::Main(unsigned long)+0x6d
  pc 0x0000564d8630cfd8 fp 0x00007effb7e7edd0 dart+0x218dfd8
-- End of DumpStackTrace
  pc 0x0000000000000000 fp 0x00007effb7e7d8b8 sp 0x0000000000000000 [Optimized] 69818443382784
  pc 0x00007effb5e69d34 fp 0x00007effb7e7d8e0 sp 0x00007effb7e7d8c8 [Optimized] FfiTrampoline__ctor
  pc 0x00007effb5e69996 fp 0x00007effb7e7d920 sp 0x00007effb7e7d8f0 [Unoptimized] new JsonFactory.
  pc 0x00007effb5e689aa fp 0x00007effb7e7d980 sp 0x00007effb7e7d930 [Unoptimized] main.<anonymous closure>
  pc 0x00007effb5e5c90b fp 0x00007effb7e7d9d0 sp 0x00007effb7e7d990 [Unoptimized] Declarer.test.<anonymous closure>.<anonymous closure>
  pc 0x00007effb88d63d5 fp 0x00007effb7e7da20 sp 0x00007effb7e7d9e0 [Unoptimized] _SuspendState@4048458._createAsyncCallbacks@4048458.thenCallback
  pc 0x00007effb88ce509 fp 0x00007effb7e7da98 sp 0x00007effb7e7da30 [Unoptimized] _rootRunUnary@4048458
  pc 0x00007effb88ce39c fp 0x00007effb7e7db00 sp 0x00007effb7e7daa8 [Unoptimized] _rootRunUnary@4048458
  pc 0x00007effb88ce236 fp 0x00007effb7e7db98 sp 0x00007effb7e7db10 [Unoptimized] _CustomZone@4048458.runUnary
  pc 0x00007effb88d60ce fp 0x00007effb7e7dbe8 sp 0x00007effb7e7dba8 [Unoptimized] _FutureListener@4048458.handleValue
  pc 0x00007effb88d5dee fp 0x00007effb7e7dc48 sp 0x00007effb7e7dbf8 [Unoptimized] _Future@4048458._propagateToListeners@4048458.handleValueCallback
  pc 0x00007effb88d50f7 fp 0x00007effb7e7dcc8 sp 0x00007effb7e7dc58 [Unoptimized] _Future@4048458._propagateToListeners@4048458
  pc 0x00007effb88d3e1e fp 0x00007effb7e7dd10 sp 0x00007effb7e7dcd8 [Unoptimized] _Future@4048458._completeWithValue@4048458
  pc 0x00007effb5e3ba37 fp 0x00007effb7e7dd50 sp 0x00007effb7e7dd20 [Unoptimized] _SuspendState@4048458._returnAsyncNotFuture@4048458
  pc 0x00007effbef86abe fp 0x00007effb7e7dd80 sp 0x00007effb7e7dd60 [Stub] ReturnAsyncNotFuture
  pc 0x00007effb88d63d5 fp 0x00007effb7e7ddd0 sp 0x00007effb7e7dd90 [Unoptimized] _SuspendState@4048458._createAsyncCallbacks@4048458.thenCallback
  pc 0x00007effb88ce509 fp 0x00007effb7e7de48 sp 0x00007effb7e7dde0 [Unoptimized] _rootRunUnary@4048458
  pc 0x00007effb88ce39c fp 0x00007effb7e7deb0 sp 0x00007effb7e7de58 [Unoptimized] _rootRunUnary@4048458
  pc 0x00007effb88ce236 fp 0x00007effb7e7df48 sp 0x00007effb7e7dec0 [Unoptimized] _CustomZone@4048458.runUnary
  pc 0x00007effb5e5df83 fp 0x00007effb7e7df98 sp 0x00007effb7e7df58 [Unoptimized] _SuspendState@4048458._awaitCompletedFuture@4048458.run
  pc 0x00007effb88bede1 fp 0x00007effb7e7e008 sp 0x00007effb7e7dfa8 [Unoptimized] _rootRun@4048458
  pc 0x00007effb88beb49 fp 0x00007effb7e7e068 sp 0x00007effb7e7e018 [Unoptimized] _rootRun@4048458
  pc 0x00007effb88be453 fp 0x00007effb7e7e0f8 sp 0x00007effb7e7e078 [Unoptimized] _CustomZone@4048458.run
  pc 0x00007effb88d3a8f fp 0x00007effb7e7e168 sp 0x00007effb7e7e108 [Unoptimized] _CustomZone@4048458.runGuarded
  pc 0x00007effb88d398d fp 0x00007effb7e7e1a8 sp 0x00007effb7e7e178 [Unoptimized] _CustomZone@4048458.bindCallbackGuarded.<anonymous closure>
  pc 0x00007effb88d370f fp 0x00007effb7e7e1f0 sp 0x00007effb7e7e1b8 [Unoptimized] _microtaskLoop@4048458
  pc 0x00007effb88d335e fp 0x00007effb7e7e230 sp 0x00007effb7e7e200 [Unoptimized] _startMicrotaskLoop@4048458
  pc 0x00007effb88d3289 fp 0x00007effb7e7e258 sp 0x00007effb7e7e240 [Unoptimized] _startMicrotaskLoop@4048458
  pc 0x00007effb88cc4ae fp 0x00007effb7e7e298 sp 0x00007effb7e7e268 [Unoptimized] _runPendingImmediateCallback@1026248
  pc 0x00007effb5e030e5 fp 0x00007effb7e7e318 sp 0x00007effb7e7e2a8 [Unoptimized] _Timer@1026248._runTimers@1026248
  pc 0x00007effb5e01689 fp 0x00007effb7e7e350 sp 0x00007effb7e7e328 [Unoptimized] _Timer@1026248._handleMessage@1026248
  pc 0x00007effb5e013fc fp 0x00007effb7e7e380 sp 0x00007effb7e7e360 [Unoptimized] _Timer@1026248._handleMessage@1026248
  pc 0x00007effb889f3cf fp 0x00007effb7e7e3e8 sp 0x00007effb7e7e390 [Unoptimized] _Closure@0150898.dyn:call
  pc 0x00007effb889ec43 fp 0x00007effb7e7e438 sp 0x00007effb7e7e3f8 [Unoptimized] _RawReceivePortImpl@1026248._handleMessage@1026248
  pc 0x00007effbef82a0c fp 0x00007effb7e7e4b0 sp 0x00007effb7e7e448 [Stub] InvokeDartCode
Aborted
mahesh-hegde commented 1 year ago

Is it a setting? Tests always run serially for me.

Re segfault, it might be classpath issue, which should throw exception when dart-lang/native#786 is implemented. Again classpath issue may be related to concurrent run.

Re lock, what's the best way? I think a lock file would be still prone to concurrency issues when all tests are run parallely.

mahesh-hegde commented 1 year ago

The segfault is caused by a run order which I or CI never encountered before. On my system mvn_jar are always cached so never thought about this case.

Basically JAR folder is empty and classpath is empty. Since bindings aren't handling exceptions yet, the JNI call when an exception is pending segfaults.

Fixed it by running jni_gen:download_maven_jars before test. (Once cached in system ~/.m2, maven doesn't need to download again and again, so I think that's fine.)

The loadclass segfault dart-lang/native#783 though, it's strange.

mahesh-hegde commented 1 year ago

Re: summarizer build happening concurrently, what's the best approach?

Write a lock file, and other process poll repeatedly in fixed intervals until lock gets deleted?

dcharkes commented 1 year ago

Re: summarizer build happening concurrently, what's the best approach?

Write a lock file, and other process poll repeatedly in fixed intervals until lock gets deleted?

Yes, something like that. You could use an exponential back-off. Every time wait 2x as long as previous time. Or do a fixed interval, whatever makes more sense. (How long does the build typically take.) Maybe also add a timeout, instead of relying on the tests timing out themselves. Then in the timeout it is clear the build failed to complete on time, rather than the test timing out at the default timeout of the tests package without a clear indication why.