@@ -146,6 +146,8 @@ data SetupOpts = SetupOpts
146146 -- ^ Location of the main stack-setup.yaml file
147147 , soptsGHCBindistURL :: ! (Maybe String )
148148 -- ^ Alternate GHC binary distribution (requires custom GHCVariant)
149+ , soptsGHCJSBootOpts :: [String ]
150+ -- ^ Additional ghcjs-boot options, the default is "--clean"
149151 }
150152 deriving Show
151153data SetupException = UnsupportedSetupCombo OS Arch
@@ -235,6 +237,7 @@ setupEnv mResolveMissingGHC = do
235237 , soptsResolveMissingGHC = mResolveMissingGHC
236238 , soptsSetupInfoYaml = defaultSetupInfoYaml
237239 , soptsGHCBindistURL = Nothing
240+ , soptsGHCJSBootOpts = [" --clean" ]
238241 }
239242
240243 (mghcBin, compilerBuild, _) <- ensureCompiler sopts
@@ -496,7 +499,7 @@ ensureCompiler sopts = do
496499 upgradeCabal menv wc
497500
498501 case mtools of
499- Just (Just (ToolGhcjs cv), _) -> ensureGhcjsBooted menv cv (soptsInstallIfMissing sopts)
502+ Just (Just (ToolGhcjs cv), _) -> ensureGhcjsBooted menv cv (soptsInstallIfMissing sopts) (soptsGHCJSBootOpts sopts)
500503 _ -> return ()
501504
502505 when (soptsSanityCheck sopts) $ sanityCheck menv wc
@@ -1086,8 +1089,8 @@ installGHCJS si archiveFile archiveType _tempDir destDir = do
10861089 $ logStickyDone " Installed GHCJS."
10871090
10881091ensureGhcjsBooted :: (StackM env m , HasConfig env )
1089- => EnvOverride -> CompilerVersion -> Bool -> m ()
1090- ensureGhcjsBooted menv cv shouldBoot = do
1092+ => EnvOverride -> CompilerVersion -> Bool -> [ String ] -> m ()
1093+ ensureGhcjsBooted menv cv shouldBoot bootOpts = do
10911094 eres <- try $ sinkProcessStdout Nothing menv " ghcjs" [] (return () )
10921095 case eres of
10931096 Right () -> return ()
@@ -1117,12 +1120,12 @@ ensureGhcjsBooted menv cv shouldBoot = do
11171120 actualStackYamlExists <- doesFileExist actualStackYaml
11181121 unless actualStackYamlExists $
11191122 fail " Couldn't find GHCJS stack.yaml in old or new location."
1120- bootGhcjs ghcjsVersion actualStackYaml destDir
1123+ bootGhcjs ghcjsVersion actualStackYaml destDir bootOpts
11211124 Left err -> throwM err
11221125
11231126bootGhcjs :: StackM env m
1124- => Version -> Path Abs File -> Path Abs Dir -> m ()
1125- bootGhcjs ghcjsVersion stackYaml destDir = do
1127+ => Version -> Path Abs File -> Path Abs Dir -> [ String ] -> m ()
1128+ bootGhcjs ghcjsVersion stackYaml destDir bootOpts = do
11261129 envConfig <- loadGhcjsEnvConfig stackYaml (destDir </> $ (mkRelDir " bin" ))
11271130 menv <- liftIO $ configEnvOverride (view configL envConfig) defaultEnvSettings
11281131 -- Install cabal-install if missing, or if the installed one is old.
@@ -1175,7 +1178,7 @@ bootGhcjs ghcjsVersion stackYaml destDir = do
11751178 " This version is specified by the stack.yaml file included in the ghcjs tarball.\n "
11761179 _ -> return ()
11771180 $ logSticky " Booting GHCJS (this will take a long time) ..."
1178- logProcessStderrStdout Nothing " ghcjs-boot" menv' [ " --clean " ]
1181+ logProcessStderrStdout Nothing " ghcjs-boot" menv' bootOpts
11791182 $ logStickyDone " GHCJS booted."
11801183
11811184loadGhcjsEnvConfig :: StackM env m
0 commit comments