summaryrefslogtreecommitdiff
path: root/libraries/ghc-boot
Commit message (Collapse)AuthorAgeFilesLines
* Fix GHCJS OS platform (fix #23346)Sylvain Henry2023-05-151-0/+2
|
* Implement executablePath for Solaris and make getBaseDir less platform-dependentPHO2023-04-231-12/+25
| | | | | | | | | | Use base-4.17 executablePath when possible, and fall back on getExecutablePath when it's not available. The sole reason why getBaseDir had #ifdef's was apparently that getExecutablePath wasn't reliable, and we could reduce the number of CPP conditionals by making use of executablePath instead. Also export executablePath on js_HOST_ARCH.
* JS: replace "js" architecture with "javascript"Sylvain Henry2023-02-061-1/+1
| | | | | | | | | | | | | | | Despite Cabal supporting any architecture name, `cabal --check` only supports a few built-in ones. Sadly `cabal --check` is used by Hackage hence using any non built-in name in a package (e.g. `arch(js)`) is rejected and the package is prevented from being uploaded on Hackage. Luckily built-in support for the `javascript` architecture was added for GHCJS a while ago. In order to allow newer `base` to be uploaded on Hackage we make the switch from `js` to `javascript` architecture. Fixes #22740. Co-authored-by: Ben Gamari <ben@smart-cactus.org>
* Fixes for cabal-reinstall CI jobMatthew Pickering2023-01-311-1/+1
| | | | | | | | * Allow filepath to be reinstalled * Bump some version bounds to allow newer versions of libraries * Rework testing logic to avoid "install --lib" and package env files Fixes #22344
* ghc-boot: Fix bootstrappingBen Gamari2022-12-211-3/+6
|
* base: Bump version to 4.18Ben Gamari2022-12-211-1/+1
| | | | Requires various submodule bumps.
* Add initial support for LoongArch Architecture.lrzlin2022-12-081-0/+2
|
* Add Javascript backendSylvain Henry2022-11-291-0/+5
| | | | | | | | | | | | | | | Add JS backend adapted from the GHCJS project by Luite Stegeman. Some features haven't been ported or implemented yet. Tests for these features have been disabled with an associated gitlab ticket. Bump array submodule Work funded by IOG. Co-authored-by: Jeffrey Young <jeffrey.young@iohk.io> Co-authored-by: Luite Stegeman <stegeman@gmail.com> Co-authored-by: Josh Meredith <joshmeredith2008@gmail.com>
* Review suggestions for assorted fixes to avoid Data.List.{head,tail}sheaf2022-11-252-6/+8
|
* Assorted fixes to avoid Data.List.{head,tail}Bodigrim2022-11-253-7/+10
|
* Add support for the wasm32-wasi target tupleCheng Shao2022-11-111-0/+4
| | | | | | This patch adds the wasm32-wasi tuple support to various places in the tree: autoconf, hadrian, ghc-boot and also the compiler. The codegen logic will come in subsequent commits.
* Bump unix submodule to 2.8.0.0Matthew Pickering2022-11-051-1/+1
| | | | | | | | | | Also bumps process and ghc-boot bounds on unix. For hadrian, when cross-compiling, we add -Wwarn=unused-imports -Wwarn=unused-top-binds to validation flavour. Further fixes in unix and/or hsc2hs is needed to make it completely free of warnings; for the time being, this change is needed to unblock other cross-compilation related work.
* Update submodule Cabal to tag Cabal-v3.8.1.0wip/9.4-foward-fixed-makeDouglas Wilson2022-08-311-1/+1
| | | | closes #21931
* Drop make build systemBen Gamari2022-08-251-58/+0
| | | | | | | | | | | Here we at long last remove the `make`-based build system, it having been replaced with the Shake-based Hadrian build system. Users are encouraged to refer to the documentation in `hadrian/doc` and this [1] blog post for details on using Hadrian. Closes #17527. [1] https://www.haskell.org/ghc/blog/20220805-make-to-hadrian.html
* Add a Note summarising GHC's UTF-8 implementationsBen Gamari2022-07-221-0/+5
| | | | | GHC has a somewhat dizzying array of UTF-8 implementations. This note describes why this is the case.
* base: Introduce GHC.Encoding.UTF8Ben Gamari2022-07-221-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here we copy a subset of the UTF-8 implementation living in `ghc-boot` into `base`, with the intent of dropping the former in the future. For this reason, the `ghc-boot` copy is now CPP-guarded on `MIN_VERSION_base(4,18,0)`. Naturally, we can't copy *all* of the functions defined by `ghc-boot` as some depend upon `bytestring`; we rather just copy those which only depend upon `base` and `ghc-prim`. Further consolidation? ---------------------- Currently GHC ships with at least five UTF-8 implementations: * the implementation used by GHC in `ghc-boot:GHC.Utils.Encoding`; this can be used at a number of types including `Addr#`, `ByteArray#`, `ForeignPtr`, `Ptr`, `ShortByteString`, and `ByteString`. Most of this can be removed in GHC 9.6+2, when the copies in `base` will become available to `ghc-boot`. * the copy of the `ghc-boot` definition now exported by `base:GHC.Encoding.UTF8`. This can be used at `Addr#`, `Ptr`, `ByteArray#`, and `ForeignPtr` * the decoder used by `unpackCStringUtf8#` in `ghc-prim:GHC.CString`; this is specialised at `Addr#`. * the codec used by the IO subsystem in `base:GHC.IO.Encoding.UTF8`; this is specialised at `Addr#` but, unlike the above, supports recovery in the presence of partial codepoints (since in IO contexts codepoints may be broken across buffers) * the implementation provided by the `text` library This does seem a tad silly. On the other hand, these implementations *do* materially differ from one another (e.g. in the types they support, the detail in errors they can report, and the ability to recover from partial codepoints). Consequently, it's quite unclear that further consolidate would be worthwhile.
* ghc-boot: Clean up UTF-8 codecsBen Gamari2022-07-224-302/+350
| | | | | | | | In preparation for moving the UTF-8 codecs into `base`: * Move them to GHC.Utils.Encoding.UTF8 * Make names more consistent * Add some Haddocks
* Bump ghc-prim and base versionsBen Gamari2022-06-271-1/+1
| | | | | | | | | To 0.9.0 and 4.17.0 respectively. Bumps array, deepseq, directory, filepath, haskeline, hpc, parsec, stm, terminfo, text, unix, haddock, and hsc2hs submodules. (cherry picked from commit ba47b95122b7b336ce1cc00896a47b584ad24095)
* typosEric Lindblad2022-05-011-2/+2
|
* ghc-boot: export typesynonyms from GHC.Utils.EncodingAdam Sandberg Ericsson2022-04-301-0/+2
| | | | This makes the Haddocks easier to understand.
* hi haddock: Lex and store haddock docs in interface filesZubin Duggal2022-03-231-1/+1
| | | | | | | | | | | | | | | | | | Names appearing in Haddock docstrings are lexed and renamed like any other names appearing in the AST. We currently rename names irrespective of the namespace, so both type and constructor names corresponding to an identifier will appear in the docstring. Haddock will select a given name as the link destination based on its own heuristics. This patch also restricts the limitation of `-haddock` being incompatible with `Opt_KeepRawTokenStream`. The export and documenation structure is now computed in GHC and serialised in .hi files. This can be used by haddock to directly generate doc pages without reparsing or renaming the source. At the moment the operation of haddock is not modified, that's left to a future patch. Updates the haddock submodule with the minimum changes needed.
* Reinstallable GHCZubin Duggal2022-02-212-4/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows ghc and its dependencies to be built using a normal invocation of cabal-install. Each componenent which relied on generated files or additional configuration now has a Setup.hs file. There are also various fixes to the cabal files to satisfy cabal-install. There is a new hadrian command which will build a stage2 compiler and then a stage3 compiler by using cabal. ``` ./hadrian/build build-cabal ``` There is also a new CI job which tests running this command. For the 9.4 release we will upload all the dependent executables to hackage and then end users will be free to build GHC and GHC executables via cabal. There are still some unresolved questions about how to ensure soundness when loading plugins into a reinstalled GHC (#20742) which will be tighted up in due course. Fixes #19896
* ghc-boot: Simplify writePackageDb permissions handlingDaniel Gröber2022-02-101-23/+16
| | | | | | | | | | | | | | | Commit ef8a3fbf1 ("ghc-boot: Fix metadata handling of writeFileAtomic") introduced a somewhat over-engineered fix for #14017 by trying to preserve the current permissions if the target file already exists. The problem in the issue is simply that the package db cache file should be world readable but isn't if umask is too restrictive. In fact the previous fix only handles part of this problem. If the file isn't already there in a readable configuration it wont make it so which isn't really ideal either. Rather than all that we now simply always force all the read access bits to allow access while leaving the owner at the system default as it's just not our business to mess with it.
* Implement System.Environment.getExecutablePath for NetBSDPHO2022-02-091-2/+2
| | | | and also use it from GHC.BaseDir.getBaseDir
* Purge DynFlags from GHC.StgJohn Ericson2022-02-061-7/+7
| | | | | Also derive some more instances. GHC doesn't need them, but downstream consumers may need to e.g. put stuff in maps.
* Fix a few Note inconsistenciesBen Gamari2022-02-011-1/+1
|
* Rip out remaining SPARC supportBen Gamari2022-01-291-4/+0
|
* Use getExecutablePath in getBaseDir on OpenBSDGreg Steuck2021-11-251-2/+2
| | | | | | | | While OpenBSD doesn't have a general mechanism for determining the path of the executing program image, it is reasonable to rely on argv[0] which happens as a fallback in getExecutablePath. With this change on top of T18173 we can get a bit close to fixing #18173.
* Avoid GHC_STAGE and other include bitsJohn Ericson2021-11-051-1/+1
| | | | | | | | | 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.
* Remove IndefiniteSylvain Henry2021-10-221-9/+10
| | | | We no longer need it after previous IndefUnitId refactoring.
* ghc-boot: Eliminate unnecessary use of getEnvironmentBen Gamari2021-09-301-2/+2
| | | | | | | | | Previously we were using `System.Environment.getEnvironment`, which decodes all environment variables into Haskell `String`s, where a simple environment lookup would do. This made the compiler's allocations unnecessarily dependent on the environment. Fixes #20431.
* ghc-boot: Fix metadata handling of writeFileAtomicBen Gamari2021-09-172-0/+28
| | | | | | | | Previously the implementation of writeFileAtomic (which was stolen from Cabal) failed to preserve file mode, user and group, resulting in #14017. Fixes #14017.
* Optimiser: Correctly deal with strings starting with unicode characters in ↵Matthew Pickering2021-06-231-0/+9
| | | | | | | | | | | | | | | | | | | | exprConApp_maybe For example: "\0" is encoded to "C0 80", then the rule would correct use a decoding function to work out the first character was "C0 80" but then just used BS.tail so the rest of the string was "80". This resulted in "\0" being transformed into '\C0\80' : unpackCStringUTF8# "80" Which is obviously bogus. I rewrote the function to call utf8UnconsByteString directly and avoid the roundtrip through Faststring so now the head/tail is computed by the same call. Fixes #19976
* ghc-boot: Use cabal-version: 3.0Ben Gamari2021-04-011-2/+3
|
* Bump bytestring submodule to 0.11.1.0Ben Gamari2021-03-101-1/+1
|
* Fix some warnings when bootstrapping with GHC 9.0Ryan Scott2021-03-091-1/+1
| | | | | | | | | | | This fixes two classes of warnings that appear when bootstrapping with GHC 9.0: * `ghc-boot.cabal` was using `cabal-version: >=1.22`, which `cabal-install-3.4` now warns about, instead recommending the use of `cabal-version: 1.22`. * Several pattern matches were producing `Pattern match(es) are non-exhaustive` because of incorrect CPP. The pattern-match coverage checker _did_ become smarter in GHC 9.1, however, so I ended up needing to keep the CPP, adjusting them to use `#if __GLASGOW_HASKELL__ < 901` instead.
* Implement riscv64 LLVM backendAndreas Schwab2021-03-051-0/+2
| | | | This enables a registerised build for the riscv64 architecture.
* Don't use FastString to convert string to UTF8Matthew Pickering2021-03-031-2/+12
|
* Fix array and cleanup conversion primops (#19026)Sylvain Henry2021-03-031-4/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first change makes the array ones use the proper fixed-size types, which also means that just like before, they can be used without explicit conversions with the boxed sized types. (Before, it was Int# / Word# on both sides, now it is fixed sized on both sides). For the second change, don't use "extend" or "narrow" in some of the user-facing primops names for conversions. - Names like `narrowInt32#` are misleading when `Int` is 32-bits. - Names like `extendInt64#` are flat-out wrong when `Int is 32-bits. - `narrow{Int,Word}<N>#` however map a type to itself, and so don't suffer from this problem. They are left as-is. These changes are batched together because Alex happend to use the array ops. We can only use released versions of Alex at this time, sadly, and I don't want to have to have a release thatwon't work for the final GHC 9.2. So by combining these we get all the changes for Alex done at once. Bump hackage state in a few places, and also make that workflow slightly easier for the future. Bump minimum Alex version Bump Cabal, array, bytestring, containers, text, and binary submodules
* Add explicit import lists to Data.List importsOleg Grenrus2021-01-292-2/+2
| | | | | | | | | | | | | Related to a future change in Data.List, https://downloads.haskell.org/ghc/8.10.3/docs/html/users_guide/using-warnings.html?highlight=wcompat#ghc-flag--Wcompat-unqualified-imports Companion pull&merge requests: - https://github.com/judah/haskeline/pull/153 - https://github.com/haskell/containers/pull/762 - https://gitlab.haskell.org/ghc/packages/hpc/-/merge_requests/9 After these the actual change in Data.List should be easy to do.
* ghci: reuse Arch from ghc-bootSylvain Henry2020-12-111-2/+2
|
* Move SizedSeq into ghc-bootSylvain Henry2020-12-112-0/+49
|
* CmmToLlvm: Declare signature for memcmpwip/angerman/arm64Ben Gamari2020-11-241-2/+18
| | | | | | Otherwise `opt` fails with: error: use of undefined value '@memcmp$def'
* AArch64/arm64 adjustmentsMoritz Angermann2020-11-151-2/+2
| | | | | | | | This addes the necessary logic to support aarch64 on elf, as well as aarch64 on mach-o, which Apple calls arm64. We change architecture name to AArch64, which is the official arm naming scheme.
* Version bump: base-4.16 (#18712)Vladislav Zavialov2020-10-271-1/+1
| | | | Also bumps upper bounds on base in boot libraries (incl. submodules).
* Initial ShortText code and conversion of package db codeWander Hillen2020-10-134-32/+678
| | | | | | | | | | | | | | | | | | | | | | | | | Metric Decrease: Naperian T10421 T10421a T10547 T12150 T12234 T12425 T13035 T18140 T18304 T5837 T6048 T13253-spj T18282 T18223 T3064 T9961 Metric Increase T13701 HFSKJH
* Make ghc-boot reexport modules from ghc-boot-thSylvain Henry2020-09-161-0/+8
| | | | | Packages don't have to import both ghc-boot and ghc-boot-th. It makes the dependency graph easier to understand and to refactor.
* Add accessors to ArchOSSylvain Henry2020-07-251-1/+4
|
* Fix build systemsSylvain Henry2020-07-252-3/+1
|
* Move GHC.Platform into the compilerSylvain Henry2020-07-257-479/+221
| | | | | | | Previously it was in ghc-boot so that ghc-pkg could use it. However it wasn't necessary because ghc-pkg only uses a subset of it: reading target arch and OS from the settings file. This is now done via GHC.Platform.ArchOS (was called PlatformMini before).