From 554b7019d41b92e0154d2f0adc0a7e78cfdddac9 Mon Sep 17 00:00:00 2001
From: Julian Ospald <hasufell@posteo.de>
Date: Mon, 6 Jan 2025 13:38:47 +0800
Subject: [PATCH] Fix build of tests

---
 .github/workflows/ci-js.yml |  5 +++--
 cabal.project.js            | 18 ++++++++++++++++++
 2 files changed, 21 insertions(+), 2 deletions(-)
 create mode 100644 cabal.project.js

diff --git a/.github/workflows/ci-js.yml b/.github/workflows/ci-js.yml
index 1d7c925..bdce40a 100644
--- a/.github/workflows/ci-js.yml
+++ b/.github/workflows/ci-js.yml
@@ -43,6 +43,7 @@ jobs:
           autoreconf -i
           cabal update
 
-          cabal build -w javascript-unknown-ghcjs-ghc --with-ghc-pkg=javascript-unknown-ghcjs-ghc-pkg --with-hsc2hs=javascript-unknown-ghcjs-hsc2hs -f-os-string
-          $(cabal list-bin -w javascript-unknown-ghcjs-ghc --with-ghc-pkg=javascript-unknown-ghcjs-ghc-pkg --with-hsc2hs=javascript-unknown-ghcjs-hsc2hs -f-os-string T13660)
+          cabal --project-file=cabal.project.js build --with-hsc2hs=javascript-unknown-ghcjs-hsc2hs
+          $(cabal --project-file=cabal.project.js list-bin T13660)
+          $(cabal --project-file=cabal.project.js list-bin unix-tests)
 
diff --git a/cabal.project.js b/cabal.project.js
new file mode 100644
index 0000000..870a443
--- /dev/null
+++ b/cabal.project.js
@@ -0,0 +1,18 @@
+packages: .
+
+with-compiler: javascript-unknown-ghcjs-ghc
+with-hc-pkg: javascript-unknown-ghcjs-ghc-pkg
+
+package unix
+  ghc-options: -Wno-unused-imports
+
+write-ghc-environment-files: always
+
+allow-newer: all:base
+
+tests: True
+
+constraints:
+  random < 1.2,
+  tasty -unix, optparse-applicative -process,
+  unix -os-string