From bb5aee08941d8e7e91524bc8b3c4ec0670de7212 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 4 Dec 2023 09:56:21 -0600 Subject: [PATCH 1/4] Use multiple top-level values for BuildInfo.purs --- src/Spago/BuildInfo.purs | 19 ++++++++++++------- test/Spago/Build/BuildInfo.purs | 6 +++--- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/Spago/BuildInfo.purs b/src/Spago/BuildInfo.purs index c8b5d013b..9cc0c0320 100644 --- a/src/Spago/BuildInfo.purs +++ b/src/Spago/BuildInfo.purs @@ -54,15 +54,20 @@ writeBuildInfo = do -- TODO: use tidy-codegen eventually mkBuildInfo :: BuildInfo -> String mkBuildInfo { packages, pursVersion } = String.joinWith "\n" - [ "-- @inline export buildInfo always" + [ "-- @inline export packages always" + , "-- @inline export pursVersion always" + , "-- @inline export spagoVersion always" , "module Spago.Generated.BuildInfo where" , "" - , "buildInfo :: { packages :: " <> recordType <> ", pursVersion :: String, spagoVersion :: String }" - , "buildInfo =" - , " { packages: {" <> String.joinWith ", " (map renderPackage packages) <> "}" - , " , pursVersion: \"" <> pursVersion <> "\"" - , " , spagoVersion: \"" <> currentSpagoVersion <> "\"" - , " }" + , "packages :: " <> recordType + , "packages = " + , " { " <> String.joinWith "\n , " (map renderPackage packages) <> "\n }" + , "" + , "pursVersion :: String" + , "pursVersion = \"" <> pursVersion <> "\"" + , "" + , "spagoVersion :: String" + , "spagoVersion = \"" <> currentSpagoVersion <> "\"" , "" ] where diff --git a/test/Spago/Build/BuildInfo.purs b/test/Spago/Build/BuildInfo.purs index db55f52c9..2ef087081 100644 --- a/test/Spago/Build/BuildInfo.purs +++ b/test/Spago/Build/BuildInfo.purs @@ -45,12 +45,12 @@ spec = , "" , "main :: Effect Unit" , "main = do" - , " Console.log $ \"pursVersion: \" <> BI.buildInfo.pursVersion" - , " Console.log $ \"spagoVersion: \" <> BI.buildInfo.spagoVersion" + , " Console.log $ \"pursVersion: \" <> BI.pursVersion" + , " Console.log $ \"spagoVersion: \" <> BI.spagoVersion" ] <> -- ensure all packages within the workspace are reference-able ( packages <#> \packageName -> - " Console.log $ \"" <> packageName <> ": \" <> BI.buildInfo.packages." <> packageName + " Console.log $ \"" <> packageName <> ": \" <> BI.packages." <> packageName ) Spec.describe "using generated 'BuildInfo.purs' file in single-package context" do From 41b8079f62c0277ba4c4f898d128b7f5fb0034ac Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 4 Dec 2023 10:05:20 -0600 Subject: [PATCH 2/4] Update usage of build info --- bin/src/Main.purs | 2 +- src/Spago/BuildInfo.purs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/src/Main.purs b/bin/src/Main.purs index bd3f9e1c3..12b73c7eb 100644 --- a/bin/src/Main.purs +++ b/bin/src/Main.purs @@ -500,7 +500,7 @@ main = do printVersion = do logOptions <- mkLogOptions startingTime { noColor: false, quiet: false, verbose: false, offline: Offline } runSpago { logOptions } do - logInfo BuildInfo.buildInfo.spagoVersion + logInfo BuildInfo.spagoVersion parseArgs >>= \c -> Aff.launchAff_ case c of Cmd'SpagoCmd (SpagoCmd globalArgs@{ offline } command) -> do diff --git a/src/Spago/BuildInfo.purs b/src/Spago/BuildInfo.purs index 9cc0c0320..d4719567c 100644 --- a/src/Spago/BuildInfo.purs +++ b/src/Spago/BuildInfo.purs @@ -79,7 +79,7 @@ buildInfoPath ∷ FilePath buildInfoPath = Path.concat [ Paths.localCachePath, "BuildInfo.purs" ] currentSpagoVersion :: String -currentSpagoVersion = BuildInfo.buildInfo.packages."spago-bin" +currentSpagoVersion = BuildInfo.packages."spago-bin" mkPackageBuildInfo :: WorkspacePackage -> { name :: String, version :: String } mkPackageBuildInfo { package } = From db5765b925462ecd9445a1163466acde8e8d4a3a Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 4 Dec 2023 10:24:38 -0600 Subject: [PATCH 3/4] Revert "Update usage of build info" This reverts commit 41b8079f62c0277ba4c4f898d128b7f5fb0034ac. --- bin/src/Main.purs | 2 +- src/Spago/BuildInfo.purs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/src/Main.purs b/bin/src/Main.purs index 12b73c7eb..bd3f9e1c3 100644 --- a/bin/src/Main.purs +++ b/bin/src/Main.purs @@ -500,7 +500,7 @@ main = do printVersion = do logOptions <- mkLogOptions startingTime { noColor: false, quiet: false, verbose: false, offline: Offline } runSpago { logOptions } do - logInfo BuildInfo.spagoVersion + logInfo BuildInfo.buildInfo.spagoVersion parseArgs >>= \c -> Aff.launchAff_ case c of Cmd'SpagoCmd (SpagoCmd globalArgs@{ offline } command) -> do diff --git a/src/Spago/BuildInfo.purs b/src/Spago/BuildInfo.purs index d4719567c..9cc0c0320 100644 --- a/src/Spago/BuildInfo.purs +++ b/src/Spago/BuildInfo.purs @@ -79,7 +79,7 @@ buildInfoPath ∷ FilePath buildInfoPath = Path.concat [ Paths.localCachePath, "BuildInfo.purs" ] currentSpagoVersion :: String -currentSpagoVersion = BuildInfo.packages."spago-bin" +currentSpagoVersion = BuildInfo.buildInfo.packages."spago-bin" mkPackageBuildInfo :: WorkspacePackage -> { name :: String, version :: String } mkPackageBuildInfo { package } = From 4111ae0e4cac79d68ee1026f404790aa348ba191 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 4 Dec 2023 10:24:54 -0600 Subject: [PATCH 4/4] Temporarily disable bootstrap steps --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 137dabf73..6c4a39338 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,14 +72,14 @@ jobs: - name: Build the project run: spago build - - name: Bootstrap executable - run: node ./bin/index.dev.js bundle -p spago-bin + # - name: Bootstrap executable + # run: node ./bin/index.dev.js bundle -p spago-bin - - name: Bundle docs-search client - run: node ./bin/bundle.js bundle -p docs-search-client-halogen + # - name: Bundle docs-search client + # run: node ./bin/bundle.js bundle -p docs-search-client-halogen - - name: Run tests - run: node ./bin/bundle.js test + # - name: Run tests + # run: node ./bin/bundle.js test - name: Check formatting (Linux only) if: matrix.os == 'ubuntu-latest'