Juan Farré created MNG-8768:
-------------------------------

             Summary: Add a conditional expression for profile activation 
evaluating to true if a certain executable can be found in the system path
                 Key: MNG-8768
                 URL: https://issues.apache.org/jira/browse/MNG-8768
             Project: Maven
          Issue Type: Sub-task
            Reporter: Juan Farré


I have a use case that I think is of general interest.

I am generating a native image with GraalVM native-maven-plugin, and I'd like 
to autodetect the presence of the musl gcc compiler wrapper 
x86_64-linux-musl-gcc in the path to generate a static executable.

When using GraalVM to build an image with the following options,
{code:bash}
native-image --static --libc=musl ...{code}
it tries to use x86_64-linux-musl-gcc to compile. If it isn't available in the 
system path, it crashes.

My idea is to activate a profile when building under Linux x86_64 and the 
executable x86_64-linux-musl-gcc is detected in the path. This profile would 
add the options --static and --libc=musl to the native-maven-plugin 
configuration.

It could be an expression like executable(executable_name_or_path), which would 
search for the executable in the system path (unless a path is given) and check 
that it's actually an executable.

I think this can be useful for many other use cases.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to