Skip to content

binary executables should use '.exe' suffix on Windows #11

@2bndy5

Description

@2bndy5

I've been trying this out on my Windows machine, and The OS didn't know that the binaries were executable files because they didn't have the .exe file suffix.

Example after installing v12 in a python venv

Executing `clang-format-12` asked me what program to open the file with.

image

After changing .exe to the clang-format binary file's suffix, I got the expected behavior:

(venv) PS path\to\GitHub\cpp-linter-action> clang-format-12.exe --version
clang-format version 12.0.0

I'm guessing the fix for this would involve modifying the call to

def move_and_chmod_binary(old_file_name, new_file_name, directory) -> None:

or simply adjusting the new_file_name arg for the Windows platform within the mv_and_chmod() function.

Other Windows considerations

os.chmod() has limited support on Windows. The docs specifically note:

Although Windows supports chmod(), you can only set the file’s read-only flag with it (via the stat.S_IWRITE and stat.S_IREAD constants or a corresponding integer value). All other bits are ignored.

I'm not entirely familiar with Unix permission's octal format, but using 0o755 didn't raise any exceptions.


ps - I also would like it if clang-tools -i 12 installed 12.0.1 instead of the older 12.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions