Skip to content

Commit 4975d5b

Browse files
authored
Merge pull request #6543 from commercialhaskell/re6267
Re #6267 Move removal of `*.hi` and `*.o` to after their creation
2 parents fa7cd30 + 6c9f8d6 commit 4975d5b

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

.stan.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@
7272

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

8484
# Anti-pattern: Data.ByteString.Char8.pack
8585
[[ignore]]

src/Stack/Build/ExecuteEnv.hs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,6 @@ withExecuteEnv
288288
setupO = setupSrcDir </> setupOName
289289
setupHsExists <- doesFileExist setupHs
290290
unless setupHsExists $ writeBinaryFileAtomic setupHs simpleSetupCode
291-
-- See https://github.com/commercialhaskell/stack/issues/6267. Remove any
292-
-- historical *.hi or *.o files. This can be dropped when Stack drops
293-
-- support for the problematic versions of GHC.
294-
ignoringAbsence (removeFile setupHi)
295-
ignoringAbsence (removeFile setupO)
296291
let setupShimStub = "setup-shim-" ++ simpleSetupHash
297292
setupShimFileName <- parseRelFile (setupShimStub ++ ".hs")
298293
setupShimHiName <- parseRelFile (setupShimStub ++ ".hi")
@@ -303,12 +298,14 @@ withExecuteEnv
303298
setupShimHsExists <- doesFileExist setupShimHs
304299
unless setupShimHsExists $
305300
writeBinaryFileAtomic setupShimHs setupGhciShimCode
301+
setupExe <- getSetupExe setupHs setupShimHs tempDir
306302
-- See https://github.com/commercialhaskell/stack/issues/6267. Remove any
307303
-- historical *.hi or *.o files. This can be dropped when Stack drops
308304
-- support for the problematic versions of GHC.
305+
ignoringAbsence (removeFile setupHi)
306+
ignoringAbsence (removeFile setupO)
309307
ignoringAbsence (removeFile setupShimHi)
310308
ignoringAbsence (removeFile setupShimO)
311-
setupExe <- getSetupExe setupHs setupShimHs tempDir
312309
cabalPkgVer <- view cabalVersionL
313310
globalDB <- view $ compilerPathsL . to (.globalDB)
314311
let globalDumpPkgs = toDumpPackagesByGhcPkgId globalPackages

0 commit comments

Comments
 (0)