<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/72636>72636</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            llvm-ar cannot handle "%" in a file path
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Kleidukos
      </td>
    </tr>
</table>

<pre>
    Originally surfaced in https://github.com/haskell/cabal/issues/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?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VN-PnDYQ_mu8LyMQay-w-8DDdhPUNG0iVVFfo8EM4JyxqW1u7_77ymavt3dKKyHAnh-e-fx9g96r0RA1rPyFlR92uIbJuuazJtWvD9bvOts_N1-dGpVBrZ_Br25AST0oA1MIi2fizHjLeDuqMK1dLu3MeDuhfyCtGW8ldhi_yvuVPOPtSYgDKz6w4ry9f1VAj-SerSHGL_eWTwEm9OBIkgn6GToiA4NdTQ9hwgCsKrR-nDN0OT0RqwqQaIyNUabXBIPSBAuGyYO0JqAyyowQJoqRjJcpYkKHMpBj_AKasE8uFhBm5V_W5Jx1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