From c9ae0f89f869482750fdc3984e7586e7b58ccd04 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 15 Sep 2023 10:10:01 -0400 Subject: [PATCH 1/8] get `cabal-test` app from updated hs-flake-utils Also hlint as long as we're here --- flake.lock | 34 +++++++++++++++++----------------- flake.nix | 4 ++++ 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/flake.lock b/flake.lock index 83cd961..9dbcbe2 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1668681692, - "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", "owner": "edolstra", "repo": "flake-compat", - "rev": "009399224d5e398d03b22badca40a37ac85412a1", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", "type": "github" }, "original": { @@ -33,11 +33,11 @@ }, "flake-utils_2": { "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "lastModified": 1676283394, + "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", "owner": "numtide", "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", "type": "github" }, "original": { @@ -77,11 +77,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1673454489, - "narHash": "sha256-LsOintvQ4n3QPkI5MA+IhmlLlH5BVzL2xqT/h5U5K7w=", + "lastModified": 1692187439, + "narHash": "sha256-m7c4EPFWmB1OmV3dSYQk2qtXR53xOjZdLCjMtzHSK34=", "ref": "main", - "rev": "4feccf13501960b92e1d9d73bf6e046b36861af0", - "revCount": 4, + "rev": "408f3deab2e2f6ae60349776dde02c44f71fb386", + "revCount": 16, "type": "git", "url": "https://whetstone.private.storage/jcalderone/hs-flake-utils.git" }, @@ -109,16 +109,16 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1671271954, - "narHash": "sha256-cSvu+bnvN08sOlTBWbBrKaBHQZq8mvk8bgpt0ZJ2Snc=", + "lastModified": 1673800717, + "narHash": "sha256-SFHraUqLSu5cC6IxTprex/nTsI81ZQAtDvlBvGDWfnA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d513b448cc2a6da2c8803e3c197c9fc7e67b19e3", + "rev": "2f9fd351ec37f5d479556cd48be4ca340da59b8f", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-22.05", + "ref": "nixos-22.11", "repo": "nixpkgs", "type": "github" } @@ -138,11 +138,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1673281605, - "narHash": "sha256-v6U0G3pJe0YaIuD1Ijhz86EhTgbXZ4f/2By8sLqFk4c=", + "lastModified": 1677722096, + "narHash": "sha256-7mjVMvCs9InnrRybBfr5ohqcOz+pyEX8m22C1XsDilg=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "f8992fb404c7e79638192a10905b7ea985818050", + "rev": "61a3511668891c68ebd19d40122150b98dc2fe3b", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 7c12f34..b8d99ff 100644 --- a/flake.nix +++ b/flake.nix @@ -28,5 +28,9 @@ checks = hslib.checks {}; devShells = hslib.devShells {}; packages = hslib.packages {}; + apps = { + hlint = hslib.apps.hlint {argv = ["haskell/"];}; + cabal-test = hslib.apps.cabal-test {testTargetName = "test:tests";}; + }; }); } From d1cd6040a4f67400e57ec520ef5aaa099f4aeb7c Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 15 Sep 2023 10:23:30 -0400 Subject: [PATCH 2/8] try it with still more output --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 98728bf..70ebf16 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,10 +22,10 @@ jobs: nix flake check -v - run: - name: "nix build" + name: "Haskell Test Suite" no_output_timeout: "30m" command: | - nix build -v + nix run .#cabal-test workflows: ci: From 0ad05d08c2c9455935dfbb6bebc4c90995065a4f Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Mon, 18 Sep 2023 10:32:56 -0400 Subject: [PATCH 3/8] attempt to debug the build failure on ci --- flake.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index b8d99ff..f2557f1 100644 --- a/flake.nix +++ b/flake.nix @@ -30,7 +30,14 @@ packages = hslib.packages {}; apps = { hlint = hslib.apps.hlint {argv = ["haskell/"];}; - cabal-test = hslib.apps.cabal-test {testTargetName = "test:tests";}; + cabal-test = hslib.apps.cabal-test { + preBuild = '' + cabal get old-time-1.1.0.3 + cd old-time-1.1.0.3 + cabal build + ''; + testTargetName = "test:tests"; + }; }; }); } From 629590cec39b52b7db8ab95cb26ad3ef431046ae Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Mon, 18 Sep 2023 10:36:24 -0400 Subject: [PATCH 4/8] get the package db ... --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index f2557f1..5e04b94 100644 --- a/flake.nix +++ b/flake.nix @@ -32,6 +32,7 @@ hlint = hslib.apps.hlint {argv = ["haskell/"];}; cabal-test = hslib.apps.cabal-test { preBuild = '' + cabal update hackage.haskell.org cabal get old-time-1.1.0.3 cd old-time-1.1.0.3 cabal build From 5f50bbe761db8d4ba9233fa57f16acdd135ff687 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Mon, 18 Sep 2023 10:45:19 -0400 Subject: [PATCH 5/8] put gnused in the build environment for cabal-test --- flake.lock | 8 ++++---- flake.nix | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 9dbcbe2..79ba7a5 100644 --- a/flake.lock +++ b/flake.lock @@ -77,11 +77,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1692187439, - "narHash": "sha256-m7c4EPFWmB1OmV3dSYQk2qtXR53xOjZdLCjMtzHSK34=", + "lastModified": 1695048281, + "narHash": "sha256-zkXDTX2aM6mOiYZlc60NJTAb3mrDrrlNN7lHE3GSvhk=", "ref": "main", - "rev": "408f3deab2e2f6ae60349776dde02c44f71fb386", - "revCount": 16, + "rev": "628ffddf1a6c59036fa1a4b76daddb9b34065e04", + "revCount": 17, "type": "git", "url": "https://whetstone.private.storage/jcalderone/hs-flake-utils.git" }, diff --git a/flake.nix b/flake.nix index 5e04b94..1c3233d 100644 --- a/flake.nix +++ b/flake.nix @@ -31,6 +31,11 @@ apps = { hlint = hslib.apps.hlint {argv = ["haskell/"];}; cabal-test = hslib.apps.cabal-test { + extraRuntimeInputs = pkgs: [ + # A build-time dependency of old-time, a transitive dependency of + # ours... + pkgs.gnused + ]; preBuild = '' cabal update hackage.haskell.org cabal get old-time-1.1.0.3 From 86aa279f55293c71e483fd96db16e9cd0d295992 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Mon, 18 Sep 2023 10:49:45 -0400 Subject: [PATCH 6/8] awk, too --- flake.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 1c3233d..7f2b189 100644 --- a/flake.nix +++ b/flake.nix @@ -32,9 +32,10 @@ hlint = hslib.apps.hlint {argv = ["haskell/"];}; cabal-test = hslib.apps.cabal-test { extraRuntimeInputs = pkgs: [ - # A build-time dependency of old-time, a transitive dependency of - # ours... + # Some build-time dependencies of old-time, a transitive + # dependency of ours... pkgs.gnused + pkgs.gawk ]; preBuild = '' cabal update hackage.haskell.org From 7c1ad486507abd81f34b0afa15b07e2511ebc10d Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Mon, 18 Sep 2023 10:53:55 -0400 Subject: [PATCH 7/8] that seems to have done it, clean up --- flake.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/flake.nix b/flake.nix index 7f2b189..49c9445 100644 --- a/flake.nix +++ b/flake.nix @@ -37,12 +37,6 @@ pkgs.gnused pkgs.gawk ]; - preBuild = '' - cabal update hackage.haskell.org - cabal get old-time-1.1.0.3 - cd old-time-1.1.0.3 - cabal build - ''; testTargetName = "test:tests"; }; }; From 3396d344bf2bf01fae02a58c20a95da9051a6845 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Mon, 18 Sep 2023 10:58:32 -0400 Subject: [PATCH 8/8] do a native nix build too --- .circleci/config.yml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 70ebf16..1cb8322 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,26 @@ version: "2.1" jobs: + cabal-test: + docker: + - image: "nixos/nix:2.13.2" + + environment: + # Let us use features marked "experimental". For example, most/all of + # the `nix ` forms. Also, allow import from derivation + # because cabal2nix requires it. + NIX_CONFIG: | + experimental-features = nix-command flakes + allow-import-from-derivation = true + + steps: + - "checkout" + - run: + name: "Haskell Test Suite" + no_output_timeout: "30m" + command: | + nix run .#cabal-test + nix-build: docker: - image: "nixos/nix:2.13.2" @@ -22,12 +42,13 @@ jobs: nix flake check -v - run: - name: "Haskell Test Suite" + name: "Nix Build" no_output_timeout: "30m" command: | - nix run .#cabal-test + nix build --print-build-logs workflows: ci: jobs: - - nix-build + - "cabal-test" + - "nix-build"