Skip to content

[MNG-8768] Add a function for conditional profile activation evaluating to true if a certain executable can be found in the system path #10115

Description

@jira-importer

Juan Farré opened MNG-8768 and commented

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,

native-image --static --libc=musl ...

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 a function like:

executable(executable_name_or_path)

It 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 issue is a sub-task of MNG-8292

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions