summaryrefslogtreecommitdiff
path: root/hadrian
Commit message (Collapse)AuthorAgeFilesLines
* Fix stage1-testZubin Duggal2022-02-051-6/+4
|
* more fixesZubin Duggal2022-02-051-0/+1
|
* reinstallable Setup.hsZubin Duggal2022-02-0526-206/+390
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix cabal file fix cabal file Move CodeGen.Platform.hs to compiler/ make cabal sdist work Remove unnecessary GHC_STAGE guards Remove unnecessary rts dependency hadrian: add 'build-cabal' rule to allow building and testing reinstallable GHC executables ci: add nightly job to test reinstallable GHC test ci REVERT ME Reinstallable ghc-boot + libraries Loader integrity wip (#20742) hadrian: Run custom Setup.hs hadrian: Move logic into Custom Setup.hs WIP hadrian: don't call genapply and genprimops in Custom setup with hadrian Loader integrity wip (#20742) hadrian: Run custom Setup.hs hadrian: Move logic into Custom Setup.hs WIP hadrian: don't call genapply and genprimops in Custom setup with hadrian Add -fdisable-strict-loader-integrity-check Fix hadrian/ghci Misc improvements more fixes more fixes
* hadrian: detect if 'main' is not a haskell file and add it to appropriate ↵Zubin Duggal2022-02-051-3/+13
| | | | list of sources
* testsuite: Run testsuite dependency calculation before GHC is builtMatthew Pickering2022-02-044-41/+175
| | | | | | | | | | | | | | | | | | | | The main motivation for this patch is to allow tests to be added to the testsuite which test things about the source tree without needing to build GHC. In particular the notes linter can easily start failing and by integrating it into the testsuite the process of observing these changes is caught by normal validation procedures rather than having to run the linter specially. With this patch I can run ``` ./hadrian/build test --flavour=devel2 --only="uniques" ``` In a clean tree to run the checkUniques linter without having to build GHC. Fixes #21029
* Fix a few Note inconsistenciesBen Gamari2022-02-014-4/+1
|
* Rip out remaining SPARC supportBen Gamari2022-01-292-3/+2
|
* rts: Refactor event typesBen Gamari2022-01-292-0/+13
| | | | | | Previously we would build the eventTypes array at runtime during RTS initialization. However, this is completely unnecessary; it is completely static data.
* hadrian: Allow testing of the stage1 compiler (#20755)Zubin Duggal2022-01-265-43/+73
|
* Pass config.stage argument to testsuiteMatthew Pickering2022-01-261-0/+1
|
* alwaysRerun generation of ghcconfigMatthew Pickering2022-01-261-0/+1
| | | | | | This file needs to match exactly what is passed as the testCompiler. Before this change the settings for the first compiler to be tested woudl be stored and not regenerated if --test-compiler changed.
* Hadrian: update the index-state to allow building with GHC 9.0.2Ryan Scott2022-01-241-1/+1
| | | | Fixes #20984.
* hadrian BinaryDist: version ghc in ghciScriptWrapperJens Petersen2022-01-181-2/+4
| | | | | | like we do for the non-Hadrian wrapper script. Otherwise if $bindir/ghc is a different ghc version then versioned ghci will incorrectly run the other ghc version instead. (Normally this would only happen if there are parallel ghc versions installed in bindir.) All the other wrapper scripts already have versioned executablename
* hadrian: Include bash completion script in bindistBen Gamari2022-01-131-0/+5
| | | | See #20802.
* hadrian: Fully implement source distributions (#19317)Zubin Duggal2022-01-119-110/+202
| | | | | | We use `git ls-files` to get the list of files to include in the source distribution. Also implements the `-testsuite` and `-extra-tarballs` distributions.
* hadrian: allow offline bootstrappingZubin Duggal2022-01-115-64/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the ability to fetch and store dependencies needed for boostrapping hadrian. By default the script will download the dependencies from the network but some package managers disallow network access so there are also options to build given a supplied tarball. The -s option allos you to provide the tarball bootstrap.py -d plan-bootstrap-8.10.5.json -w /path/to-ghc -s sources-tarball.tar.gz Which dependencies you need can be queried using the `list-sources` option. bootstrap.py list-sources -d plan-bootstrap-8.10.5.json This produces `fetch_plan.json` which tells you where to get each source from. You can instruct the script to create the tarball using the `fetch` option. bootstrap.py fetch -d plan-bootstrap-8.10.5.json -o sources-tarball.tar.gz Together these commands mean you can build GHC without needing cabal-install. Fixes #17103
* hadrian: Add bootstrap scripts for building without cabal-installMatthew Pickering2022-01-1118-0/+695
| | | | | | | | | | | | | | | | | | | | | | | | | These scripts are originally from the cabal-install repo with a few small tweaks. This utility allows you to build hadrian without cabal-install, which can be useful for packagers. If you are a developer then build hadrian using cabal-install. If you want to bootstrap with ghc-8.10.5 then run the ./bootstrap script with the `plan-bootstrap-8.10.5.json` file. bootstrap.py -d plan-bootstrap-8.10.5.json -w /path/to-ghc The result of the bootstrap script will be a hadrian binary in `_build/bin/hadrian`. There is a script (using nix) which can be used to generate the bootstrap plans for the range of supported GHC versions using nix. generate_bootstrap_plans Otherwise you can run the commands in ./generate_bootstrap_plans directly. Fixes #17103
* Drop --configure from Hadrian docsAndrey Mokhov2021-12-123-28/+4
|
* Hadrian: Allow building with GHC 9.2Ryan Scott2021-12-093-3/+10
| | | | | | A separate issue is the fact that many of `hadrian`'s modules produce `-Wincomplete-uni-patterns` warnings under 9.2, but that is probably best left to a separate patch.
* hadrian: Don't rely on realpath in bindist MakefileBen Gamari2021-12-022-4/+5
| | | | | | | | As noted in #19963, `realpath` is not specified by POSIX and therefore cannot be assumed to be available. Here we provide a POSIX shell implementation of `realpath`, due to Julian Ospald and others. Closes #19963.
* hadrian: Document fully_static flavour transformerBen Gamari2021-12-011-0/+4
|
* hadrian: Don't pass empty paths via -IBen Gamari2021-12-011-2/+2
| | | | | Previously we could in some cases add empty paths to `cc`'s include file search path. See #20578.
* Make ambient MinGW support a proper settingsJohn Ericson2021-11-275-8/+6
| | | | | | | Get rid of `USE_INPLACE_MINGW_TOOLCHAIN` and use a settings file entry instead. The CPP setting was originally introduced in f065b6b012.
* hadrian: Add `collect_stats` flavour transformerSebastian Graf2021-11-252-0/+20
| | | | | This is useful for later consumption with https://gitlab.haskell.org/bgamari/ghc-utils/-/blob/master/ghc_timings.py
* Hadrian: bump stackage LTS to 18.18 (GHC 8.10.7)Sylvain Henry2021-11-222-7/+7
|
* Hadrian: bring up to date with latest make improvementsJohn Ericson2021-11-1816-128/+102
| | | | | | | | Headers should be associated with the RTS, and subject to less hacks. The most subtle issue was that the package-grained dependencies on generated files were being `need`ed before calculating Haskell deps, but not before calculating C/C++ deps.
* hadrian: add threadedDebug RTS way to devel compilersZubin Duggal2021-11-181-1/+1
|
* hadrian: Ensure that term.h is in include search pathBen Gamari2021-11-174-6/+19
| | | | | | | | | terminfo now requires term.h but previously neither build system offered any way to add the containing directory to the include search path. Fix this in Hadrian. Also adds libnuma includes to global include search path as it was inexplicably missing earlier.
* hadrian: Factor out --extra-*-dirs=... patternBen Gamari2021-11-171-9/+19
| | | | We repeated this idiom quite a few times. Give it a name.
* Hadrian: fix windows cross-build (#20657)Sylvain Henry2021-11-1510-75/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many small things to fix: * Hadrian: platform triple is "x86_64-w64-mingw32" and this wasn't recognized by Hadrian (note "w64" instead of "unknown") * Hadrian was using the build platform ("isWindowsHost") to detect the use of the Windows toolchain, which was wrong. We now use the "targetOs" setting. * Hadrian was doing the same thing for Darwin so we fixed both at once, even if cross-compilation to Darwin is unlikely to happen afaik (cf "osxHost" vs "osxTarget" changes) * Hadrian: libffi name was computed in two different places and one of them wasn't taking the different naming on Windows into account. * Hadrian was passing "-Irts/include" when building the stage1 compiler leading to the same error as in #18143 (which is using make). stage1's RTS is stage0's one so mustn't do this. * Hadrian: Windows linker doesn't seem to support "-zorigin" so we don't pass it (similarly to Darwin) * Hadrian: hsc2hs in cross-compilation mode uses a trick (taken from autoconf): it defines "static int test_array[SOME_EXPR]" where SOME_EXPR is a constant expression. However GCC reports an error because SOME_EXPR is supposedly not constant. This is fixed by using another method enabled with the `--via-asm` flag of hsc2hs. It has been fixed in `make` build system (5f6fcf7808b16d066ad0fb2068225b3f2e8363f7) but not in Hadrian. * Hadrian: some packages are specifically built only on Windows but they shouldn't be when building a cross-compiler (`touchy` and `ghci-wrapper`). We now correctly detect this case and disable these packages. * Base: we use `iNVALID_HANDLE_VALUE` in a few places. It fixed some hsc2hs issues before we switched to `--via-asm` (see above). I've kept these changes are they make the code nicer. * Base: `base`'s configure tries to detect if it is building for Windows but for some reason the `$host_alias` value is `x86_64-windows` in my case and it wasn't properly detected. * Base: libraries/base/include/winio_structs.h imported "Windows.h" with a leading uppercase. It doesn't work on case-sensitive systems when cross-compiling so we have to use "windows.h". * RTS: rts/win32/ThrIOManager.c was importin "rts\OSThreads.h" but this path isn't valid when cross-compiling. We replaced "\" with "/". * DeriveConstants: this tool derives the constants from the target RTS header files. However these header files define `StgAsyncIOResult` only when `mingw32_HOST_OS` is set hence it seems we have to set it explicitly. Note that deriveConstants is called more than once (why? there is only one target for now so it shouldn't) and in the second case this value is correctly defined (probably coming indirectly from the import of "rts/PosixSource.h"). A better fix would probably be to disable the unneeded first run of deriveconstants.
* Delete dead code knobs for building GHC itselfJohn Ericson2021-11-151-6/+0
| | | | | As GHC has become target agnostic, we've left behind some now-useless logic in both build systems.
* Generate ghcversion.h with the top-level configureJohn Ericson2021-11-125-51/+13
| | | | | | | | | | | | | | This is, rather unintuitively, part of the goal of making the packages that make of the GHC distribution more freestanding. `ghcversion.h` is very simple, so we easily can move it out of the main build systems (make and Hadrian). By doing so, the RTS becomes less of a special case to those build systems as the header, already existing in the source tree, appears like any other. We could do this with the upcomming RTS configure, but it hardly matters because there is nothing platform-specific here, it is just versioning information like the other files the top-level configure can be responsible for.
* hadrian: use /bin/sh in timeout wrapperCheng Shao2021-11-121-1/+1
| | | | /usr/bin/env doesn't work within a nix build.
* Hadrian: fix building/registering of .dll librariesSylvain Henry2021-11-101-14/+15
|
* Don't expose bignum backend in ghc --info (#20495)Sylvain Henry2021-11-092-2/+0
| | | | | | | GHC is bignum backend agnostic and shouldn't report this information as in the future ghc-bignum will be reinstallable potentially with a different backend that GHC is unaware of. Moreover as #20495 shows the returned information may be wrong currently.
* Avoid GHC_STAGE and other include bitsJohn Ericson2021-11-051-2/+0
| | | | | | | | | We should strive to make our includes in terms of the RTS as much as possible. One place there that is not possible, the llvm version, we make a new tiny header Stage numbers are somewhat arbitrary, if we simple need a newer RTS, we should say so.
* hadrian: Use $bindir instead of `dirname $0` in ghci wrapperARATA Mizuki2021-11-031-2/+1
| | | | | | `dirname $0` doesn't work when the wrapper is called via a symbolic link. Fix #20589
* make build system: RTS should use dist-install not distJohn Ericson2021-10-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This is the following find and replace: - `rts/dist` -> `rts/dist-install` # for paths - `rts_dist` -> `rts_dist-install` # for make rules and vars - `,dist` -> `,dist-install` # for make, just in rts/ghc.mk` Why do this? Does it matter when the RTS is just built once? The answer is, yes, I think it does, because I want the distdir--stage correspondence to be consistent. In particular, for #17191 and continuing from d5de970dafd5876ef30601697576167f56b9c132 I am going to make the headers (`rts/includes`) increasingly the responsibility of the RTS (hence their new location). However, those headers are current made for multiple stages. This will probably become unnecessary as work on #17191 progresses and the compiler proper becomes more of a freestanding cabal package (e.g. a library that can be downloaded from Hackage and built without any autoconf). However, until that is finished, we have will transitional period where the RTS and headers need to agree on dirs for multiple stages. I know the make build system is going away, but it's not going yet, so I need to change it to unblock things :).
* hadrian: Turn the `static` flavour into a transformerBen Gamari2021-10-274-60/+51
| | | | | This turns the `static` flavour into the `+fully_static` flavour transformer.
* hadrian: Fix binary-dist support for cross-compilersBen Gamari2021-10-202-7/+14
| | | | | | | | | Previously the logic which called ghc-pkg failed to account for the fact that the executable name may be prefixed with a triple. Moreover, the call must occur before we delete the settings file as ghc-pkg needs the latter. Fixes #20267.
* hadrian/doc: Add margin to staged-compilation figureBen Gamari2021-10-201-177/+203
|
* hadrian: Fix quoting in binary distribution installation MakefileBen Gamari2021-10-191-4/+4
| | | | | Previously we failed to quote various paths in Hadrian's installation Makefile, resulting in #20506.
* Don't print Shake Diagnostic messages (#20484)Zubin Duggal2021-10-191-0/+5
|
* hadrian: Document lint targetsMatthew Pickering2021-10-151-0/+14
| | | | Fixes #20508
* Hadrian: display command line above errors (#20490)Sylvain Henry2021-10-154-18/+127
|
* Make sure paths are quoted in install MakefileMatthew Pickering2021-10-141-1/+1
| | | | | | | | | | | | | | | Previously it would fail with this error: ``` if [ -L wrappers/ghc ]; then echo "ghc is a symlink"; fi ghc is a symlink cp: target 'dir/bin/ghc' is not a directory make: *** [Makefile:197: install_wrappers] Error 1 ``` which is because the install path contains a space. Fixes #20506
* hadrian: avoid building check-{exact,ppr} and count-deps when the tests ↵Zubin Duggal2021-10-132-20/+36
| | | | | | don't need them hadrian: build optional dependencies with test compiler
* ci: test in-tree compiler in hadrianZubin Duggal2021-10-135-33/+46
|
* hadrian: Fix location for haddocks in installed pkgconfsZubin Duggal2021-10-131-1/+1
|
* hadrian, testsuite: Teach Hadrian to query the testsuite driver for dependenciesZubin Duggal2021-10-135-20/+60
| | | | Issues #19072, #17728, #20176