graalvm / native-build-tools

Native-image plugins for various build tools
https://graalvm.github.io/native-build-tools/
Other
372 stars 64 forks source link

Build fails when moving to maven plugin version 0.10.3 #629

Open itineric opened 1 month ago

itineric commented 1 month ago

Describe the bug Moved from maven plugin version 0.10.2 to version 0.10.3 (nothing else changed, building in docker environment).

Logs

Sometimes I have

> com.oracle.svm.core.util.VMError$HostedError: Unable to run '/tmp/SVM-7190424573437323119/AArch64LibCHelperDirectives' to compute offsets in C data structures. Is it possible that your antivirus software interferes and puts the resulting file into quarantine?

or

> com.oracle.svm.core.util.VMError$HostedError: Unable to run '/tmp/SVM-17858907294964428047/BuiltinDirectives' to compute offsets in C data structures. Is it possible that your antivirus software interferes and puts the resulting file into quarantine?

And some other times:

         [] Error: Error compiling query code (in /tmp/SVM-48586303440702563/PosixDirectives.c). Compiler command '/opt/x86_64-linux-musl-native/bin/gcc -Wal
l -Werror -o /tmp/SVM-48586303440702563/PosixDirectives /tmp/SVM-48586303440702563/PosixDirectives.c' output included error: /tmp/SVM-48586303440702563/Posix
Directives.c:82:117: error: ???LC_ADDRESS??? undeclared (first use in this function)
         []     method com.oracle.svm.core.posix.headers.Errno.ETIMEDOUT()
         []     C file contents around line 82:
         []     /tmp/SVM-48586303440702563/PosixDirectives.c:81:     printf("NativeCodeInfo:PosixDirectives:ConstantInfo:ETIMEDOUT:PropertyInfo:value=%lX\n",
 ((unsigned long)ETIMEDOUT));
         []     /tmp/SVM-48586303440702563/PosixDirectives.c:82:     printf("NativeCodeInfo:PosixDirectives:ConstantInfo:LC_ADDRESS:PropertyInfo:size=%lu\n",
 ((unsigned long)sizeof(LC_ADDRESS)));
         []     /tmp/SVM-48586303440702563/PosixDirectives.c:83:     printf("NativeCodeInfo:PosixDirectives:ConstantInfo:LC_ADDRESS:PropertyInfo:signedness=$
%s$\n", ((LC_ADDRESS>=0 ? 1 : 0)) ? "UNSIGNED" : "SIGNED");
         [] Error: Error compiling query code (in /tmp/SVM-48586303440702563/PosixDirectives.c). Compiler command '/opt/x86_64-linux-musl-native/bin/gcc -Wal
l -Werror -o /tmp/SVM-48586303440702563/PosixDirectives /tmp/SVM-48586303440702563/PosixDirectives.c' output included error: /tmp/SVM-48586303440702563/Posix
Directives.c:94:124: error: ???LC_IDENTIFICATION??? undeclared (first use in this function)
         []     method com.oracle.svm.core.posix.headers.Locale.LC_CTYPE()
         []     C file contents around line 94:
         []     /tmp/SVM-48586303440702563/PosixDirectives.c:93:     printf("NativeCodeInfo:PosixDirectives:ConstantInfo:LC_CTYPE:PropertyInfo:value=%lX\n",
((unsigned long)LC_CTYPE));
         []     /tmp/SVM-48586303440702563/PosixDirectives.c:94:     printf("NativeCodeInfo:PosixDirectives:ConstantInfo:LC_IDENTIFICATION:PropertyInfo:size=
%lu\n", ((unsigned long)sizeof(LC_IDENTIFICATION)));
         []     /tmp/SVM-48586303440702563/PosixDirectives.c:95:     printf("NativeCodeInfo:PosixDirectives:ConstantInfo:LC_IDENTIFICATION:PropertyInfo:signe
dness=$%s$\n", ((LC_IDENTIFICATION>=0 ? 1 : 0)) ? "UNSIGNED" : "SIGNED");
         [] Error: Error compiling query code (in /tmp/SVM-48586303440702563/PosixDirectives.c). Compiler command '/opt/x86_64-linux-musl-native/bin/gcc -Wal
l -Werror -o /tmp/SVM-48586303440702563/PosixDirectives /tmp/SVM-48586303440702563/PosixDirectives.c' output included error: /tmp/SVM-48586303440702563/Posix
Directives.c:97:121: error: ???LC_MEASUREMENT??? undeclared (first use in this function)
         []     method com.oracle.svm.core.posix.headers.Locale.LC_IDENTIFICATION()
         []     C file contents around line 97:
         []     /tmp/SVM-48586303440702563/PosixDirectives.c:96:     printf("NativeCodeInfo:PosixDirectives:ConstantInfo:LC_IDENTIFICATION:PropertyInfo:value
=%lX\n", ((unsigned long)LC_IDENTIFICATION));
         []     /tmp/SVM-48586303440702563/PosixDirectives.c:97:     printf("NativeCodeInfo:PosixDirectives:ConstantInfo:LC_MEASUREMENT:PropertyInfo:size=%lu
\n", ((unsigned long)sizeof(LC_MEASUREMENT)));
         []     /tmp/SVM-48586303440702563/PosixDirectives.c:98:     printf("NativeCodeInfo:PosixDirectives:ConstantInfo:LC_MEASUREMENT:PropertyInfo:signedne
ss=$%s$\n", ((LC_MEASUREMENT>=0 ? 1 : 0)) ? "UNSIGNED" : "SIGNED");
...
...
...
...

System Info:

vjovanov commented 1 month ago

We looked into this and find it highly unlikely that it comes from the version bump in the maven plugin. Please try this by downgrading the plugin to 0.10.2 in the same docker environment.

The reason why we think it is not Maven related is because the failure indicates that there are missing header files on the docker container. This error is purely in Native Image and Maven does not even see that in any circumstance.