diff options
| author | Ben Sima <ben@bsima.me> | 2025-11-14 21:01:28 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bsima.me> | 2025-11-14 21:01:28 -0500 |
| commit | 5f1289ca28249ed94cd5008c2e1b2574d6998ed6 (patch) | |
| tree | 5a7a600fc0ab5fe105eeb202fecc986d8f1ce3d4 | |
| parent | 8baf00d3f7e87b24d735f57fd489ab7210f1b7a9 (diff) | |
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.
| -rw-r--r-- | Omni/Bild/Builder.nix | 7 |
1 files changed, 4 insertions, 3 deletions
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 = '' |
