diff --git a/.buildkite/primer-wasm.yaml b/.buildkite/primer-wasm.yaml deleted file mode 100644 index 5deaa9577..000000000 --- a/.buildkite/primer-wasm.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# Note: because they take so much time to run, we only run the Primer -# Wasm tests when one of these conditions is true: -# -# 1. The PR has hit the merge queue. -# 2. The PR has the "Run Wasm tests" label. - -agents: - queue: "nix-build" - os: "linux" - -steps: - # Note: only one of these should run during any given build. - # Unfortunately, Buildkite doesn't support if-else conditionals, so - # this gets a bit tricky. - - - label: ":haskell: :linux: Primer Wasm tests" - if: | - build.branch =~ /^gh-readonly-queue\// || - build.pull_request.labels includes "Run Wasm tests" - command: | - nix develop .#wasm --print-build-logs --command make -f Makefile.wasm32 update - nix develop .#wasm --print-build-logs --command make -f Makefile.wasm32 frontend-prod - nix develop .#wasm --print-build-logs --command make -f Makefile.wasm32 test - - - label: ":haskell: :linux: Primer Wasm build" - if: | - build.branch !~ /^gh-readonly-queue\// && - !(build.pull_request.labels includes "Run Wasm tests") - command: | - nix develop .#wasm --print-build-logs --command make -f Makefile.wasm32 update - nix develop .#wasm --print-build-logs --command make -f Makefile.wasm32 frontend-prod - - - label: ":haskell: :macos: Primer Wasm build" - if: | - build.branch !~ /^gh-readonly-queue\// && - !(build.pull_request.labels includes "Run Wasm tests") - command: | - nix develop --no-sandbox .#wasm --print-build-logs --command make -f Makefile.wasm32 update - nix develop --no-sandbox .#wasm --print-build-logs --command make -f Makefile.wasm32 frontend-prod - agents: - os: "darwin" diff --git a/cabal.project b/cabal.project index 0c79a448a..81e152ef7 100644 --- a/cabal.project +++ b/cabal.project @@ -56,6 +56,14 @@ source-repository-package tag: ba94173bd8ff22110e65beb51c66cdf1172ce677 --sha256: 0nqdmxddmcd5c74mbw7yxsg8849rfmvaqq8afmw6ap8qfzr7dax2 +-- Upstream requires `happy` at build time, which doesn't work on Wasm +-- targets. +source-repository-package + type: git + location: https://github.com/hackworthltd/pretty-show + tag: 91d119cb0e3c5f7d866589b25158739580c8fc88 + --sha256: sha256-mu8Eq0Sg6nCF8C2sXB6ebZcLhz8TVZAbNMiorA7RVc8= + -- Wasm workarounds. -- -- We would prefer that these workarounds were not Wasm-dependent; @@ -68,11 +76,3 @@ source-repository-package if arch(wasm32) -- Required for TemplateHaskell support on Wasm targets. shared: True - - -- Upstream requires `happy` at build time, which doesn't work on Wasm - -- targets. - source-repository-package - type: git - location: https://github.com/hackworthltd/pretty-show - tag: 91d119cb0e3c5f7d866589b25158739580c8fc88 - --sha256: sha256-mu8Eq0Sg6nCF8C2sXB6ebZcLhz8TVZAbNMiorA7RVc8= diff --git a/flake.nix b/flake.nix index b00eb81dc..41213dbf0 100644 --- a/flake.nix +++ b/flake.nix @@ -85,7 +85,9 @@ # haskell.nix does a lot of heavy lifiting for us and gives us a # flake for our Cabal project with the following attributes: # `checks`, `apps`, and `packages`. - primerFlake = pkgs.primer.flake { }; + primerFlake = pkgs.primer.flake { + crossPlatforms = p: [ p.wasi32 ]; + }; weeder = let @@ -102,7 +104,7 @@ getHIEs = package: getLibHIE package ++ pkgs.lib.concatMap (getHIE package) - [ "benchmarks" "exes" "sublibs" "tests" ]; + [ "exes" "sublibs" "tests" ]; primer-packages = pkgs.haskell-nix.haskellLib.selectProjectPackages pkgs.primer; in pkgs.runCommand "weeder" @@ -193,15 +195,9 @@ }; }; - packages = { - inherit (pkgs) primer-benchmark; - } - // (pkgs.lib.optionalAttrs (system == "x86_64-linux") { - inherit (pkgs) primer-benchmark-results-json; - inherit (pkgs) primer-criterion-results-github-action-benchmark; - inherit (pkgs) primer-benchmark-results-github-action-benchmark; - }) - // primerFlake.packages; + packages = { } + // (pkgs.lib.optionalAttrs (system == "x86_64-linux") { }) + // primerFlake.packages; checks = { # Disabled, as it doesn't currently build with Nix. @@ -251,9 +247,7 @@ program = "${pkg}/bin/${script}"; }; in - (pkgs.lib.mapAttrs (name: pkg: mkApp pkg name) { - inherit (pkgs) primer-benchmark; - }) + (pkgs.lib.mapAttrs (name: pkg: mkApp pkg name) { }) // primerFlake.apps; treefmt.config = @@ -362,10 +356,6 @@ ghcOptions = [ "-Werror" ]; preCheck = preCheckTasty; }; - primer-benchmark = { - ghcOptions = [ "-Werror" ]; - preCheck = preCheckTasty; - }; }; } { @@ -400,7 +390,6 @@ packages.bytestring-builder.writeHieFiles = false; packages.fail.writeHieFiles = false; packages.diagrams.writeHieFiles = false; - packages.happy-lib.writeHieFiles = false; } { #TODO This shouldn't be necessary - see the commented-out `build-tool-depends` in primer.cabal. @@ -418,12 +407,13 @@ { packages.primer.components.tests.primer-test.testFlags = hide-successes ++ size-cutoff; packages.primer-api.components.tests.primer-api-test.testFlags = hide-successes ++ size-cutoff; - packages.primer-benchmark.components.tests.primer-benchmark-test.testFlags = hide-successes; } ) ]; shell = { + crossPlatforms = p: [ p.wasi32 ]; + # We're using a `source-repository-package`, so we must disable this. # See: # https://github.com/hackworthltd/primer/issues/876 @@ -468,34 +458,9 @@ }; }; - primerFlake = primer.flake { }; - - # Note: these benchmarks should only be run (in CI) on a - # "benchmark" machine. This is enforced for our CI system - # via Nix's `requiredSystemFeatures`. - # - # The `lastEnvChange` value is an impurity that we can - # modify when we want to force a new benchmark run - # despite the benchmarking code not having changed, as - # otherwise Nix will cache the results. It's intended to - # be used to track changes to the benchmarking - # environment, such as changes to hardware, that Nix - # doesn't know about. - # - # The value should be formatted as an ISO date, followed - # by a "." and a 2-digit monotonic counter, to allow for - # multiple changes on the same date. We store this value - # in a `lastEnvChange` file in the derivation output, so - # that we can examine results in the Nix store and know - # which benchmarking environment was used to generate - # them. - benchmarks = - let - lastEnvChange = "20240408.02"; - in - final.callPackage ./nix/pkgs/benchmarks { - inherit lastEnvChange; - }; + primerFlake = primer.flake { + crossPlatforms = p: [ p.wasi32 ]; + }; in { lib = (prev.lib or { }) // { @@ -506,12 +471,6 @@ inherit primer; - primer-benchmark = primerFlake.packages."primer-benchmark:bench:primer-benchmark"; - - inherit (benchmarks) primer-benchmark-results-json; - inherit (benchmarks) primer-criterion-results-github-action-benchmark; - inherit (benchmarks) primer-benchmark-results-github-action-benchmark; - inherit (ghc982Tools) cabal-fmt hlint ghcid; } );