Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions .buildkite/primer-wasm.yaml

This file was deleted.

16 changes: 8 additions & 8 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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=
67 changes: 13 additions & 54 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -362,10 +356,6 @@
ghcOptions = [ "-Werror" ];
preCheck = preCheckTasty;
};
primer-benchmark = {
ghcOptions = [ "-Werror" ];
preCheck = preCheckTasty;
};
};
}
{
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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 { }) // {
Expand All @@ -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;
}
);
Expand Down