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

Windows: .../ghc-9.4.8/mingw/bin/strip.exe: error: Permission denied #6627

Open
mpilgrem opened this issue Jul 19, 2024 · 1 comment
Open

Comments

@mpilgrem
Copy link
Member

While building happy-1.20.1.1 with GHC 9.4.8 on Windows in CI, @hausfell experienced:

happy > .../ghc-9.4.8/mingw/bin/strip.exe: error: Permission denied

This was during the Setup.hs copy step, which sees Cabal (the library), by default, run strip after having moved the executable file to a new location. For example, during stack --verbose build --cabal-verbose --ghc-options=-v:

2024-07-19 18:17:18.401203: [info] creating
2024-07-19 18:17:18.401203: [info] ...\happy-1.20.1.1\.stack-work\install\fd1b2601\bin
2024-07-19 18:17:18.401203: [info] Installing executable .stack-work\dist\f1a1ac53\build\happy\happy.exe to
2024-07-19 18:17:18.401203: [info] ...\happy-1.20.1.1\.stack-work\install\fd1b2601\bin\happy.exe
2024-07-19 18:17:18.401203: [info] "...\ghc-9.4.8\mingw\bin\strip.exe" "...\happy-1.20.1.1\.stack-work\install\fd1b2601\bin\happy.exe"

I think it must be strip.exe seeking to overwrite happy.exe when it is not yet free to do so, for some reason.

Cabal's Distribution.Simple.GHC.installExe has (extract):

        installBinary dest = do
          installExecutableFile
            verbosity
            (buildPref </> exeName' </> exeFileName)
            (dest <.> exeExtension (hostPlatform lbi))
          when (stripExes lbi) $
            Strip.stripExe
              verbosity
              (hostPlatform lbi)
              (withPrograms lbi)
              (dest <.> exeExtension (hostPlatform lbi))

So, it looks to me that things are properly sequenced. Could it be a problem within the MSYS2-supplied strip.exe itself?

@hasufell
Copy link
Contributor

CI where it first happened: https://github.com/haskell/ghcup-hs/actions/runs/9996272096/job/27630268254?pr=1108

The second run did not suffer from this issue: https://github.com/haskell/ghcup-hs/actions/runs/9996272096/job/27695488770?pr=1108

This suggests it's a spurious failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants