native-build-tools icon indicating copy to clipboard operation
native-build-tools copied to clipboard

Unable to apply parallel builds to thread-unsafe `native-maven-plugin`

Open linghengqian opened this issue 1 year ago • 2 comments

Describe the bug A clear and concise description of what the bug is. Make sure that you have read the documentation and that you are using the latest plugin version.

  • Unable to apply parallel builds to thread-unsafe native-maven-plugin.

To Reproduce

When possible, provide a link to a repository which reproduces the issue, with instructions on how to use. The reproducer must make use of either the Maven or Gradle plugin.

Steps to reproduce the behavior:

git clone [email protected]:linghengqian/hive-server2-jdbc-driver.git
cd ./hive-server2-jdbc-driver/
git reset --hard d4458d75483224f47a63dd0e13c47258f5ed6abf
sdk install java 22.0.2-graalce
sudo apt-get install build-essential zlib1g-dev -y
sdk use java 22.0.2-graalce
./mvnw -T 1.5C -PnativeTestInCustom clean test
  • If I change ./mvnw -T 1.5C -PnativeTestInCustom clean test to ./mvnw -PnativeTestInCustom clean test, everything works fine.
  • Parallel builds are explicitly supported in Maven 3, see https://cwiki.apache.org/confluence/display/MAVEN/Parallel+builds+in+Maven+3 . And in Maven 4, MOJOs are considered thread-safe. See https://github.com/apache/maven/pull/1675 .

Expected behavior A clear and concise description of what you expected to happen.

  • Make parallel builds work properly with thread-unsafe native-maven-plugin.

Logs Add logs to help explain your problem.

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for io.github.linghengqian:hive-parent 1.4.0-SNAPSHOT:
[INFO] 
[INFO] io.github.linghengqian:hive-parent ................. SUCCESS [  0.104 s]
[INFO] hive-server2-jdbc-driver-thin ...................... FAILURE [ 34.512 s]
[INFO] hive-server2-jdbc-driver-uber ...................... SUCCESS [02:31 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:31 min (Wall Clock)
[INFO] Finished at: 2024-09-06T09:51:18+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.graalvm.buildtools:native-maven-plugin:0.10.2:test (test-native) on project hive-server2-jdbc-driver-thin: Execution test-native of goal org.graalvm.buildtools:native-maven-plugin:0.10.2:test failed.: FileSystemNotFoundException -> [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/PluginExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :hive-server2-jdbc-driver-thin

System Info (please complete the following information):

  • OS: [e.g. Windows] Ubuntu 22.04.4
  • GraalVM Version [e.g. 22.0 CE] 24.0.2 CE
  • Java Version [e.g. 17] 22
  • Plugin version [e.g. native-gradle-plugin:0.9.10] native-maven-plugin:0.10.2

Additional context Add any other context about the problem here.

  • See https://github.com/linghengqian/hive-server2-jdbc-driver/issues/3 and https://github.com/apache/shardingsphere/pull/32574 .

linghengqian avatar Sep 06 '24 01:09 linghengqian

Can you please run the test with -X option to get the full log output?

dnestoro avatar Oct 07 '24 14:10 dnestoro

Can you please run the test with -X option to get the full log output?

  • I re-tested at https://github.com/linghengqian/hive-server2-jdbc-driver/pull/12. It looks like with the update of org.graalvm.buildtools:native-maven-plugin to 0.10.3, the Error Log no longer appears .
  • I haven't really seen which PR on GraalVM Native Build Tools 0.10.3 fixed this issue. The behavior changed starting from https://github.com/linghengqian/hive-server2-jdbc-driver/commit/00de0c5c388c6a36487b28f9ab7b3f32131fbd92 .
  • Should I just close the current issue?

linghengqian avatar Oct 07 '24 15:10 linghengqian

  • Should I just close the current issue?

@linghengqian please feel free to close this issue if it is no longer a problem

dnestoro avatar Apr 04 '25 09:04 dnestoro