Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Build fails when moving to maven plugin version 0.10.3 #629

Open
itineric opened this issue Oct 21, 2024 · 4 comments
Open

Build fails when moving to maven plugin version 0.10.3 #629

itineric opened this issue Oct 21, 2024 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@itineric
Copy link

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:

  • OS: debian inside docker
  • GraalVM Version 17.0.9 CE
  • Java Version 17
  • Plugin version native-maven-plugin:0.10.13
@itineric itineric added the bug Something isn't working label Oct 21, 2024
@vjovanov
Copy link
Member

vjovanov commented Nov 4, 2024

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.

@vjovanov vjovanov self-assigned this Nov 4, 2024
@itineric
Copy link
Author

trying to upgrade this version again, still having the issue with 0.10.3 and 0.10.4

What makes you belive there is a missing header in the docker image? I do not find any information about was may be missing.

@itineric
Copy link
Author

I finally found the issue. It is related to that breaking change:
90abd0b#diff-e69cd9817043e503f9d8aadfad08867aeb9e02e33435f8fe7eea7f1225e12794L246
My single <arg> containing many arguments is not interpreted the same way as before. I think the --static --libc=musl are not used at all. So the compilation of the .c files in the SVM-xxx folder are at best "not compilable" (the error makes you think there are missing headers), at worth: the executable file is compiled but not executable at all (not statically linked as expected).

@itineric
Copy link
Author

The real beaking change is here: https://github.com/graalvm/native-build-tools/blame/27986882a3e797b39ee5783a76706622791db347/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/AbstractNativeImageMojo.java#L250
The split with the second argument can lead to arguments being lost, depending on the order the arguments are provided.

@brahimhaddou brahimhaddou added this to the 0.10.6 milestone Feb 5, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants