From 2b46ebfeab2123f4c47c715cab106bac0c36088e Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Sat, 1 Feb 2025 17:08:42 -0800 Subject: [PATCH 01/10] ogma-language-c: Specify tools needed using build-tool-depends. Refs #149. The Cabal packages in Ogma were written for an older version of Cabal. Currently, they only state a dependency on `BNFC` as part of a custom-setup section. However, this is sub-ideal because `alex` and `happy` are also needed, and Cabal fails to detect that requirement, and also fails to install `BNFC` and make it available before it tries to compile Ogma. This makes the installation instructions overly complicated (all three of those packages need to be installed by hand first), and makes Hackage report that Ogma as a whole cannot be built. This commit updates the Cabal package to specify the tools it needs using `build-tool-depends`. The notation is used by versions of Cabal from 3.0 to modern versions when using the standard `install` command, which ensures that the programs needed are installed before. When using `v1-install`, which is accepted by versions of Cabal as far as 2.4, the programs `alex`, `happy` and `bnfc` need to be installed prior to installing Ogma (like before). --- ogma-language-c/ogma-language-c.cabal | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ogma-language-c/ogma-language-c.cabal b/ogma-language-c/ogma-language-c.cabal index 9f2e46b..5d308f8 100644 --- a/ogma-language-c/ogma-language-c.cabal +++ b/ogma-language-c/ogma-language-c.cabal @@ -30,7 +30,6 @@ cabal-version: 2.0 build-type: Custom - name: ogma-language-c version: 1.6.0 homepage: https://github.com/nasa/ogma @@ -72,7 +71,6 @@ custom-setup base >= 4.11.0.0 && < 5 , Cabal >= 2.0 && < 3.15 , process >= 1.6 && < 1.7 - , BNFC >= 2.9.1 && < 2.10 library @@ -93,6 +91,11 @@ library base >= 4.11.0.0 && < 5 , array >= 0.5.2.0 && < 0.6 + build-tool-depends: + alex:alex >= 3 + , BNFC:bnfc >= 2.9.4 + , happy:happy >= 1.19 + hs-source-dirs: src From 24ddff3782b0f0197be7c97f89bc042dac4ca6df Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Sat, 1 Feb 2025 17:08:43 -0800 Subject: [PATCH 02/10] ogma-language-cocospec: Specify tools needed using build-tool-depends. Refs #149. The Cabal packages in Ogma were written for an older version of Cabal. Currently, they only state a dependency on `BNFC` as part of a custom-setup section. However, this is sub-ideal because `alex` and `happy` are also needed, and Cabal fails to detect that requirement, and also fails to install `BNFC` and make it available before it tries to compile Ogma. This makes the installation instructions overly complicated (all three of those packages need to be installed by hand first), and makes Hackage report that Ogma as a whole cannot be built. This commit updates the Cabal package to specify the tools it needs using `build-tool-depends`. The notation is used by versions of Cabal from 3.0 to modern versions when using the standard `install` command, which ensures that the programs needed are installed before. When using `v1-install`, which is accepted by versions of Cabal as far as 2.4, the programs `alex`, `happy` and `bnfc` need to be installed prior to installing Ogma (like before). --- ogma-language-cocospec/ogma-language-cocospec.cabal | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ogma-language-cocospec/ogma-language-cocospec.cabal b/ogma-language-cocospec/ogma-language-cocospec.cabal index c07b1d6..5f06900 100644 --- a/ogma-language-cocospec/ogma-language-cocospec.cabal +++ b/ogma-language-cocospec/ogma-language-cocospec.cabal @@ -30,7 +30,6 @@ cabal-version: 2.0 build-type: Custom - name: ogma-language-cocospec version: 1.6.0 homepage: https://github.com/nasa/ogma @@ -72,7 +71,6 @@ custom-setup base >= 4.11.0.0 && < 5 , Cabal >= 2.0 && < 3.15 , process >= 1.6 && < 1.7 - , BNFC >= 2.9.1 && < 2.10 library @@ -93,6 +91,11 @@ library base >= 4.11.0.0 && < 5 , array >= 0.5.2.0 && < 0.6 + build-tool-depends: + alex:alex >= 3 + , BNFC:bnfc >= 2.9.4 + , happy:happy >= 1.19 + hs-source-dirs: src From 28b62fc0bfd0955c616760484113c3a2620dca4b Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Sat, 1 Feb 2025 17:09:22 -0800 Subject: [PATCH 03/10] ogma-language-smv: Specify tools needed using build-tool-depends. Refs #149. The Cabal packages in Ogma were written for an older version of Cabal. Currently, they only state a dependency on `BNFC` as part of a custom-setup section. However, this is sub-ideal because `alex` and `happy` are also needed, and Cabal fails to detect that requirement, and also fails to install `BNFC` and make it available before it tries to compile Ogma. This makes the installation instructions overly complicated (all three of those packages need to be installed by hand first), and makes Hackage report that Ogma as a whole cannot be built. This commit updates the Cabal package to specify the tools it needs using `build-tool-depends`. The notation is used by versions of Cabal from 3.0 to modern versions when using the standard `install` command, which ensures that the programs needed are installed before. When using `v1-install`, which is accepted by versions of Cabal as far as 2.4, the programs `alex`, `happy` and `bnfc` need to be installed prior to installing Ogma (like before). --- ogma-language-smv/ogma-language-smv.cabal | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ogma-language-smv/ogma-language-smv.cabal b/ogma-language-smv/ogma-language-smv.cabal index a7d1b84..265927d 100644 --- a/ogma-language-smv/ogma-language-smv.cabal +++ b/ogma-language-smv/ogma-language-smv.cabal @@ -30,7 +30,6 @@ cabal-version: 2.0 build-type: Custom - name: ogma-language-smv version: 1.6.0 homepage: https://github.com/nasa/ogma @@ -72,7 +71,6 @@ custom-setup base >= 4.11.0.0 && < 5 , Cabal >= 2.0 && < 3.15 , process >= 1.6 && < 1.7 - , BNFC >= 2.9.1 && < 2.10 library @@ -94,6 +92,11 @@ library base >= 4.11.0.0 && < 5 , array >= 0.5.2.0 && < 0.6 + build-tool-depends: + alex:alex >= 3 + , BNFC:bnfc >= 2.9.4 + , happy:happy >= 1.19 + hs-source-dirs: src From 8889c923f139e47d5189e7552e218af47cc16666 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Sat, 1 Feb 2025 17:21:35 -0800 Subject: [PATCH 04/10] ogma-cli: Add cabal.project. Refs #149. The Cabal packages in Ogma were written for an older version of Cabal. Currently, they only state a dependency on BNFC as part of a custom-setup section. However, this is sub-ideal because alex and happy are also needed, and Cabal fails to detect that requirement, and also fails to install BNFC and make it available before it tries to compile Ogma. This makes the installation instructions overly complicated (all three of those packages need to be installed by hand first), and makes Hackage report that Ogma as a whole cannot be built. Prior commits have updated the Cabal files to use build-tool-depends to indicate which tools need to be available before compiling some packages. This commit adds a cabal.project file at the top-level so that newer versions of Cabal find all Ogma packages in the current directory, which is needed to be able to exploit that functionality. --- cabal.project | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 cabal.project diff --git a/cabal.project b/cabal.project new file mode 100644 index 0000000..6681b07 --- /dev/null +++ b/cabal.project @@ -0,0 +1,2 @@ +packages: + */ From 9e1f959302ffbc4bfc4057b10ac6583a3d2ff74d Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Sat, 1 Feb 2025 20:51:35 -0800 Subject: [PATCH 05/10] ogma-cli: Install bnfc in Github jobs. Refs #149. The Cabal packages in Ogma were written for an older version of Cabal. Currently, they only state a dependency on BNFC as part of a custom-setup section. However, this is sub-ideal because alex and happy are also needed, and Cabal fails to detect that requirement, and also fails to install BNFC and make it available before it tries to compile Ogma. This makes the installation instructions overly complicated (all three of those packages need to be installed by hand first), and makes Hackage report that Ogma as a whole cannot be built. Prior commits have updated the Cabal files to use build-tool-depends to indicate which tools need to be available before compiling some packages. With this change, in older versions of Cabal, it is now necessary to manually install bnfc before installing Ogma. --- .github/workflows/repo-ghc-8.6-cabal-2.4-ros.yml | 1 + .github/workflows/repo-ghc-8.6-cabal-2.4.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/repo-ghc-8.6-cabal-2.4-ros.yml b/.github/workflows/repo-ghc-8.6-cabal-2.4-ros.yml index 4b2a072..5c24420 100644 --- a/.github/workflows/repo-ghc-8.6-cabal-2.4-ros.yml +++ b/.github/workflows/repo-ghc-8.6-cabal-2.4-ros.yml @@ -40,6 +40,7 @@ jobs: - name: Install dependencies run: | cabal v1-install alex happy + cabal v1-install BNFC - name: Install ogma run: | diff --git a/.github/workflows/repo-ghc-8.6-cabal-2.4.yml b/.github/workflows/repo-ghc-8.6-cabal-2.4.yml index 71fade8..8757f9d 100644 --- a/.github/workflows/repo-ghc-8.6-cabal-2.4.yml +++ b/.github/workflows/repo-ghc-8.6-cabal-2.4.yml @@ -40,6 +40,7 @@ jobs: - name: Install dependencies run: | cabal v1-install alex happy + cabal v1-install BNFC - name: Install ogma run: | From ac68632e08866069fbe2f1f4e55cd3795a113019 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Sat, 1 Feb 2025 16:45:39 -0800 Subject: [PATCH 06/10] ogma-cli: Simplify installation instructions. Refs #149. The Cabal packages in Ogma were written for an older version of Cabal. Currently, they only state a dependency on BNFC as part of a custom-setup section. However, this is sub-ideal because alex and happy are also needed, and Cabal fails to detect that requirement, and also fails to install BNFC and make it available before it tries to compile Ogma. This makes the installation instructions overly complicated (all three of those packages need to be installed by hand first), and makes Hackage report that Ogma as a whole cannot be built. Prior commits have updated the Cabal files to use build-tool-depends to indicate which tools need to be available before compiling some packages. This commit updates the README with the new installation instructions. --- ogma-cli/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ogma-cli/README.md b/ogma-cli/README.md index 67b1b35..897fab8 100644 --- a/ogma-cli/README.md +++ b/ogma-cli/README.md @@ -83,15 +83,15 @@ Once GHC and cabal are installed, the simplest way to install Ogma is with: ```sh $ git clone https://github.com/nasa/ogma.git $ cd ogma -$ export PATH="$HOME/.cabal/bin/:$PATH" -$ cabal v1-update -$ cabal v1-install alex happy -$ cabal v1-install BNFC copilot -$ cabal v1-install ogma-*/ +$ export PATH="$HOME/.local/bin/:$PATH" +$ cabal update +$ cabal install --lib copilot copilot-c99 copilot-language copilot-theorem \ + copilot-libraries copilot-interpreter +$ cabal install ogma-cli:ogma ``` After that, the `ogma` executable will be placed in the directory -`$HOME/.cabal/bin/`, where `$HOME` represents your user's home directory. +`$HOME/.local/bin/`, where `$HOME` represents your user's home directory. # Usage [(Back to top)](#table-of-contents) From 76c70c0e0a7eaee2078df8cf4f8b7851d996efa4 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Sat, 1 Feb 2025 20:15:11 -0800 Subject: [PATCH 07/10] ogma-language-c: Document changes in CHANGELOG. Refs #149. --- ogma-language-c/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ogma-language-c/CHANGELOG.md b/ogma-language-c/CHANGELOG.md index 69481d7..9a8e642 100644 --- a/ogma-language-c/CHANGELOG.md +++ b/ogma-language-c/CHANGELOG.md @@ -3,6 +3,7 @@ ## [1.X.Y] - 2025-02-01 * Bump upper version constraint on Cabal (#213). * Remove extraneous EOL character (#224). +* Specify tools needed using build-tool-depends (#149). ## [1.6.0] - 2025-01-21 From f8ffed42d934e57cf8d33e5e98e47943e088330b Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Sat, 1 Feb 2025 20:15:24 -0800 Subject: [PATCH 08/10] ogma-language-cocospec: Document changes in CHANGELOG. Refs #149. --- ogma-language-cocospec/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ogma-language-cocospec/CHANGELOG.md b/ogma-language-cocospec/CHANGELOG.md index 7ccb279..1087dd9 100644 --- a/ogma-language-cocospec/CHANGELOG.md +++ b/ogma-language-cocospec/CHANGELOG.md @@ -5,6 +5,7 @@ * Remove references to old design of Ogma from documentation (#220). * Bump upper version constraint on Cabal (#213). * Remove extraneous EOL character (#224). +* Specify tools needed using build-tool-depends (#149). ## [1.6.0] - 2025-01-21 From d067ec42a7306c2317692c050e7ea38bccaa319a Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Sat, 1 Feb 2025 20:15:32 -0800 Subject: [PATCH 09/10] ogma-language-smv: Document changes in CHANGELOG. Refs #149. --- ogma-language-smv/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ogma-language-smv/CHANGELOG.md b/ogma-language-smv/CHANGELOG.md index d636936..9b206d3 100644 --- a/ogma-language-smv/CHANGELOG.md +++ b/ogma-language-smv/CHANGELOG.md @@ -5,6 +5,7 @@ * Remove references to old design of Ogma from documentation (#220). * Bump upper version constraint on Cabal (#213). * Remove extraneous EOL character (#224). +* Specify tools needed using build-tool-depends (#149). ## [1.6.0] - 2025-01-21 From ede7dda442a413c111be10d4427cf7a4c4a050ea Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Sat, 1 Feb 2025 20:15:38 -0800 Subject: [PATCH 10/10] ogma-cli: Document changes in CHANGELOG. Refs #149. --- ogma-cli/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ogma-cli/CHANGELOG.md b/ogma-cli/CHANGELOG.md index 8985189..6a76cbb 100644 --- a/ogma-cli/CHANGELOG.md +++ b/ogma-cli/CHANGELOG.md @@ -4,6 +4,7 @@ * Add all auxiliary test files to distributable Cabal package (#216). * Remove extraneous EOL character (#224). +* Update installation instructions to use cabal install (#149). ## [1.6.0] - 2025-01-21