Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Kleidukos opened this issue Nov 17, 2023 · 2 comments
Closed

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

Kleidukos opened this issue Nov 17, 2023 · 2 comments
Labels
invalid Resolved as invalid, i.e. not a bug llvm-tools All llvm tools that do not have corresponding tag

Comments

@Kleidukos
Copy link

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?

@Kleidukos Kleidukos changed the title llvm-ar cannot handle "%" in a file path llvm-ar.exe cannot handle "%" in a file path Nov 17, 2023
@EugeneZelenko EugeneZelenko added llvm-tools All llvm tools that do not have corresponding tag and removed new issue labels Nov 17, 2023
@MaskRay
Copy link
Member

MaskRay commented Dec 18, 2023

Please describe the exact llvm-ar command cabal runs. With the current information we cannot determine it isn't cabal's fault on Windows.

llvm-ar does not treat '%' specially.

% touch '%5nVnTgLeh7AaK3jOtq2ERexJN' '%s'
% llvm-ar rc a.a '%5nVnTgLeh7AaK3jOtq2ERexJN' '%s'
% llvm-ar tv a.a
rw-r--r-- 0/0      0 Dec 31 16:00 1969 %s
rw-r--r-- 0/0      0 Dec 31 16:00 1969 %5nVnTgLeh7AaK3jOtq2ERexJN

@MaskRay
Copy link
Member

MaskRay commented Dec 18, 2023

haskell/cabal#9459 suggests that this was a Cabal issue.

@MaskRay MaskRay closed this as not planned Won't fix, can't repro, duplicate, stale Dec 18, 2023
@EugeneZelenko EugeneZelenko added the invalid Resolved as invalid, i.e. not a bug label Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Resolved as invalid, i.e. not a bug llvm-tools All llvm tools that do not have corresponding tag
Projects
None yet
Development

No branches or pull requests

3 participants