From e615dc6f9b3b8a2f7b7fc4d01b581d2c1ae2745e Mon Sep 17 00:00:00 2001 From: Emily Martins Date: Wed, 24 Aug 2022 17:21:25 +0200 Subject: [PATCH] ensure `make ci` is consistent with system Sadly I can't see of a way to pass your current system to `nix build`. So, let's just support x86 64-bit Linux and tell the user how to use `nix build` directly. --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bab143b..f3f0318 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # This really ought to be `/usr/bin/env bash`, but nix flakes don't like that. SHELL := /bin/sh -.PHONY: hoogle format haddock usage tag format_nix format_haskell format_check \ +.PHONY: hoogle format haddock usage tag format_nix format_haskell format_check \ lint refactor ps_bridge bench bench_check scripts test build ci SOURCE_FILES := $(shell git ls-tree -r HEAD --full-tree --name-only) @@ -98,4 +98,7 @@ test: requires_nix_shell build: requires_nix_shell cabal build -j$(THREADS) -ci: format_check lint build bench_check test haddock +ci: + @ [[ "$$(uname -sm)" == "Linux x86_64" ]] \ + && (nix build .#check.x86_64-linux) \ + || (echo "CI only builds on Linux x86_64. Your system is $$(uname -sm). If you want to build it for your system, use 'nix build .#check.' instead." && false)