zeromq / zproject

CLASS Project Generator
Mozilla Public License 2.0
147 stars 104 forks source link

Problem: Compilation fails on CentOS, due to duplicate lib entry. #1302

Closed stephan57160 closed 1 year ago

stephan57160 commented 1 year ago

ZYRE compilation started for Android, with a similar script to zyre/bingings/jni/ci_build.sh.

Compilation ends with:

> Task :czmq-jni-native:classes UP-TO-DATE
Skipping task ':czmq-jni-native:classes' as it has no actions.
:czmq-jni-native:classes (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
:czmq-jni-native:copyLibs (Thread[Execution worker for ':',5,main]) started.

> Task :czmq-jni-native:copyLibs FAILED
Caching disabled for task ':czmq-jni-native:copyLibs' because:
  Build cache is disabled
Task ':czmq-jni-native:copyLibs' is not up-to-date because:
  No history is available.
file or directory '/usr/java/packages/lib', not found
:czmq-jni-native:copyLibs (Thread[Execution worker for ':',5,main]) completed. Took 0.062 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':czmq-jni-native:copyLibs'.
> Entry libcurl.so is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/7.4.2/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy for details.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Investigation have shown 2 things:

Solution: Set duplicate strategy to warn, not to stop the build.

Additionnally, add libraries found in $BUILD_PREFIX first, then, the system ones, in case one wants to have his own library version in the JAR.

This fixes CZMQ issue https://github.com/zeromq/czmq/issues/2231