summaryrefslogtreecommitdiff
path: root/hadrian
Commit message (Collapse)AuthorAgeFilesLines
* hadrian: Improve error for wrong key/value errors.Andreas Klebinger2022-10-221-1/+2
|
* Avoid Data.List.group; prefer Data.List.NonEmpty.groupBodigrim2022-09-281-3/+3
| | | | | This allows to avoid further partiality, e. g., map head . group is replaced by map NE.head . NE.group, and there are less panic calls.
* Update filepath to filepath-1.4.100.0Matthew Pickering2022-09-222-6/+1
| | | | | | | | | | Updates submodule * Always rely on vendored filepath * filepath must be built as stage0 dependency because it uses template-haskell. Towards #22098
* hadrian: Add extra_dependencies edges for all different waysMatthew Pickering2022-09-201-4/+8
| | | | | | | | | | | | | | | | | | | | The hack to add extra dependencies needed by DeriveLift extension missed the cases for profiles and dynamic ways. For the profiled way this leads to errors like: ``` GHC error in desugarer lookup in Data.IntSet.Internal: Failed to load interface for ‘Language.Haskell.TH.Lib.Internal’ Perhaps you haven't installed the profiling libraries for package ‘template-haskell’? Use -v (or `:set -v` in ghci) to see a list of the files searched for. ghc: panic! (the 'impossible' happened) GHC version 9.5.20220916: initDs ``` Therefore the fix is to add these extra edges in. Fixes #22197
* Hadrian: merge archives even in stage 0sheaf2022-09-203-7/+17
| | | | | | | | | | | | | | | | We now always merge .a archives when ar supports -L. This change is necessary in order to bootstrap GHC using GHC 9.4 on Windows, as nested archives aren't supported. Not doing so triggered bug #21990 when trying to use the Win32 package, with errors such as: Not a x86_64 PE+ file. Unknown COFF 4 type in getHeaderInfo. ld.lld: error: undefined symbol: Win32zm2zi12zi0zi0_SystemziWin32ziConsoleziCtrlHandler_withConsoleCtrlHandler1_info We have to be careful about which ar is meant: in stage 0, the check should be done on the system ar (system-ar in system.config).
* rts: make threaded ways optionalCheng Shao2022-09-171-0/+1
| | | | | | | For certain targets (e.g. wasm32-wasi), the threaded rts is known not to work. This patch adds a "threaded" cabal flag to rts to make threaded rts ways optional. Hadrian enables this flag iff the flavour rtsWays contains threaded ways.
* Hadrian: Don't try to build terminfo on Windowssheaf2022-09-161-2/+1
| | | | | Commit b42cedbe introduced a dependency on terminfo on Windows, but that package isn't available on Windows.
* hadrian: relax Cabal upper bound to allow building with Cabal-3.8Cheng Shao2022-09-161-1/+1
| | | | A follow up of !8910.
* hadrian: add late_ccs flavour transformerCheng Shao2022-09-161-0/+1
|
* hadrian: enable -fprof-late only for profiling waysCheng Shao2022-09-161-1/+1
|
* Unbreak Hadrian with Cabal 3.8.M Farkas-Dyck2022-09-141-0/+4
|
* hadrian: Add extra implicit dependencies from DeriveLiftMatthew Pickering2022-09-142-2/+30
| | | | | | | ghc -M should know that modules which use DeriveLift (or TemplateHaskellQuotes) need TH.Lib.Internal but until it does, we have to add these extra edges manually or the modules will be compiled before TH.Lib.Internal is compiled which leads to a desugarer error.
* hadrian: Need builders needed by Cabal Configure in parallelMatthew Pickering2022-09-144-29/+31
| | | | | | | | | | | | | Because of the use of withStaged (which needs the necessary builder) when configuring a package, the builds of stage1:exe:ghc-bin and stage1:exe:ghc-pkg where being linearised when building a specific target like `binary-dist-dir`. Thankfully the fix is quite local, to supply all the `withStaged` arguments together so the needs can be batched together and hence performed in parallel. Fixes #22093
* hadrian: Add some more packages to multi-cradleMatthew Pickering2022-09-142-11/+12
| | | | | | The main improvement here is to pass `-this-unit-id` for executables so that they can be added to the multi-cradle if desired as well as normal library packages.
* hadrian: Inplace/Final package databasesMatthew Pickering2022-09-1428-153/+318
| | | | | | | | | | | | | | | | | | | | | There are now two different package databases per stage. An inplace package database contains .conf files which point directly into the build directories. The final package database contains .conf files which point into the installed locations. The inplace .conf files are created before any building happens and have fake ABI hash values. The final .conf files are created after a package finished building and contains the proper ABI has. The motivation for this is to make the dependency structure more fine-grained when building modules. Now a module depends just depends directly on M.o from package p rather than the .conf file depend on the .conf file for package p. So when all of a modules direct dependencies have finished building we can start building it rather than waiting for the whole package to finish. The secondary motivation is that the multi-repl doesn't need to build everything before starting the multi-repl session. We can just configure the inplace package-db and use that in order to start the repl.
* hadrian: Use a stamp file to record when a package is built in a certain wayMatthew Pickering2022-09-145-4/+92
| | | | | | | | | | | Before this patch which library ways we had built wasn't recorded directly. So you would run into issues if you build the .conf file with some library ways before switching the library ways which you wanted to build. Now there is one stamp file for each way, so in order to build a specific way you can need that specific stamp file rather than going indirectly via the .conf file.
* hadrian: Bump index stateMatthew Pickering2022-09-141-1/+1
| | | | | | | This bumps the index state so a build plan can also be found when booting with 9.4. Fixes #22165
* Make ghcDebugAssertions into a Stage predicate (Stage -> Bool)Matthew Pickering2022-08-317-11/+14
| | | | | | | | | | We also care whether we have debug assertions enabled for a stage one compiler, but the way which we turned on the assertions was quite different from the stage2 compiler. This makes the logic for turning on consistent across both and has the advantage of being able to correct determine in in-tree args whether a flavour enables assertions or not. Ticket #22096
* Refine in-tree compiler args for --test-compiler=stage1Matthew Pickering2022-08-311-4/+6
| | | | | | | | | Some of the logic to calculate in-tree arguments was not correct for the stage1 compiler. Namely we were not correctly reporting whether we were building static or dynamic executables and whether debug assertions were enabled. Fixes #22096
* Various Hadrian bootstrapping fixessheaf2022-08-301-14/+22
| | | | | | | | | | - Don't always produce a distribution archive (#21629) - Use correct executable names for ghc-pkg and hsc2hs on windows (we were missing the .exe file extension) - Fix a bug where we weren't using the right archive format on Windows when unpacking the bootstrap sources. Fixes #21629
* Drop mk/{build,install,config}.mk.inBen Gamari2022-08-251-2/+0
|
* hadrian: Fix whitespaceBen Gamari2022-08-251-33/+32
| | | | Previously this region of Settings.Packages was incorrectly indented.
* hadrian: Don't duplicate binaries on installationBen Gamari2022-08-221-1/+5
| | | | | | | Previously we used `install` on symbolic links, which ended up copying the target file rather than installing a symbolic link. Fixes #22062.
* hadrian: Fix bootstrapping with ghc-9.4Matthew Pickering2022-08-211-0/+1
| | | | | | | | | | | The error was that we were trying to link together containers from boot package library (which depends template-haskell in boot package library) template-haskell from in-tree package database So the fix is to build containers in stage0 (and link against template-haskell built in stage0). Fixes #21981
* haddock docs: Fix links from identifiers to dependent packagesMatthew Pickering2022-08-192-6/+5
| | | | | | | | | When implementing the base_url changes I made the pretty bad mistake of zipping together two lists which were in different orders. The simpler thing to do is just modify `haddockDependencies` to also return the package identifier so that everything stays in sync. Fixes #22001
* compiler: Drop --build-id=none hackBen Gamari2022-08-183-3/+0
| | | | | | | | | Since 2011 the object-joining implementation has had a hack to pass `--build-id=none` to `ld` when supported, seemingly to work around a linker bug. This hack is now unnecessary and may break downstream users who expect objects to have valid build-ids. Remove it. Closes #22060.
* hadrian: Place manpage in docrootBen Gamari2022-08-161-1/+1
| | | | This relocates it from docs/ to doc/
* hadrian: Don't attempt to install documentation if doc/ doesn't existBen Gamari2022-08-101-4/+6
| | | | | | | | | Previously we would attempt to install documentation even if the `doc` directory doesn't exist (e.g. due to `--docs=none`). This would result in the surprising side-effect of the entire contents of the bindist being installed in the destination documentation directory. Fix this. Fixes #21976.
* hadrian RunRest: add type signature for stageNumberJens Petersen2022-08-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | avoids warning seen on 9.4.1: src/Settings/Builders/RunTest.hs:264:53: warning: [-Wtype-defaults] • Defaulting the following constraints to type ‘Integer’ (Show a0) arising from a use of ‘show’ at src/Settings/Builders/RunTest.hs:264:53-84 (Num a0) arising from a use of ‘stageNumber’ at src/Settings/Builders/RunTest.hs:264:59-83 • In the second argument of ‘(++)’, namely ‘show (stageNumber (C.stage ctx))’ In the second argument of ‘($)’, namely ‘"config.stage=" ++ show (stageNumber (C.stage ctx))’ In the expression: arg $ "config.stage=" ++ show (stageNumber (C.stage ctx)) | 264 | , arg "-e", arg $ "config.stage=" ++ show (stageNumber (C.stage ctx)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ compilation tested locally
* hadrian: Fix access mode of installed package registration filesBen Gamari2022-08-091-0/+2
| | | | | | | | Previously hadrian's bindist Makefile would modify package registrations placed by `install` via a shell pipeline and `mv`. However, the use of `mv` means that if umask is set then the user may otherwise end up with package registrations which are inaccessible. Fix this by ensuring that the mode is 0644.
* hadrian: Fix bindist installation on DarwinBen Gamari2022-08-093-46/+7
| | | | | | | It turns out that `cp -P` on Darwin does not always copy a symlink as a symlink. In order to get these semantics one must pass `-RP`. It's not entirely clear whether this is valid under POSIX, but it is nevertheless what Apple does.
* hadrian: Extend xattr Darwin hack to cover /libBen Gamari2022-08-071-1/+7
| | | | | | | As noted in #21506, it is now necessary to remove extended attributes from `/lib` as well as `/bin` to avoid SIP issues on Darwin. Fixes #21506.
* hadrian: Fix naming of cross-compiler wrapperswip/cross-bindistBen Gamari2022-08-072-16/+22
|
* hadrian: Don't use mk/config.mk.inBen Gamari2022-08-073-2/+291
| | | | | | Ultimately we want to drop mk/config.mk so here I extract the bits needed by the Hadrian bindist installation logic into a Hadrian-specific file. While doing this I fixed binary distribution installation, #21901.
* hadrian: Fix installation of system-cxx-std-lib package confBen Gamari2022-08-071-1/+1
|
* hadrian: Fix binary distribution install attributesBen Gamari2022-08-071-36/+60
| | | | | | | | | Previously we would use plain `cp` to install various parts of the binary distribution. However, `cp`'s behavior w.r.t. file attributes is quite unclear; for this reason it is much better to rather use `install`. Fixes #21965.
* testsuite: Correctly set withNativeCodeGenMatthew Pickering2022-08-021-1/+5
| | | | Fixes #21918
* hadrian: add flag disabling selftest rules which require QuickChecksternenseemann2022-07-262-3/+18
| | | | | | | | | | | | | | | | The hadrian executable depends on QuickCheck for building, meaning this library (and its dependencies) will need to be built for bootstrapping GHC in the future. Building QuickCheck, however, can require TemplateHaskell. When building a statically linking GHC toolchain, TemplateHaskell can be tricky to get to work, and cross-compiling TemplateHaskell doesn't work at all without -fexternal-interpreter, so QuickCheck introduces an element of fragility to GHC's bootstrap. Since the selftest rules are the only part of hadrian that need QuickCheck, we can easily eliminate this bootstrap dependency when required by introducing a `selftest` flag guarding the rules' inclusion. Closes #8699.
* Fix #21889, GHCi misbehaves with Ctrl-C on WindowsZubin Duggal2022-07-252-6/+29
| | | | | | | | | | | | | | | | | | | | | | On Windows, we create multiple levels of wrappers for GHCi which ultimately execute ghc --interactive. In order to handle console events properly, each of these wrappers must call FreeConsole() in order to hand off event processing to the child process. See #14150. In addition to this, FreeConsole must only be called from interactive processes (#13411). This commit makes two changes to fix this situation: 1. The hadrian wrappers generated using `hadrian/bindist/cwrappers/version-wrapper.c` call `FreeConsole` if the CPP flag INTERACTIVE_PROCESS is set, which is set when we are generating a wrapper for GHCi. 2. The GHCi wrapper in `driver/ghci/` calls the `ghc-$VER.exe` executable which is not wrapped rather than calling `ghc.exe` is is wrapped on windows (and usually non-interactive, so can't call `FreeConsole`: Before: ghci-$VER.exe calls ghci.exe which calls ghc.exe which calls ghc-$VER.exe After: ghci-$VER.exe calls ghci.exe which calls ghc-$VER.exe
* Hadrian: don't try to build "unix" on Windowssheaf2022-07-221-26/+26
|
* hadrian: Add multi:<pkg> and multi targets for starting a multi-replMatthew Pickering2022-07-187-29/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support to hadrian for starting a multi-repl containing all the packages which stage0 can build. In particular, there is the new user-facing command: ``` ./hadrian/ghci-multi ``` which when executed will start a multi-repl containing the `ghc` package and all it's dependencies. This is implemented by two new hadrian targets: ``` ./hadrian/build multi:<pkg> ``` Construct the arguments for a multi-repl session where the top-level package is <pkg>. For example, `./hadrian/ghci-multi` is implemented using `multi:ghc` target. There is also the `multi` command which constructs a repl for everything in stage0 which we can build.
* hadrian: Rename documentation directories for consistency with makeBen Gamari2022-07-175-11/+11
| | | | | | | * Rename `docs` to `doc` * Place pdf documentation in `doc/` instead of `doc/pdfs/` Fixes #21164.
* Hadrian: update documentation of settingssheaf2022-07-133-102/+117
| | | | | | | | | | The documentation for key-value settings was a bit out of date. This patch updates it to account for `cabal.configure.opts` and `hsc2hs.run.opts`. The user-settings document was also re-arranged, to make the key-value settings more prominent (as it doesn't involve changing the Hadrian source code, and thus doesn't require any recompilation of Hadrian).
* tarballEric Lindblad2022-07-131-3/+6
|
* fix bootstrapEric Lindblad2022-07-131-4/+12
|
* fix readmeEric Lindblad2022-07-131-3/+3
|
* Fix lint warnings in bootstrap.pyMatthew Pickering2022-07-061-4/+3
|
* sourcesEric Lindblad2022-07-061-2/+3
|
* grammarEric Lindblad2022-07-061-1/+1
|
* options and typosEric Lindblad2022-07-061-5/+5
|