Skip to content
Snippets Groups Projects
  1. Jul 18, 2023
  2. Jul 13, 2023
    • Rodrigo Mesquita's avatar
      configure: Drop DllWrap command · 5e951395
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      We used to configure into settings a DllWrap command for windows
      builds and distributions, however, we no longer do, and dllwrap is
      effectively unused.
      
      This simplification is motivated in part by the larger
      toolchain-selection project (#19877, !9263)
      5e951395
  3. Jul 11, 2023
  4. Jul 08, 2023
  5. Jul 07, 2023
  6. Jul 05, 2023
  7. Jun 30, 2023
    • Matthew Pickering's avatar
      hadrian: Fix dependencies of docs:* rule · d7f6448a
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      For the docs:* rule we need to actually build the package rather than
      just the haddocks for the dependent packages. Therefore we depend on the
      .conf files of the packages we are trying to build documentation for as
      well as the .haddock files.
      
      Fixes #23472
      d7f6448a
  8. Jun 29, 2023
    • Ben Gamari's avatar
      hadrian: Ignore warnings in unix and semaphore-compat · dec81dd1
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      dec81dd1
    • Rodrigo Mesquita's avatar
      Configure MergeObjs supports response files rather than Ld · fcf310e7
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      The previous configuration script to test whether Ld supported response
      files was
      * Incorrect (see #23542)
      * Used, in practice, to check if the *merge objects tool* supported
        response files.
      
      This commit modifies the macro to run the merge objects tool (rather
      than Ld), using a response file, and checking the result with $NM
      
      Fixes #23542
      fcf310e7
    • Ben Gamari's avatar
      hadrian: Always canonicalize topDirectory · 5efa9ca5
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Hadrian's `topDirectory` is intended to provide an absolute path to the
      root of the GHC tree. However, if the tree is reached via a symlink this
      
      One question here is whether the `canonicalizePath` call is expensive
      enough to warrant caching. In a quick microbenchmark I observed that
      `canonicalizePath "."` takes around 10us per call; this seems
      sufficiently low not to worry.
      
      Alternatively, another approach here would have been to rather move the
      canonicalization into `m4/fp_find_root.m4`. This would have avoided
      repeated canonicalization but sadly path canonicalization is a hard
      problem in POSIX shell.
      
      Addresses #22451.
      5efa9ca5
    • Rodrigo Mesquita's avatar
      Configure CPP into settings · 5ffc7d7b
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      There is a distinction to be made between the Haskell Preprocessor and
      the C preprocessor. The former is used to preprocess Haskell files,
      while the latter is used in C preprocessing such as Cmm files.
      
      In practice, they are both the same program (usually the C compiler) but
      invoked with different flags.
      
      Previously we would, at configure time, configure the haskell
      preprocessor and save the configuration in the settings file, but,
      instead of doing the same for CPP, we had hardcoded in GHC that the CPP
      program was either `cc -E` or `cpp`.
      
      This commit fixes that asymmetry by also configuring CPP at configure
      time, and tries to make more explicit the difference between HsCpp and
      Cpp (see Note [Preprocessing invocations]).
      
      Note that we don't use the standard CPP and CPPFLAGS to configure Cpp,
      but instead use the non-standard --with-cpp and --with-cpp-flags.
      The reason is that autoconf sets CPP to "$CC -E", whereas we expect the
      CPP command to be configured as a standalone executable rather than a
      command. These are symmetrical with --with-hs-cpp and
      --with-hs-cpp-flags.
      
      Cleanup: Hadrian no longer needs to pass the CPP configuration for CPP
               to be C99 compatible through -optP, since we now configure that
               into settings.
      
      Closes #23422
      5ffc7d7b
  9. Jun 28, 2023
    • Rodrigo Mesquita's avatar
      Stop configuring unused Ld command in `settings` · ecdc4353
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      GHC has no direct dependence on the linker. Rather, we depend upon the C
      compiler for linking and an object-merging program (which is typically
      `ld`) for production of GHCi objects and merging of C stubs into final
      object files.
      
      Despite this, for historical reasons we still recorded information about
      the linker into `settings`. Remove these entries from `settings`,
      `hadrian/cfg/system.config`, as well as the `configure` logic
      responsible for this information.
      
      Closes #23566.
      ecdc4353
  10. Jun 21, 2023
  11. Jun 20, 2023
    • Ben Gamari's avatar
      hadrian: Ensure that -Werror is passed when compiling the RTS. · 94f00e9b
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Previously the `+werror` transformer would only pass `-Werror` to GHC,
      which does not ensure that the same is passed to the C compiler when
      building the RTS. Arguably this is itself a bug but for now we will just
      work around this by passing `-optc-Werror` to GHC.
      
      I tried to enable `-Werror` in all C compilations but the boot libraries
      are something of a portability nightmare.
      94f00e9b
  12. Jun 19, 2023
    • Finley McIlwaine's avatar
      IPE data compression · cb9e1ce4
      Finley McIlwaine authored
      IPE data resulting from the `-finfo-table-map` flag may now be
      compressed by configuring the GHC build with the
      `--enable-ipe-data-compression` flag. This results in about a 20%
      reduction in the size of IPE-enabled build results.
      
      The compression library, zstd, may optionally be statically linked by
      configuring with the `--enabled-static-libzstd` flag (on non-darwin
      platforms)
      
      libzstd version 1.4.0 or greater is required.
      cb9e1ce4
  13. Jun 07, 2023
  14. Jun 06, 2023
  15. Jun 03, 2023
  16. Jun 01, 2023
    • Finley McIlwaine's avatar
      Add IPE compression to configure · 5d1f2411
      Finley McIlwaine authored and Marge Bot's avatar Marge Bot committed
      Reference ticket #21766
      
      Adds an `--enable-ipe-data-compreesion` flag to the configure script
      which will check for libzstd and set the appropriate flags to allow for
      IPE data compression in the compiler
      5d1f2411
  17. May 30, 2023
    • Ben Gamari's avatar
      Move via-C flags into GHC · 6629f1c5
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      These were previously hardcoded in configure (with no option for
      overriding them) and simply passed onto ghc through the settings file.
      
      Since configure already guarantees gcc supports those flags, we simply
      move them into GHC.
      6629f1c5
  18. May 25, 2023
    • Matthew Pickering's avatar
      rts: Build ticky GHC with single-threaded RTS · dc3422d4
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      The threaded RTS allows you to use ticky profiling but only for the
      counters in the generated code. The counters used in the C portion of
      the RTS are disabled. Updating the counters is also racy using the
      threaded RTS which can lead to misleading or incorrect ticky results.
      
      Therefore we change the hadrian flavour to build using the
      single-threaded RTS (mainly in order to get accurate C code counter
      increments)
      
      Fixes #23430
      dc3422d4
  19. May 23, 2023
  20. May 12, 2023
    • Alexis King's avatar
      hadrian: Fix linker script flag for MergeObjects builder · 59aa4676
      Alexis King authored and Marge Bot's avatar Marge Bot committed
      This fixes what appears to have been a typo in !9530. The `-t` flag just
      enables tracing on all versions of `ld` I’ve looked at, while `-T` is
      used to specify a linker script. It seems that this worked anyway for
      some reason on some `ld` implementations (perhaps because they
      automatically detect linker scripts), but the missing `-T` argument
      causes `gold` to complain.
      59aa4676
    • Ben Gamari's avatar
      hadrian: Fix mention of non-existent removeFiles function · c6cf9433
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Previously Hadrian's bindist Makefile referred to a `removeFiles`
      function that was previously defined by the `make` build system. Since
      the `make` build system is no longer around, this function is now
      undefined. Naturally, make being make, this appears to be silently
      ignored instead of producing an error.
      
      Fix this by rewriting it to `rm -f`.
      
      Closes #23373.
      c6cf9433
  21. May 11, 2023
    • Cheng Shao's avatar
      hadrian: fix no_dynamic_libs flavour transformer · 1bb24432
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      This patch fixes the no_dynamic_libs flavour transformer and make
      fully_static reuse it. Previously building with no_dynamic_libs fails
      since ghc program is still dynamic and transitively brings in dyn ways
      of rts which are produced by no rules.
      1bb24432
    • Rodrigo Mesquita's avatar
      Move "target has RTS linker" out of settings · c17bb82f
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      We move the "target has RTS linker" information out of configure into a
      predicate in GHC, and remove this option from the settings file where it
      is unnecessary -- it's information statically known from the platform.
      
      Note that previously we would consider `powerpc`s and `s390x`s other
      than `powerpc-ibm-aix*` and `s390x-ibm-linux` to have an RTS linker,
      but the RTS linker supports neither platform.
      
      Closes #23361
      c17bb82f
  22. May 04, 2023
    • Rodrigo Mesquita's avatar
      Add hashes to unit-ids created by hadrian · db4be339
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      This commit adds support for computing an inputs hash for packages
      compiled by hadrian. The result is that ABI incompatible packages should
      be given different hashes and therefore be distinct in a cabal store.
      
      Hashing is enabled by the `--flag`, and is off by default as the hash
      contains a hash of the source files. We enable it when we produce
      release builds so that the artifacts we distribute have the right unit
      ids.
      db4be339
    • Rodrigo Mesquita's avatar
      Hardwire a better unit-id for ghc · 3fdb18f8
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      Previously, the unit-id of ghc-the-library was fixed as `ghc`.
      This was done primarily because the compiler must know the unit-id of
      some packages (including ghc) a-priori to define wired-in names.
      
      However, as seen in #20742, a reinstallable `ghc` whose unit-id is fixed
      to `ghc` might result in subtle bugs when different ghc's interact.
      
      A good example of this is having GHC_A load a plugin compiled by GHC_B,
      where GHC_A and GHC_B are linked to ghc-libraries that are ABI
      incompatible. Without a distinction between the unit-id of the ghc library
      GHC_A is linked against and the ghc library the plugin it is loading was
      compiled against, we can't check compatibility.
      
      This patch gives a slightly better unit-id to ghc (ghc-version) by
      (1) Not setting -this-unit-id to ghc, but rather to the new unit-id (modulo stage0)
      (2) Adding a definition to `GHC.Settings.Config` whose value is the new unit-id.
          (2.1) `GHC.Settings.Config` is generated by Hadrian
          (2.2) and also by cabal through `compiler/Setup.hs`
      This unit-id definition is imported by `GHC.Unit.Types` and used to
      set the wired-in unit-id of "ghc", which was previously fixed to "ghc"
      
      The commits following this one will improve the unit-id with a
      cabal-style package hash and check compatibility when loading plugins.
      
      Note that we also ensure that ghc's unit key matches unit id both when
      hadrian or cabal builds ghc, and in this way we no longer need to add
      `ghc` to the WiringMap.
      3fdb18f8
    • Matthew Pickering's avatar
      hadrian: Flavour: Change args -> extraArgs · 8cc9a534
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      Previously in a flavour definition you could override all the flags
      which were passed to GHC. This causes issues when needed to compute a
      package hash because we need to know what these extra arguments are
      going to be before computing the hash. The solution is to modify flavour
      so that the arguments you pass here are just extra ones rather than all
      the arguments that you need to compile something.
      
      This makes things work more like how cabal.project files work when you
      give extra arguments to a package and also means that flavour
      transformers correctly affect the hash.
      8cc9a534
    • amesgen's avatar
      Fix unlit path in cross bindists · 8fde4ac8
      amesgen authored and Marge Bot's avatar Marge Bot committed
      8fde4ac8
  23. Apr 27, 2023
    • Cheng Shao's avatar
      testsuite: add the req_ghc_with_threaded_rts predicate · aa6afe8a
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      This patch adds the req_ghc_with_threaded_rts predicate to the
      testsuite to assert the platform has threaded RTS, and mark some tests
      as req_ghc_with_threaded_rts. Also makes ghc_with_threaded_rts a
      config field instead of a global variable.
      aa6afe8a
  24. Apr 25, 2023
  25. Apr 24, 2023
  26. Apr 20, 2023
    • sheaf's avatar
      Implement -jsem: parallelism controlled by semaphores · 5c873124
      sheaf authored and Marge Bot's avatar Marge Bot committed
      See https://github.com/ghc-proposals/ghc-proposals/pull/540/ for a
      complete description for the motivation for this feature.
      
      The `-jsem` option allows a build tool to pass a semaphore to GHC which
      GHC can use in order to control how much parallelism it requests.
      
      GHC itself acts as a client in the GHC jobserver protocol.
      
      ```
      GHC Jobserver Protocol
      ~~~~~~~~~~~~~~~~~~~~~~
      
      This proposal introduces the GHC Jobserver Protocol. This protocol allows
      a server to dynamically invoke many instances of a client process,
      while restricting all of those instances to use no more than <n> capabilities.
      This is achieved by coordination over a system semaphore (either a POSIX
      semaphore [6]_  in the case of Linux and Darwin, or a Win32 semaphore [7]_
      in the case of Windows platforms).
      
      There are two kinds of participants in the GHC Jobserver protocol:
      
      - The *jobserver* creates a system semaphore with a certain number of
        available tokens.
      
        Each time the jobserver wants to spawn a new jobclient subprocess, it **must**
        first acquire a single token from the semaphore, before spawning
        the subprocess. This token **must** be released once the subprocess terminates.
      
        Once work is finished, the jobserver **must** destroy the semaphore it created.
      
      - A *jobclient* is a subprocess spawned by the jobserver or another jobclient.
      
        Each jobclient starts with one available token (its *implicit token*,
        which was acquired by the parent which spawned it), and can request more
        tokens through the Jobserver Protocol by waiting on the semaphore.
      
        Each time a jobclient wants to spawn a new jobclient subprocess, it **must**
        pass on a single token to the child jobclient. This token can either be the
        jobclient's implicit token, or another token which the jobclient acquired
        from the semaphore.
      
        Each jobclient **must** release exactly as many tokens as it has acquired from
        the semaphore (this does not include the implicit tokens).
      ```
      
      Build tools such as cabal act as jobservers in the protocol and are
      responsibile for correctly creating, cleaning up and managing the
      semaphore.
      
      Adds a new submodule (semaphore-compat) for managing and interacting
      with semaphores in a cross-platform way.
      
      Fixes #19349
      5c873124
    • Matthew Pickering's avatar
      hadrian: Pass haddock file arguments in a response file · f15b0ce5
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      In !10119 CI was failing on windows because the command line was too
      long. We can mitigate this by passing the file arguments to haddock in a
      response file.
      
      We can't easily pass all the arguments in a response file because the
      `+RTS` arguments can't be placed in the response file.
      
      Fixes #23273
      f15b0ce5
Loading