From 872405d629b4937c48c691ce1f50927ad27ea2d0 Mon Sep 17 00:00:00 2001
From: hololeap <hololeap@protonmail.com>
Date: Fri, 25 Apr 2025 15:08:09 -0600
Subject: [PATCH 1/1] Add hadrian file-io support

Newer 'directory' requires 'file-io'; hadrian needs to be instructed to
build it. Lines were swiped from the 'ghc-9.12.2-release' branch of ghc.

Signed-off-by: hololeap <hololeap@protonmail.com>
--- a/src/Packages.hs
+++ b/src/Packages.hs
@@ -4,7 +4,7 @@ module Packages (
     array, base, binary, bytestring, cabal, cabalSyntax, checkPpr,
     checkExact, countDeps,
     compareSizes, compiler, containers, deepseq, deriveConstants, directory,
-    exceptions, filepath, genapply, genprimopcode, ghc, ghcBignum, ghcBoot, ghcBootTh,
+    exceptions, filepath, fileio, genapply, genprimopcode, ghc, ghcBignum, ghcBoot, ghcBootTh,
     ghcCompact, ghcConfig, ghcHeap, ghci, ghciWrapper, ghcPkg, ghcPrim, haddock, haskeline,
     hsc2hs, hp2ps, hpc, hpcBin, integerGmp, integerSimple, iserv, iservProxy,
     libffi, libiserv, mtl, parsec, pretty, primitive, process, remoteIserv, rts,
@@ -40,7 +40,7 @@ ghcPackages =
     , ghcCompact, ghcConfig, ghcHeap, ghci, ghciWrapper, ghcPkg, ghcPrim, haddock, haskeline, hsc2hs
     , hp2ps, hpc, hpcBin, integerGmp, integerSimple, iserv, libffi, libiserv, mtl
     , parsec, pretty, process, rts, runGhc, stm, templateHaskell
-    , terminfo, text, time, touchy, transformers, unlit, unix, win32, xhtml
+    , terminfo, text, time, touchy, transformers, unlit, unix, win32, xhtml, fileio
     , timeout
     , lintersCommon
     , lintNotes, lintCommitMsg, lintSubmoduleRefs, lintWhitespace ]
@@ -77,6 +77,7 @@ deriveConstants     = util "deriveConstants"
 directory           = lib  "directory"
 exceptions          = lib  "exceptions"
 filepath            = lib  "filepath"
+fileio              = lib  "file-io"
 genapply            = util "genapply"
 genprimopcode       = util "genprimopcode"
 ghc                 = prg  "ghc-bin"         `setPath` "ghc"
--- a/src/Rules/ToolArgs.hs
+++ b/src/Rules/ToolArgs.hs
@@ -154,6 +154,7 @@ toolTargets = [ binary
               , process
               , exceptions
               , filepath
+              , fileio
               -- , ghc     -- # depends on ghc library
               -- , runGhc  -- # depends on ghc library
               , ghcBoot
--- a/src/Settings/Default.hs
+++ b/src/Settings/Default.hs
@@ -83,6 +83,7 @@ stage0Packages = do
              , process
              , exceptions
              , filepath
+             , fileio
              , ghc
              , runGhc
              , ghcBoot
--- a/src/Settings/Warnings.hs
+++ b/src/Settings/Warnings.hs
@@ -33,7 +33,7 @@ ghcWarningsArgs = do
         , package directory    ? pure [ "-Wno-unused-imports"
                                       , "-Wno-deprecations" -- https://gitlab.haskell.org/ghc/ghc/-/issues/24240
                                       ]
-        , package filepath     ? pure [ "-Wno-unused-imports" ]
+        , package fileio       ? pure [ "-Wno-unused-imports" ] -- https://github.com/haskell/file-io/issues/30
         , package ghc          ? pure [ "-Wcpp-undef"
                                       , "-Wincomplete-uni-patterns"
                                       , "-Wincomplete-record-updates"
-- 
2.49.0

