From 5f1289ca28249ed94cd5008c2e1b2574d6998ed6 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 14 Nov 2025 21:01:28 -0500 Subject: Fix per-module link phase: put source file before flags GHC --make interprets arguments before flags as targets. Moving the entry point source file to the beginning prevents -i paths from being treated as compilation targets. This fixes the 'is not a module name or a source file' error. --- Omni/Bild/Builder.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Omni/Bild/Builder.nix') diff --git a/Omni/Bild/Builder.nix b/Omni/Bild/Builder.nix index a91924c..fa732be 100644 --- a/Omni/Bild/Builder.nix +++ b/Omni/Bild/Builder.nix @@ -233,12 +233,13 @@ with bild; let in '' set -eux echo "Starting custom link phase with ${builtins.toString (builtins.length objectPaths)} object files" - ${ghcPkg}/bin/ghc --make -o ${name} \ + ${ghcPkg}/bin/ghc --make \ + ${target.quapath} \ -i. ${iFlags} \ ${pkgFlags} \ -threaded \ - ${lib.optionalString (target.mainModule != "Main") "-main-is ${target.mainModule}"} \ - ${target.quapath} + -o ${name} \ + ${lib.optionalString (target.mainModule != "Main") "-main-is ${target.mainModule}"} echo "Link completed successfully" ''; installPhase = '' -- cgit v1.2.3