From f4ad7a477ac9ef9fd081b0dab53800075ee6d723 Mon Sep 17 00:00:00 2001 From: Vladislav Zavialov Date: Sun, 1 Oct 2023 12:57:30 +0300 Subject: [PATCH 1/4] Remove unused ALEX from Makefile --- Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile b/Makefile index 0956380b..d7f1ac23 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,6 @@ CABAL = cabal HAPPY_VER = `awk '/^version:/ { print $$2 }' happy.cabal` -ALEX = alex -ALEX_OPTS = -g - SDIST_DIR=dist-newstyle/sdist sdist :: From dba62a326f318de125e49626a8ff7c33046bd025 Mon Sep 17 00:00:00 2001 From: Vladislav Zavialov Date: Sun, 1 Oct 2023 12:58:20 +0300 Subject: [PATCH 2/4] make sdist: all packages --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d7f1ac23..b4040ace 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ sdist :: echo "Error: Tree is not clean"; \ exit 1; \ fi - $(CABAL) v2-sdist + $(CABAL) v2-sdist all @if [ ! -f "${SDIST_DIR}/happy-$(HAPPY_VER).tar.gz" ]; then \ echo "Error: source tarball not found: dist/happy-$(HAPPY_VER).tar.gz"; \ exit 1; \ From b88c9366a2ed316fa590b27d5bc7556fdada6cea Mon Sep 17 00:00:00 2001 From: Vladislav Zavialov Date: Sun, 1 Oct 2023 13:36:41 +0300 Subject: [PATCH 3/4] Add bootstrap script --- bootstrap.hs | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 bootstrap.hs diff --git a/bootstrap.hs b/bootstrap.hs new file mode 100644 index 00000000..15c3a30a --- /dev/null +++ b/bootstrap.hs @@ -0,0 +1,35 @@ +import Control.Monad +import Data.Foldable +import System.FilePath +import System.Directory +import System.Process +import System.Exit + +main :: IO () +main = do + let bootstrap_root = "./bootstrap-root" + happy_boot = bootstrap_root "happy" + callProcess "cabal" + [ "install", "happy", + "-f", "-bootstrap", + "--installdir=" ++ bootstrap_root ] + with_y_files "packages" $ \y_file -> do + putStrLn $ "Processing " ++ show y_file + callProcess happy_boot [y_file] + removeFile y_file + removePathForcibly bootstrap_root + +with_y_files :: FilePath -> (FilePath -> IO ()) -> IO () +with_y_files path cont = do + is_dir <- doesDirectoryExist path + if is_dir then do + entries <- listDirectory path + for_ entries $ \entry -> + with_y_files (path entry) cont + else do + is_file <- doesFileExist path + if is_file then do + let ext = takeExtension path + when (ext == ".y" || ext == ".ly") (cont path) + else do + die ("Neither file nor dir: " ++ show path) From bc4fb072b8808109137925f54df105327057fa7b Mon Sep 17 00:00:00 2001 From: Vladislav Zavialov Date: Sun, 1 Oct 2023 13:54:35 +0300 Subject: [PATCH 4/4] Bump version to 2.0 --- ChangeLog.md | 5 ++++- happy.cabal | 14 +++++++------- packages/backend-glr/happy-backend-glr.cabal | 8 ++++---- packages/backend-lalr/happy-backend-lalr.cabal | 8 ++++---- packages/codegen-common/happy-codegen-common.cabal | 2 +- packages/frontend/happy-frontend.cabal | 6 +++--- packages/grammar/happy-grammar.cabal | 2 +- packages/tabular/happy-tabular.cabal | 4 ++-- 8 files changed, 26 insertions(+), 23 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 30882a99..318ff4ce 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,6 @@ # Revision history for Happy -## Unreleased +## 2.0 The main focus of this release was modularizing Happy. @@ -12,6 +12,9 @@ The main focus of this release was modularizing Happy. - `happy-grammar` - `happy-tabular` +* Partially revert the new bootstrapping system of 1.21.0 to mitigate + build issues. + ## 1.21.0 The main focus of this release was revamping the build system and bootstrapping. diff --git a/happy.cabal b/happy.cabal index fac0dc7c..b49fbddc 100644 --- a/happy.cabal +++ b/happy.cabal @@ -1,5 +1,5 @@ name: happy -version: 1.21.0 +version: 2.0 license: BSD2 license-file: LICENSE copyright: (c) Andy Gill, Simon Marlow @@ -142,12 +142,12 @@ executable happy array, containers >= 0.4.2, mtl >= 2.2.1, - happy-codegen-common == 1.21.0, - happy-grammar == 1.21.0, - happy-tabular == 1.21.0, - happy-frontend == 1.21.0, - happy-backend-lalr == 1.21.0, - happy-backend-glr == 1.21.0 + happy-codegen-common == 2.0, + happy-grammar == 2.0, + happy-tabular == 2.0, + happy-frontend == 2.0, + happy-backend-lalr == 2.0, + happy-backend-glr == 2.0 default-language: Haskell98 default-extensions: CPP, MagicHash, FlexibleContexts, NamedFieldPuns diff --git a/packages/backend-glr/happy-backend-glr.cabal b/packages/backend-glr/happy-backend-glr.cabal index 9ee76d98..933abd67 100644 --- a/packages/backend-glr/happy-backend-glr.cabal +++ b/packages/backend-glr/happy-backend-glr.cabal @@ -1,5 +1,5 @@ name: happy-backend-glr -version: 1.21.0 +version: 2.0 license: BSD2 license-file: LICENSE copyright: (c) Andy Gill, Simon Marlow @@ -49,9 +49,9 @@ library Happy.Backend.GLR.ProduceCode build-depends: base < 5, array, - happy-codegen-common == 1.21.0, - happy-grammar == 1.21.0, - happy-tabular == 1.21.0 + happy-codegen-common == 2.0, + happy-grammar == 2.0, + happy-tabular == 2.0 default-language: Haskell98 default-extensions: CPP, MagicHash, FlexibleContexts diff --git a/packages/backend-lalr/happy-backend-lalr.cabal b/packages/backend-lalr/happy-backend-lalr.cabal index e1eee857..75afb1d2 100644 --- a/packages/backend-lalr/happy-backend-lalr.cabal +++ b/packages/backend-lalr/happy-backend-lalr.cabal @@ -1,5 +1,5 @@ name: happy-backend-lalr -version: 1.21.0 +version: 2.0 license: BSD2 license-file: LICENSE copyright: (c) Andy Gill, Simon Marlow @@ -49,9 +49,9 @@ library Happy.Backend.LALR.ProduceCode build-depends: base < 5, array, - happy-codegen-common == 1.21.0, - happy-grammar == 1.21.0, - happy-tabular == 1.21.0 + happy-codegen-common == 2.0, + happy-grammar == 2.0, + happy-tabular == 2.0 default-language: Haskell98 default-extensions: CPP, MagicHash, FlexibleContexts diff --git a/packages/codegen-common/happy-codegen-common.cabal b/packages/codegen-common/happy-codegen-common.cabal index 2efc392d..519e7bc3 100644 --- a/packages/codegen-common/happy-codegen-common.cabal +++ b/packages/codegen-common/happy-codegen-common.cabal @@ -1,5 +1,5 @@ name: happy-codegen-common -version: 1.21.0 +version: 2.0 license: BSD2 license-file: LICENSE copyright: (c) Andy Gill, Simon Marlow diff --git a/packages/frontend/happy-frontend.cabal b/packages/frontend/happy-frontend.cabal index 8a5149e2..04197ca4 100644 --- a/packages/frontend/happy-frontend.cabal +++ b/packages/frontend/happy-frontend.cabal @@ -1,5 +1,5 @@ name: happy-frontend -version: 1.21.0 +version: 2.0 license: BSD2 license-file: LICENSE copyright: (c) Andy Gill, Simon Marlow @@ -54,8 +54,8 @@ library containers >= 0.4.2, transformers >= 0.5.6.2, mtl >= 2.2.2, - happy-codegen-common == 1.21.0, - happy-grammar == 1.21.0 + happy-codegen-common == 2.0, + happy-grammar == 2.0 default-language: Haskell98 default-extensions: CPP, MagicHash, FlexibleContexts diff --git a/packages/grammar/happy-grammar.cabal b/packages/grammar/happy-grammar.cabal index f9f41229..7bad54bd 100644 --- a/packages/grammar/happy-grammar.cabal +++ b/packages/grammar/happy-grammar.cabal @@ -1,5 +1,5 @@ name: happy-grammar -version: 1.21.0 +version: 2.0 license: BSD2 license-file: LICENSE copyright: (c) Andy Gill, Simon Marlow diff --git a/packages/tabular/happy-tabular.cabal b/packages/tabular/happy-tabular.cabal index 0f572144..e68b4498 100644 --- a/packages/tabular/happy-tabular.cabal +++ b/packages/tabular/happy-tabular.cabal @@ -1,5 +1,5 @@ name: happy-tabular -version: 1.21.0 +version: 2.0 license: BSD2 license-file: LICENSE copyright: (c) Andy Gill, Simon Marlow @@ -47,7 +47,7 @@ library build-depends: base < 5, array, containers >= 0.4.2, - happy-grammar == 1.21.0 + happy-grammar == 2.0 default-language: Haskell98 default-extensions: CPP, MagicHash, FlexibleContexts, NamedFieldPuns