Skip to content

Commit

Permalink
Merge pull request #6543 from commercialhaskell/re6267
Browse files Browse the repository at this point in the history
Re #6267 Move removal of `*.hi` and `*.o` to after their creation
  • Loading branch information
mpilgrem authored Apr 1, 2024
2 parents fa7cd30 + 6c9f8d6 commit 4975d5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .stan.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@

# Anti-pattern: Data.ByteString.Char8.pack
[[ignore]]
id = "OBS-STAN-0203-erw24B-1034:3"
id = "OBS-STAN-0203-erw24B-1031:3"
# ✦ Description: Usage of 'pack' function that doesn't handle Unicode characters
# ✦ Category: #AntiPattern
# ✦ File: src\Stack\Build\ExecuteEnv.hs
#
# 1033
# 1034 ┃ S8.pack . formatTime defaultTimeLocale "%Y-%m-%dT%H:%M:%S%6Q"
# 1035 ┃ ^^^^^^^
# 1030
# 1031 ┃ S8.pack . formatTime defaultTimeLocale "%Y-%m-%dT%H:%M:%S%6Q"
# 1032 ┃ ^^^^^^^

# Anti-pattern: Data.ByteString.Char8.pack
[[ignore]]
Expand Down
9 changes: 3 additions & 6 deletions src/Stack/Build/ExecuteEnv.hs
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,6 @@ withExecuteEnv
setupO = setupSrcDir </> setupOName
setupHsExists <- doesFileExist setupHs
unless setupHsExists $ writeBinaryFileAtomic setupHs simpleSetupCode
-- See https://github.com/commercialhaskell/stack/issues/6267. Remove any
-- historical *.hi or *.o files. This can be dropped when Stack drops
-- support for the problematic versions of GHC.
ignoringAbsence (removeFile setupHi)
ignoringAbsence (removeFile setupO)
let setupShimStub = "setup-shim-" ++ simpleSetupHash
setupShimFileName <- parseRelFile (setupShimStub ++ ".hs")
setupShimHiName <- parseRelFile (setupShimStub ++ ".hi")
Expand All @@ -303,12 +298,14 @@ withExecuteEnv
setupShimHsExists <- doesFileExist setupShimHs
unless setupShimHsExists $
writeBinaryFileAtomic setupShimHs setupGhciShimCode
setupExe <- getSetupExe setupHs setupShimHs tempDir
-- See https://github.com/commercialhaskell/stack/issues/6267. Remove any
-- historical *.hi or *.o files. This can be dropped when Stack drops
-- support for the problematic versions of GHC.
ignoringAbsence (removeFile setupHi)
ignoringAbsence (removeFile setupO)
ignoringAbsence (removeFile setupShimHi)
ignoringAbsence (removeFile setupShimO)
setupExe <- getSetupExe setupHs setupShimHs tempDir
cabalPkgVer <- view cabalVersionL
globalDB <- view $ compilerPathsL . to (.globalDB)
let globalDumpPkgs = toDumpPackagesByGhcPkgId globalPackages
Expand Down

0 comments on commit 4975d5b

Please sign in to comment.