diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 51887fc0..77e9d2bc 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -86,10 +86,9 @@ jobs: - name: setup-wasm-deps run: | . ./.envrc - . utils/pkgdb.sh ahc-cabal v1-update pushd ghc-toolkit/boot-libs - ahc-cabal v1-install --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global -j2 \ + ahc-cabal v1-install -j2 \ wai-middleware-caching popd @@ -212,9 +211,8 @@ jobs: .github/workflows/boot.sh . ./.envrc - . utils/pkgdb.sh cd ghc-toolkit/boot-libs - ahc-cabal v1-install --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global --ghc-option=-j2 \ + ahc-cabal v1-install --ghc-option=-j2 \ Cabal - name: profile @@ -322,12 +320,11 @@ jobs: - name: test-cabal run: | . ./.envrc - . utils/pkgdb.sh ahc-cabal v1-update ln -s ghc-toolkit/boot-libs/cabal.config cabal.config - ahc-cabal v1-install --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global --ghc-option=-j2 \ + ahc-cabal v1-install --ghc-option=-j2 \ Cabal - ahc-cabal v1-install --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global -j2 \ + ahc-cabal v1-install -j2 \ diagrams \ servant \ singletons diff --git a/asterius/app/ahc-cabal.hs b/asterius/app/ahc-cabal.hs index b1afdd74..eb35f989 100644 --- a/asterius/app/ahc-cabal.hs +++ b/asterius/app/ahc-cabal.hs @@ -16,7 +16,9 @@ main = do readFile =<< Paths_asterius.getDataFileName ("cabal" "config") writeFile ahc_cabal_config_path $ - "program-locations\n ar-location: " + "install-dirs global\n prefix: " + <> (dataDir ".boot" "asterius_lib") + <> "\nprogram-locations\n ar-location: " <> ahcAr <> "\n ghc-location: " <> ahc @@ -25,9 +27,9 @@ main = do <> "\n" <> ahc_cabal_config env <- getEnvironment - traverse_ unsetEnv - $ filter (\k -> ("GHC_" `isPrefixOf` k) || "HASKELL_" `isPrefixOf` k) - $ map fst env + traverse_ unsetEnv $ + filter (\k -> ("GHC_" `isPrefixOf` k) || "HASKELL_" `isPrefixOf` k) $ + map fst env unsetEnv "CABAL_CONFIG" setEnv "CABAL_DIR" ahc_cabal_root True args <- getArgs diff --git a/asterius/boot.sh b/asterius/boot.sh index 66fae51f..175da97f 100755 --- a/asterius/boot.sh +++ b/asterius/boot.sh @@ -4,38 +4,38 @@ cp -r $ASTERIUS_BOOT_LIBS_DIR . cd boot-libs cd ghc-prim -$ASTERIUS_SETUP_GHC_PRIM configure --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global --builddir=$ASTERIUS_TMP_DIR/dist/ghc-prim --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR $ASTERIUS_CONFIGURE_OPTIONS +$ASTERIUS_SETUP_GHC_PRIM configure --prefix=$ASTERIUS_LIB_DIR --global --builddir=$ASTERIUS_TMP_DIR/dist/ghc-prim --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR $ASTERIUS_CONFIGURE_OPTIONS $ASTERIUS_SETUP_GHC_PRIM build -j --builddir=$ASTERIUS_TMP_DIR/dist/ghc-prim $ASTERIUS_SETUP_GHC_PRIM install --builddir=$ASTERIUS_TMP_DIR/dist/ghc-prim cd .. cd integer-simple -ahc-cabal act-as-setup --build-type=Simple -- configure --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global --builddir=$ASTERIUS_TMP_DIR/dist/integer-simple --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR $ASTERIUS_CONFIGURE_OPTIONS +ahc-cabal act-as-setup --build-type=Simple -- configure --prefix=$ASTERIUS_LIB_DIR --global --builddir=$ASTERIUS_TMP_DIR/dist/integer-simple --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR $ASTERIUS_CONFIGURE_OPTIONS ahc-cabal act-as-setup --build-type=Simple -- build -j --builddir=$ASTERIUS_TMP_DIR/dist/integer-simple ahc-cabal act-as-setup --build-type=Simple -- install --builddir=$ASTERIUS_TMP_DIR/dist/integer-simple cd .. cd base autoreconf -i -ahc-cabal act-as-setup --build-type=Configure -- configure --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global --builddir=$ASTERIUS_TMP_DIR/dist/base --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR -finteger-simple $ASTERIUS_CONFIGURE_OPTIONS +ahc-cabal act-as-setup --build-type=Configure -- configure --prefix=$ASTERIUS_LIB_DIR --global --builddir=$ASTERIUS_TMP_DIR/dist/base --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR -finteger-simple $ASTERIUS_CONFIGURE_OPTIONS ahc-cabal act-as-setup --build-type=Configure -- build -j --builddir=$ASTERIUS_TMP_DIR/dist/base ahc-cabal act-as-setup --build-type=Configure -- install --builddir=$ASTERIUS_TMP_DIR/dist/base cd .. cd ghc-heap -ahc-cabal act-as-setup --build-type=Simple -- configure --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global --builddir=$ASTERIUS_TMP_DIR/dist/ghc-heap --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR $ASTERIUS_CONFIGURE_OPTIONS +ahc-cabal act-as-setup --build-type=Simple -- configure --prefix=$ASTERIUS_LIB_DIR --global --builddir=$ASTERIUS_TMP_DIR/dist/ghc-heap --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR $ASTERIUS_CONFIGURE_OPTIONS ahc-cabal act-as-setup --build-type=Simple -- build -j --builddir=$ASTERIUS_TMP_DIR/dist/ghc-heap ahc-cabal act-as-setup --build-type=Simple -- install --builddir=$ASTERIUS_TMP_DIR/dist/ghc-heap cd .. cd ghc-boot-th -ahc-cabal act-as-setup --build-type=Simple -- configure --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global --builddir=$ASTERIUS_TMP_DIR/dist/ghc-boot-th --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR $ASTERIUS_CONFIGURE_OPTIONS +ahc-cabal act-as-setup --build-type=Simple -- configure --prefix=$ASTERIUS_LIB_DIR --global --builddir=$ASTERIUS_TMP_DIR/dist/ghc-boot-th --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR $ASTERIUS_CONFIGURE_OPTIONS ahc-cabal act-as-setup --build-type=Simple -- build -j --builddir=$ASTERIUS_TMP_DIR/dist/ghc-boot-th ahc-cabal act-as-setup --build-type=Simple -- install --builddir=$ASTERIUS_TMP_DIR/dist/ghc-boot-th cd .. ahc-cabal v1-update || true -ahc-cabal v1-install --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global $ASTERIUS_CONFIGURE_OPTIONS \ +ahc-cabal v1-install $ASTERIUS_CONFIGURE_OPTIONS \ binary \ directory \ mtl \ @@ -43,35 +43,35 @@ ahc-cabal v1-install --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db= unix cd ghc-boot -ahc-cabal act-as-setup --build-type=Simple -- configure --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global --builddir=$ASTERIUS_TMP_DIR/dist/ghc-boot --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR $ASTERIUS_CONFIGURE_OPTIONS +ahc-cabal act-as-setup --build-type=Simple -- configure --prefix=$ASTERIUS_LIB_DIR --global --builddir=$ASTERIUS_TMP_DIR/dist/ghc-boot --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR $ASTERIUS_CONFIGURE_OPTIONS ahc-cabal act-as-setup --build-type=Simple -- build -j --builddir=$ASTERIUS_TMP_DIR/dist/ghc-boot ahc-cabal act-as-setup --build-type=Simple -- install --builddir=$ASTERIUS_TMP_DIR/dist/ghc-boot cd .. cd template-haskell -ahc-cabal act-as-setup --build-type=Simple -- configure --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global --builddir=$ASTERIUS_TMP_DIR/dist/template-haskell --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR $ASTERIUS_CONFIGURE_OPTIONS +ahc-cabal act-as-setup --build-type=Simple -- configure --prefix=$ASTERIUS_LIB_DIR --global --builddir=$ASTERIUS_TMP_DIR/dist/template-haskell --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR $ASTERIUS_CONFIGURE_OPTIONS ahc-cabal act-as-setup --build-type=Simple -- build -j --builddir=$ASTERIUS_TMP_DIR/dist/template-haskell ahc-cabal act-as-setup --build-type=Simple -- install --builddir=$ASTERIUS_TMP_DIR/dist/template-haskell cd .. cd ghci -ahc-cabal act-as-setup --build-type=Simple -- configure --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global --builddir=$ASTERIUS_TMP_DIR/dist/ghci --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR -fghci $ASTERIUS_CONFIGURE_OPTIONS +ahc-cabal act-as-setup --build-type=Simple -- configure --prefix=$ASTERIUS_LIB_DIR --global --builddir=$ASTERIUS_TMP_DIR/dist/ghci --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR -fghci $ASTERIUS_CONFIGURE_OPTIONS ahc-cabal act-as-setup --build-type=Simple -- build -j --builddir=$ASTERIUS_TMP_DIR/dist/ghci ahc-cabal act-as-setup --build-type=Simple -- install --builddir=$ASTERIUS_TMP_DIR/dist/ghci cd .. cd text -ahc-cabal act-as-setup --build-type=Simple -- configure --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global --builddir=$ASTERIUS_TMP_DIR/dist/text --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR $ASTERIUS_CONFIGURE_OPTIONS +ahc-cabal act-as-setup --build-type=Simple -- configure --prefix=$ASTERIUS_LIB_DIR --global --builddir=$ASTERIUS_TMP_DIR/dist/text --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR $ASTERIUS_CONFIGURE_OPTIONS ahc-cabal act-as-setup --build-type=Simple -- build -j --builddir=$ASTERIUS_TMP_DIR/dist/text ahc-cabal act-as-setup --build-type=Simple -- install --builddir=$ASTERIUS_TMP_DIR/dist/text cd .. -ahc-cabal v1-install --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global $ASTERIUS_CONFIGURE_OPTIONS \ +ahc-cabal v1-install $ASTERIUS_CONFIGURE_OPTIONS \ aeson \ parsec cd asterius-prelude -ahc-cabal act-as-setup --build-type=Simple -- configure --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global --builddir=$ASTERIUS_TMP_DIR/dist/asterius-prelude --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR $ASTERIUS_CONFIGURE_OPTIONS +ahc-cabal act-as-setup --build-type=Simple -- configure --prefix=$ASTERIUS_LIB_DIR --global --builddir=$ASTERIUS_TMP_DIR/dist/asterius-prelude --with-ghc=$ASTERIUS_AHC --with-ghc-pkg=$ASTERIUS_AHCPKG --with-ar=$ASTERIUS_AR $ASTERIUS_CONFIGURE_OPTIONS ahc-cabal act-as-setup --build-type=Simple -- build -j --builddir=$ASTERIUS_TMP_DIR/dist/asterius-prelude ahc-cabal act-as-setup --build-type=Simple -- install --builddir=$ASTERIUS_TMP_DIR/dist/asterius-prelude cd .. diff --git a/asterius/cabal/config b/asterius/cabal/config index 27b1c85d..96fe4b4f 100644 --- a/asterius/cabal/config +++ b/asterius/cabal/config @@ -24,6 +24,7 @@ split-sections: False split-objs: False executable-stripping: False library-stripping: False +user-install: False tests: False coverage: False benchmarks: False diff --git a/base.Dockerfile b/base.Dockerfile index 6b2835a4..89922aa5 100644 --- a/base.Dockerfile +++ b/base.Dockerfile @@ -3,7 +3,6 @@ FROM debian:sid ARG DEBIAN_FRONTEND=noninteractive ENV \ - ASTERIUS_LIB_DIR=/root/.asterius-local-install-root/share/x86_64-linux-ghc-8.8.4/asterius-0.0.1/.boot/asterius_lib \ LANG=C.UTF-8 \ LC_ALL=C.UTF-8 \ LC_CTYPE=C.UTF-8 \ diff --git a/lts-profile.sh b/lts-profile.sh index d1577132..b493372e 100755 --- a/lts-profile.sh +++ b/lts-profile.sh @@ -1,4 +1,4 @@ #!/bin/sh -e -ahc-cabal v1-install -j$jobs --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global --ghc-option=-j$jobs \ +ahc-cabal v1-install -j$jobs --ghc-option=-j$jobs \ Cabal diff --git a/lts.sh b/lts.sh index 5e0f136e..82ad2b16 100755 --- a/lts.sh +++ b/lts.sh @@ -2,13 +2,13 @@ set -eu -ahc-cabal v1-install --ghc-option=-j$jobs --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global \ +ahc-cabal v1-install --ghc-option=-j$jobs \ Cabal export ASTERIUS_TH_IGNORE=1 -ahc-cabal v1-install -j$jobs --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global --keep-going \ +ahc-cabal v1-install -j$jobs --keep-going \ $(cat pkgs.txt) || true unset ASTERIUS_TH_IGNORE -ahc-cabal v1-install -j$jobs_th --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global --keep-going \ +ahc-cabal v1-install -j$jobs_th --keep-going \ $(cat pkgs.txt) || true diff --git a/stackage.Dockerfile b/stackage.Dockerfile index 8c40f6a9..7113674f 100644 --- a/stackage.Dockerfile +++ b/stackage.Dockerfile @@ -17,7 +17,6 @@ RUN \ RUN \ rm -rf \ - $ASTERIUS_LIB_DIR/bin \ /root/.ahc-cabal \ /tmp/* \ /var/tmp/* diff --git a/utils/pkgdb.sh b/utils/pkgdb.sh deleted file mode 100644 index dd3861d6..00000000 --- a/utils/pkgdb.sh +++ /dev/null @@ -1,2 +0,0 @@ -export ASTERIUS_LIB_DIR=$(stack path --local-install-root)/share/x86_64-linux-ghc-8.8.4/asterius-0.0.1/.boot/asterius_lib -alias ahc-install="ahc-cabal v1-install --prefix=$ASTERIUS_LIB_DIR --package-db=clear --package-db=global" diff --git a/utils/readme.md b/utils/readme.md index d1cef7b8..ade050e7 100644 --- a/utils/readme.md +++ b/utils/readme.md @@ -13,9 +13,6 @@ These scripts are meant to be called at the project root directory. script to add the source of an executable/test target when needed. This doesn't require a previous boot, but does require a `stack build` of `asterius`, even if it fails midway. -* `utils/pkgdb.sh`: Source it under the current shell. It sets up the - `ahc-install` alias which can install packages into the global package - database, so that later the package can be used by `ahc-link` directly. * `utils/reboot.sh`: Do the cleanup, rebuild and reboot, using all CPU cores. If you touch the source of boot libs in `ghc-toolkit/` or modify the IR/codegen of `asterius`, the boot cache may be out-of-sync so you need to run this diff --git a/utils/test-pkgs.hs b/utils/test-pkgs.hs index 84819c39..7363e634 100644 --- a/utils/test-pkgs.hs +++ b/utils/test-pkgs.hs @@ -45,8 +45,6 @@ testPkg pkg = do [ "v1-install", "--dry-run", "--minimize-conflict-set", - "--package-db=clear", - "--package-db=global", pkg ] ""