diff --git a/app/Spago.hs b/app/Spago.hs index e23aff753..ad48fac4a 100644 --- a/app/Spago.hs +++ b/app/Spago.hs @@ -163,7 +163,8 @@ parser = do packageName = CLI.arg (Just . PackageName) "package" "Specify a package name. You can list them with `list-packages`" packageNames = many $ CLI.arg (Just . PackageName) "package" "Package name to add as dependency" pursArgs = many $ CLI.opt (Just . ExtraArg) "purs-args" 'u' "Argument to pass to purs" - useSharedOutput = bool ShareOutput NoShareOutput <$> CLI.switch "no-share-output" 'S' "Disabled using a shared output folder in location of root packages.dhall" + -- See https://github.com/spacchetti/spago/pull/526 for why this flag is disabled + useSharedOutput = bool NoShareOutput NoShareOutput <$> CLI.switch "no-share-output" 'S' "DEPRECATED: Disabled using a shared output folder in location of root packages.dhall" buildOptions = BuildOptions <$> cacheFlag <*> watch <*> clearScreen <*> sourcePaths <*> noInstall <*> pursArgs <*> depsOnly <*> useSharedOutput -- Note: by default we limit concurrency to 20 diff --git a/src/Spago/Build.hs b/src/Spago/Build.hs index 93dfc2d1f..de5b8786f 100644 --- a/src/Spago/Build.hs +++ b/src/Spago/Build.hs @@ -95,7 +95,7 @@ build buildOpts@BuildOptions{..} maybePostBuild = do NoInstall -> pure () sharedOutputArgs <- case shareOutput of ShareOutput -> getBuildArgsForSharedFolder buildOpts - NoShareOutput -> pure [] + NoShareOutput -> pure pursArgs let allPsGlobs = Packages.getGlobs deps depsOnly configSourcePaths <> sourcePaths allJsGlobs = Packages.getJsGlobs deps depsOnly configSourcePaths <> sourcePaths diff --git a/test/SpagoSpec.hs b/test/SpagoSpec.hs index 050349b5a..4cc46e542 100644 --- a/test/SpagoSpec.hs +++ b/test/SpagoSpec.hs @@ -340,7 +340,7 @@ spec = around_ setup $ do rm "packages.dhall" writeTextFile "packages.dhall" $ "../../packages.dhall" spago ["build"] >>= shouldBeSuccess - testdir "output" `shouldReturn` False + testdir "output" `shouldReturn` True cd ".." testdir "output" `shouldReturn` True @@ -380,11 +380,11 @@ spec = around_ setup $ do spago ["build"] >>= shouldBeSuccess -- don't use nested folder - testdir "output" `shouldReturn` False + testdir "output" `shouldReturn` True -- use middle one cd ".." - testdir "output" `shouldReturn` True + testdir "output" `shouldReturn` False -- not the trick root folder cd ".." @@ -407,10 +407,10 @@ spec = around_ setup $ do rm "spago.dhall" writeTextFile "spago.dhall" $ "{ name = \"lib-1\", license = \"MIT\", repository = \"https://github.com/fake/lib-1.git\", dependencies = [\"console\", \"effect\", \"prelude\"], sources = [\"src/**/*.purs\"], packages = ./packages.dhall }" spago ["build"] >>= shouldBeSuccess - testdir "output" `shouldReturn` False + testdir "output" `shouldReturn` True cd ".." - testdir "output" `shouldReturn` True + testdir "output" `shouldReturn` False describe "alternate backend" $ do @@ -474,10 +474,10 @@ spec = around_ setup $ do rm "packages.dhall" writeTextFile "packages.dhall" $ "../packages.dhall" spago ["test"] >>= shouldBeSuccess - testdir "output" `shouldReturn` False + testdir "output" `shouldReturn` True cd ".." - testdir "output" `shouldReturn` True + testdir "output" `shouldReturn` False it "Spago should test successfully with --no-share-output" $ do @@ -609,7 +609,7 @@ spec = around_ setup $ do spago ["init"] >>= shouldBeSuccess rm "packages.dhall" writeTextFile "packages.dhall" $ "../packages.dhall" - spago ["path", "output"] >>= outputShouldEqual "./../output\n" + spago ["path", "output"] >>= outputShouldEqual "output\n" pure () it "Spago should output the local path when no overrides" $ do diff --git a/test/fixtures/run-no-psa-stderr.txt b/test/fixtures/run-no-psa-stderr.txt index 50443ddcc..adf397f95 100644 --- a/test/fixtures/run-no-psa-stderr.txt +++ b/test/fixtures/run-no-psa-stderr.txt @@ -9,9 +9,8 @@ Running `getGlobalCacheDir` [debug] Running `fetchPackages` [debug] Checking if `purs` is up to date [info] Installation complete. -[debug] Locating root path of packages.dhall [debug] Compiling with "purs" -[debug] Running command: `purs compile --output ./output ".spago/console/v4.2.0/src/**/*.purs" ".spago/effect/v2.0.1/src/**/*.purs" ".spago/prelude/v4.1.1/src/**/*.purs" ".spago/psci-support/v4.0.0/src/**/*.purs" "src/**/*.purs" "test/**/*.purs"` +[debug] Running command: `purs compile ".spago/console/v4.2.0/src/**/*.purs" ".spago/effect/v2.0.1/src/**/*.purs" ".spago/prelude/v4.1.1/src/**/*.purs" ".spago/psci-support/v4.0.0/src/**/*.purs" "src/**/*.purs" "test/**/*.purs"` [info] Build succeeded. [debug] Locating root path of packages.dhall [debug] Writing .spago/run.js diff --git a/test/fixtures/run-psa-not-installed-stderr.txt b/test/fixtures/run-psa-not-installed-stderr.txt index b53233d04..761678dbe 100644 --- a/test/fixtures/run-psa-not-installed-stderr.txt +++ b/test/fixtures/run-psa-not-installed-stderr.txt @@ -9,10 +9,9 @@ Running `getGlobalCacheDir` [debug] Running `fetchPackages` [debug] Checking if `purs` is up to date [info] Installation complete. -[debug] Locating root path of packages.dhall [debug] Failed to run 'psa --version' [debug] Compiling with "purs" -[debug] Running command: `purs compile --output ./output ".spago/console/v4.2.0/src/**/*.purs" ".spago/effect/v2.0.1/src/**/*.purs" ".spago/prelude/v4.1.1/src/**/*.purs" ".spago/psci-support/v4.0.0/src/**/*.purs" "src/**/*.purs" "test/**/*.purs"` +[debug] Running command: `purs compile ".spago/console/v4.2.0/src/**/*.purs" ".spago/effect/v2.0.1/src/**/*.purs" ".spago/prelude/v4.1.1/src/**/*.purs" ".spago/psci-support/v4.0.0/src/**/*.purs" "src/**/*.purs" "test/**/*.purs"` [info] Build succeeded. [debug] Locating root path of packages.dhall [debug] Writing .spago/run.js diff --git a/test/fixtures/run-stderr.txt b/test/fixtures/run-stderr.txt index 8674f6cd6..21cb035f0 100644 --- a/test/fixtures/run-stderr.txt +++ b/test/fixtures/run-stderr.txt @@ -9,9 +9,8 @@ Running `getGlobalCacheDir` [debug] Running `fetchPackages` [debug] Checking if `purs` is up to date [info] Installation complete. -[debug] Locating root path of packages.dhall [debug] Compiling with "psa" -[debug] Running command: `psa compile --output ./output ".spago/console/v4.2.0/src/**/*.purs" ".spago/effect/v2.0.1/src/**/*.purs" ".spago/prelude/v4.1.1/src/**/*.purs" ".spago/psci-support/v4.0.0/src/**/*.purs" "src/**/*.purs" "test/**/*.purs"` +[debug] Running command: `psa compile ".spago/console/v4.2.0/src/**/*.purs" ".spago/effect/v2.0.1/src/**/*.purs" ".spago/prelude/v4.1.1/src/**/*.purs" ".spago/psci-support/v4.0.0/src/**/*.purs" "src/**/*.purs" "test/**/*.purs"` Src Lib All Warnings 0 0 0 Errors 0 0 0