Skip to content

Extra .exe suffix on windows, possible regression in 0.11.xΒ #324

@cushon

Description

@cushon

I'm updating Bazel's use of rules_graalvm from 0.10.3 to 0.11.1, and from GraalVM 20.0.2 to 21.0.2, and am seeing a failure where it looks like the handling of executable_name had changed on windows:

ERROR: C:/b/ufipaqxb/execroot/_main/_tmp/c7869347f3b0f58b8b3d901d6cb2632e/root/fqvxxemw/external/bazel_tools/tools/java/runfiles/BUILD:12:13: Compiling Java headers external/bazel_tools/tools/java/runfiles/libauto_bazel_repository-hjar.jar (1 source file) failed: missing input file '@@rules_java~~toolchains~remote_java_tools_windows//:java_tools/turbine_direct_graal.exe'

The build logs contain

========================================================================================================================
GraalVM Native Image: Generating 'turbine_direct_graal.exe' (executable)...
========================================================================================================================
...
 - '-H:Name' (alternative API option(s): -o turbine_direct_graal.exe; origin(s): command line)
...
Produced artifacts:
 C:\b\ykmfm4bk\execroot\_main\bazel-out\x64_windows-fastbuild\bin\src\java_tools\buildjar\java\com\google\devtools\build\java\turbine\turbine_direct_graal.exe.exe (executable)

The usage of native_image is configuring a windows-specific path with the .exe suffix. It's overriding the defaults to drop the -bin suffix that's added:

https://github.com/bazelbuild/bazel/blob/4420fffb00794405a334d55c9c5c53669a217f05/src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/BUILD#L29-L34

native_image(
    name = "turbine_direct_graal",
    executable_name = select({
        "@bazel_tools//src/conditions:windows": "%target%.exe",
        "//conditions:default": "%target%",
    }),

It looks like an extra suffix is being added somewhere, so it's resulting in .exe.exe on windows.

I wondered if this is related to #217, but from the build logs it looks like native-image is being invoked with -o turbine_direct_graal.exe.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingplatform:windowsIssues relating to Windows and MSVC

Projects

Status

In Progress

Relationships

None yet

Development

No branches or pull requests

Issue actions