Skip to content
Snippets Groups Projects
  1. Mar 26, 2025
    • Ben Gamari's avatar
      hadrian: Disable x-data-list-nonempty-unzip warning · 91d16fd9
      Ben Gamari authored and Cheng Shao's avatar Cheng Shao committed
      (cherry picked from commit 12752f0c)
      (cherry picked from commit a73d6c7f)
      91d16fd9
    • Ben Gamari's avatar
      hadrian: Drop uses of head/tail · a53339da
      Ben Gamari authored and Cheng Shao's avatar Cheng Shao committed
      To silence warnings with GHC 9.10
      
      (cherry picked from commit a7e23f01)
      (cherry picked from commit 1078f402)
      a53339da
    • Cheng Shao's avatar
      hadrian: enable building docs for cross targets · 3608388e
      Cheng Shao authored
      Hadrian used to omit the docs target as a part of binary-dist-dir for
      cross targets. This commit enables docs to be built as a part of cross
      bindists and it works just fine in CI.
      
      (cherry picked from commit a794e733)
      (cherry picked from commit a0af1500)
      3608388e
    • Cheng Shao's avatar
      hadrian: enable building stage1 haddock for cross ghc · 49a277ac
      Cheng Shao authored
      This commit enables building stage1 haddock for cross ghc. Without
      this change, hadrian would panic with "Unknown program" error when
      building the _build/stage1/bin/cross-prefix-haddock program needed by
      the docs-haddock target, even if it only needs to copy from
      _build/stage0/bin/cross-prefix-haddock.
      
      (cherry picked from commit 272eaef0)
      (cherry picked from commit 0b775a8a)
      49a277ac
    • Cheng Shao's avatar
      hadrian: add +text_simdutf flavour transformer to allow building text with simdutf · 047dfaa9
      Cheng Shao authored
      This patch adds a +text_simdutf flavour transformer to hadrian to
      allow downstream packagers and users that build from source to opt-in
      simdutf support for text, in order to benefit from SIMD speedup at
      run-time. It's still disabled by default for the time being.
      
      (cherry picked from commit 44e2abfb)
      047dfaa9
    • Cheng Shao's avatar
      hadrian: so-mutex · 508df7bc
      Cheng Shao authored
      (cherry picked from commit c35281f9)
      508df7bc
    • Cheng Shao's avatar
      hadrian: fix bindist makefile for wasm32-wasi target · 60010674
      Cheng Shao authored
      This patch fixes one incoherent place between bindist makefile and
      hadrian logic: I forgot to include wasi/wasm32 in
      OsSupportsGHCi/ArchSupportsGHCi as well. And this results in incorrect
      settings file generated after installing the bindist, and "Use
      interpreter"/"Have interpreter" fields incorrectly have "NO" values
      where they should be "YES" like --info output of in-tree version.
      
      (cherry picked from commit 75a2eae4)
      (cherry picked from commit 735f3f9a)
      60010674
    • Cheng Shao's avatar
      hadrian: make sure ghc-bin internal-interpreter is disabled for stage0 when not cross compiling · eb7da5b9
      Cheng Shao authored
      This patch disables internal-interpreter flag for stage0 ghc-bin when
      not cross compiling, see added comment for explanation. Fixes #25406.
      
      (cherry picked from commit fde12aba)
      eb7da5b9
    • Cheng Shao's avatar
      hadrian/compiler: flip on support for shared libs & ghci for wasm · 44865696
      Cheng Shao authored
      This commit flips on the support for shared libs and ghci for the wasm
      target, given all required support logic has been added in previous
      commits.
      
      (cherry picked from commit 652e7239)
      44865696
    • Cheng Shao's avatar
      hadrian/ghci: add wasm dyld · c08f1bb8
      Cheng Shao authored
      This commit adds the wasm dynamic linker implementation, as well as
      ghci logic to call it and hadrian logic to install it to the correct
      location. See the top-level note in utils/jsffi/dyld.mjs for more
      details.
      
      (cherry picked from commit 549582ef)
      c08f1bb8
    • Cheng Shao's avatar
      hadrian/compiler: implement targetRTSLinkerOnlySupportsSharedLibs · 6af24ac3
      Cheng Shao authored
      This patch implements the targetRTSLinkerOnlySupportsSharedLibs
      predicate in hadrian. Its definition in hadrian is the single source
      of truth, and the information propagates to ghc settings file, ghc
      driver and testsuite driver. It is used in various places to ensure
      dynamic dependency is selected when the target RTS linker only
      supports loading dynamic code.
      
      (cherry picked from commit 8c74a0ed)
      6af24ac3
    • Cheng Shao's avatar
      hadrian/testsuite: implement config.cross logic · 9e03d4ee
      Cheng Shao authored
      This commit implements the config.cross field in the testsuite driver.
      It comes from the "cross compiling" ghc info field for both
      in-tree/out-of-tree GHC, and is an accurate predicate of whether we're
      cross-compiling or not (compared to the precense of target emulator),
      and is useful to implement predicates to assert the precense of
      internal interpreter (only available on non-cross GHC) for tests that
      do require it (e.g. plugins).
      
      (cherry picked from commit 2956a3f7)
      9e03d4ee
    • Cheng Shao's avatar
      hadrian: add the host_fully_static flavour transformer · 8d08b689
      Cheng Shao authored
      This commit adds the host_fully_static flavour transformer to hadrian,
      which ensures stage0 is fully statically linked while still permitting
      stage1 libdir to contain shared libraries. This is intended to be used
      by the wasm backend to build portable linux bindists that contain wasm
      shared libraries.
      
      (cherry picked from commit b45080a3)
      8d08b689
    • Cheng Shao's avatar
      hadrian: re-enable PIC for gmp on wasm · 35950b97
      Cheng Shao authored
      This commit re-enables --with-pic=yes configuration option of gmp when
      building for wasm, given we're about to include support for shared
      libraries, TH and ghci.
      
      (cherry picked from commit 775410fd)
      35950b97
    • Cheng Shao's avatar
      hadrian: fix CFLAGS for gmp shared objs on wasm · 1f3fdc82
      Cheng Shao authored
      This commit adds -fvisibility=default to CFLAGS of gmp when building
      for wasm. This is required to generate the ghc-bignum shared library
      without linking errors. Clang defaults to -fvisibility=hidden for wasm
      targets, which will cause issues when a symbol is expected to be
      exported in a shared library but without explicit visibility attribute
      annotation.
      
      (cherry picked from commit c247f2ee)
      1f3fdc82
    • Cheng Shao's avatar
      hadrian: enable internal-interpreter for ghc-bin stage0 · f0f0bbf8
      Cheng Shao authored
      This commit enables internal-interpreter flag for ghc-bin even when
      compiling stage0, as long as target supports ghci. It enables ghci
      functionality for cross targets that support ghci, since cross ghc-bin
      is really stage0.
      
      (cherry picked from commit 577c1819)
      f0f0bbf8
    • Cheng Shao's avatar
      hadrian: disable internal-interpreter of ghc library when cross compiling · 7906d750
      Cheng Shao authored
      This commit disable the internal-interpreter flag of ghc library when
      cross compiling, only external interpreter works in such cases.
      
      (cherry picked from commit f232c872)
      7906d750
    • Cheng Shao's avatar
      hadrian: use targetSupportsRPaths predicate · ea0958b7
      Cheng Shao authored
      This commit changes the hostSupportsRPaths predicate to
      targetSupportsRPaths and use that to decide whether to pass
      RPATH-related link-time options. It's not applied to stage0, we should
      just use the default link-time options of stageBoot ghc.
      
      (cherry picked from commit a6a82cdb)
      ea0958b7
    • Cheng Shao's avatar
      rts: rename prelude.js to prelude.mjs · 902a05d6
      Cheng Shao authored
      This commit renames prelude.js to prelude.mjs for wasm backend rts
      jsbits, and slightly adjusts the jsbits contents. This is for
      preparing the implementation of dyld.mjs that contains wasm dynamic
      linker logic, which needs to import prelude.mjs as a proper ESM
      module.
      
      (cherry picked from commit 71a471e7)
      902a05d6
    • Cheng Shao's avatar
      hadrian: remove unused ghciWithDebugger field from flavour config · 077ef6c1
      Cheng Shao authored
      This patch removes the ghciWithDebugger field from flavour config
      since it's actually not used anywhere.
      
      (cherry picked from commit c6e5fd3d)
      077ef6c1
    • Cheng Shao's avatar
      hadrian: handle findExecutable "" gracefully · 7e4b7b64
      Cheng Shao authored
      hadrian may invoke findExecutable "" at run-time due to a certain
      program is not found by configure script. Which is fine and
      findExecutable is supposed to return Nothing in this case. However, on
      Windows there's a directory bug that throws an exception (see
      https://github.com/haskell/directory/issues/180), so we might as well
      use a wrapper for findExecutable and handle exceptions gracefully.
      
      (cherry picked from commit 1e5752f6)
      7e4b7b64
    • Cheng Shao's avatar
      hadrian: build C/C++ with split sections when enabled · e39c1890
      Cheng Shao authored
      When split sections is enabled, ensure -fsplit-sections is passed to
      GHC as well when invoking GHC to compile C/C++; and pass
      -ffunction-sections -fdata-sections to gcc/clang when compiling C/C++
      with the hadrian Cc builder. Fixes #23381.
      
      (cherry picked from commit 0958937e)
      e39c1890
    • Cheng Shao's avatar
      testsuite: fix req_target_smp predicate · fdcd0bdd
      Cheng Shao authored
      (cherry picked from commit a580722e)
      fdcd0bdd
    • Sylvain Henry's avatar
      Fix TH dependencies (#22229) · 23f2e685
      Sylvain Henry authored and Cheng Shao's avatar Cheng Shao committed
      Add a dependency between Syntax and Internal (via module reexport).
      
      (cherry picked from commit 4d78c53c)
      23f2e685
    • Teo Camarasu's avatar
      Remove unecessary stage0 packages · 3420ebfc
      Teo Camarasu authored and Cheng Shao's avatar Cheng Shao committed
      Historically quite a few packages had to be stage0 as they depended on
      `template-haskell` and that was stage0. In #23536 we made it so that was
      no longer the case. This allows us to remove a bunch of packages from
      this list.
      
      A few still remain. A new version of `Win32` is required by
      `semaphore-compat`. Including `Win32` in the stage0 set requires also
      including `filepath` because otherwise Hadrian's dependency logic gets
      confused. Once our boot compiler has a newer version of `Win32` all of
      these will be able to be dropped.
      
      Resolves #24652
      
      (cherry picked from commit dd339c7a)
      3420ebfc
    • Teo Camarasu's avatar
      Make template-haskell a stage1 package · 46e34284
      Teo Camarasu authored and Cheng Shao's avatar Cheng Shao committed
      
      Promoting template-haskell from a stage0 to a stage1 package means that
      we can much more easily refactor template-haskell.
      
      We implement this by duplicating the in-tree `template-haskell`.
      A new `template-haskell-next` library is autogenerated to mirror `template-haskell`
      `stage1:ghc` to depend on the new interface of the library including the
      `Binary` instances without adding an explicit dependency on `template-haskell`.
      
      This is controlled by the `bootstrap-th` cabal flag
      
      When building `template-haskell` modules as part of this vendoring we do
      not have access to quote syntax, so we cannot use variable quote
      notation (`'Just`). So we either replace these with hand-written `Name`s
      or hide the code behind CPP.
      
      We can remove the `th_hack` from hadrian, which was required when
      building stage0 packages using the in-tree `template-haskell` library.
      
      For more details see Note [Bootstrapping Template Haskell].
      
      Resolves #23536
      
      Co-Authored-By: default avatarSebastian Graf <sgraf1337@gmail.com>
      Co-Authored-By: default avatarMatthew Craven <5086-clyring@users.noreply.gitlab.haskell.org>
      (cherry picked from commit 42bd0407)
      46e34284
    • Cheng Shao's avatar
      Revert "hadrian: Refactor treatment of extra dependencies" · 262e3681
      Cheng Shao authored
      This reverts commit 3a18d9e7.
      262e3681
  2. Mar 05, 2025
  3. Feb 27, 2025
  4. Feb 19, 2025
  5. Feb 14, 2025
    • Ben Gamari's avatar
      hadrian: Mitigate mktexfmt race · 9b2e13db
      Ben Gamari authored and Andreas Klebinger's avatar Andreas Klebinger committed
      At least some versions of Texlive's `mktexfmt` utility cannot be invoked
      concurrently in their initial run since they fail to handle failure of
      `mkdir` due to racing. Specifically, we see
      
      ```
      | Run Xelatex: users_guide.tex => /tmp/extra-dir-9616886274866
      | Run Xelatex: Haddock.tex => /tmp/extra-dir-9616886274869
      This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020) (preloaded format=xelatex)
       restricted \write18 enabled.
      kpathsea: Running mktexfmt xelatex.fmt
      mktexfmt: mktexfmt is using the following fmtutil.cnf files (in precedence order):
      mktexfmt:   /usr/share/texlive/texmf-dist/web2c/fmtutil.cnf
      mktexfmt: mktexfmt is using the following fmtutil.cnf file for writing changes:
      mktexfmt:   /builds/ghc/ghc/tmp-home/.texlive2020/texmf-config/web2c/fmtutil.cnf
      /usr/bin/mktexfmt: mkdir(/builds/ghc/ghc/tmp-home/.texlive2020/texmf-var/web2c/) failed for tree /builds/ghc/ghc/tmp-home/.texlive2020/texmf-var/web2c: File exists at /usr/share/texlive/tlpkg/TeXLive/TLUtils.pm line 937.
      I can't find the format file `xelatex.fmt'!
      ```
      
      That is two `mktexfmt` invocations (for the user's guide and haddock
      builds) attempted to create `$HOME/texlive2020/texmf-var/web2c` and
      raced. One of the two `mkdir`'s consequently failed, bringing down the
      entire build.
      
      We avoid this by ensuring that the first `xelatex` invocation is always
      performed serially.
      
      Fixes #25564.
      
      (cherry picked from commit 41dae5b8)
      9b2e13db
  6. Feb 06, 2025
  7. Feb 05, 2025
  8. Jan 14, 2025
    • Andrea Bedini's avatar
      hadrian: Ignore build-tool-depends fields in cabal files · 4ecf7782
      Andrea Bedini authored and Andreas Klebinger's avatar Andreas Klebinger committed
      hadrian does not utilise the build-tool-depends fields in cabal files
      and their presence can cause issues when building source distribution
      (see #24826)
      
      Ideally Cabal would support building "full" source distributions which
      would remove the need for workarounds in hadrian but for now we can
      patch the build-tool-depends out of the cabal files.
      
      Fixes #24826
      
      (cherry picked from commit aba2c9d4)
      4ecf7782
    • Matthew Pickering's avatar
      hadrian: Don't build ghci object files for ./hadrian/ghci target · fffba270
      Matthew Pickering authored and Andreas Klebinger's avatar Andreas Klebinger committed
      There is some convoluted logic which determines whether we build ghci
      object files are not. In any case, if you set `ghcDynPrograms = pure
      False` then it forces them to be built.
      
      Given we aren't ever building executables with this flavour it's fine
      to leave `ghcDynPrograms` as the default and it should be a bit faster
      to build less.
      
      Also fixes #24949
      
      (cherry picked from commit a949c792)
      fffba270
  9. Dec 18, 2024
Loading