From 4170477146342baf8b0222b281b7f0f991f03c97 Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Sun, 23 Jun 2024 15:07:24 -0700 Subject: [PATCH] test on OCaml 5.2, improve nix flake (#245) * test on OCaml 5.2, improve nix flake * disable gen_static for OCaml 5.2 the Pexp_fun ast changed --- .github/workflows/test.yml | 6 +++--- flake.nix | 9 +++++---- hpack/util/dune | 10 ++++++++-- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 500a60ab..a911075a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,12 +9,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ocamlVersion: [4_14, 5_0, 5_1] + ocamlVersion: [4_14, 5_1, 5_2] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - - uses: cachix/install-nix-action@v20 + - uses: cachix/install-nix-action@v27 with: extra_nix_config: | extra-substituters = https://anmonteiro.nix-cache.workers.dev diff --git a/flake.nix b/flake.nix index 0acc7e76..d6bad692 100644 --- a/flake.nix +++ b/flake.nix @@ -12,13 +12,14 @@ pkgs = nixpkgs.legacyPackages."${system}".extend (self: super: { ocamlPackages = super.ocaml-ng.ocamlPackages_5_2; }); - in - rec { packages = pkgs.callPackage ./nix { nix-filter = nix-filter.lib; }; + in + { + packages = packages // { default = packages.h2; }; defaultPackage = packages.h2; - devShells = rec { + devShells = { default = pkgs.callPackage ./nix/shell.nix { inherit packages; }; - release = default.override { release-mode = true; }; + release = self.devShells.${system}.default.override { release-mode = true; }; }; }); } diff --git a/hpack/util/dune b/hpack/util/dune index 5c82bb65..335b0b11 100644 --- a/hpack/util/dune +++ b/hpack/util/dune @@ -1,3 +1,9 @@ -(executables - (names gen_huffman gen_static) +(executable + (name gen_huffman) (libraries compiler-libs.common)) + +(executable + (name gen_static) + (libraries compiler-libs.common) + (enabled_if + (< %{ocaml_version} 5.2)))