Skip to content

llvm-ar.exe cannot handle "%" in a file path #72636

Closed as not planned
Closed as not planned
@Kleidukos

Description

@Kleidukos

Originally surfaced in haskell/cabal#9334

Hi everyone,

It has recently been found that llvm-ar.exe cannot handle file paths containing the % character, leading to a misleading error:

$ cabal run --enable-profiling ./moon.hs
C:/ghcup/ghc/9.6.3/lib/../mingw/bin/llvm-ar.exe: error: C:\\cabal\\script-builds\\%5nVnTgLeh7AaK3jOtq2ERexJN\\build\\x86_64-windows\\ghc-9.6.3\\fake-package-0\\x\\script-moon.hs\\build\\script-moon.hs\\script-moon.hs-tmp\Main.p_o.tmp: No such file or directory

<no location info>: error:
    `llvm-ar.exe' failed in phase `Ar'. (Exit code: 1)

The path segment %5nVnTgLeh7AaK3jOtq2ERexJN here is at fault.

However the error is misleading, because we see a "file not found" message.

If it's too much of a hassle to handle % in file paths, could the error message be improved so that downstream users can have their own workaround?

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidResolved as invalid, i.e. not a bugllvm-toolsAll llvm tools that do not have corresponding tag

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions