Skip to content

Commit

Permalink
chore: improved Wasm support (#1297)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhess authored Nov 3, 2024
2 parents 42f0a63 + 1a63817 commit 30a69b8
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 21 deletions.
20 changes: 20 additions & 0 deletions .buildkite/primer-wasm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,30 @@ steps:
nix develop .#wasm --print-build-logs --command make -f Makefile.wasm32 update
nix develop .#wasm --print-build-logs --command make -f Makefile.wasm32 test
- label: ":haskell: :macos: 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 test
agents:
os: "darwin"

- 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
- label: ":haskell: :macos: 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
agents:
os: "darwin"
28 changes: 16 additions & 12 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,29 @@ else
primer-benchmark

if arch(wasm32)
package *
optimization: 2
haddock-hoogle: False
haddock-html: False
haddock-quickjump: False
haddock-hyperlink-source: False
haddock-internal: False
package *
optimization: 2
ghc-options: -fno-external-interpreter
else
optimization: 0
haddock-hoogle: True
haddock-html: True
haddock-quickjump: True
haddock-hyperlink-source: True
haddock-internal: True
package *
ghc-options: -fwrite-ide-info

benchmarks: True

tests: True

haddock-hoogle: True
haddock-html: True
haddock-quickjump: True
haddock-hyperlink-source: True
haddock-internal: True

allow-newer: servant-openapi3:base, openapi3:*, selda:*, hedgehog:pretty-show, hedgehog-classes:pretty-show

package *
ghc-options: -fwrite-ide-info
allow-newer: servant-openapi3:base, openapi3:*, selda:*, hedgehog:pretty-show, hedgehog-classes:pretty-show, *:time

package primer
test-options: "--size-cutoff=32768"
Expand Down
10 changes: 4 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
pre-commit-hooks-nix.inputs.nixpkgs.follows = "nixpkgs";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";

ghc-wasm.url = "git+https://gitlab.haskell.org/ghc/ghc-wasm-meta?ref=refs/heads/master&rev=a04cc1a2206d2030326e1d49be9c6a94ee4283a3";
ghc-wasm.url = "git+https://gitlab.haskell.org/ghc/ghc-wasm-meta";
};

outputs = inputs@ { flake-parts, ... }:
Expand Down Expand Up @@ -330,8 +330,6 @@
config.treefmt.build.devShell
];
};
} // (pkgs.lib.optionalAttrs (system == "x86_64-linux")) {
# Unfortunately, this is only available on x86_64-linux.
wasm = pkgs.mkShell {
packages = with inputs.ghc-wasm.packages.${system};
[
Expand Down

0 comments on commit 30a69b8

Please sign in to comment.