summaryrefslogtreecommitdiff
path: root/utils/ghc-pkg
Commit message (Collapse)AuthorAgeFilesLines
* Add hashes to unit-ids created by hadrianromes2023-05-041-1/+2
| | | | | | | | | | | 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.
* Fix colors in emacs terminalBodigrim2023-02-041-2/+4
|
* ghc-pkg does not have to depend on terminfoBodigrim2023-01-182-45/+17
|
* Assorted fixes to avoid Data.List.{head,tail}Bodigrim2022-11-251-3/+4
|
* Drop make build systemBen Gamari2022-08-251-98/+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
* Bump Cabal submoduleBen Gamari2022-02-101-0/+1
| | | | | | | | | Adapts GHC to the factoring-out of `Cabal-syntax`. Fixes #20991. Metric Decrease: haddock.Cabal
* Fix some notesMatthew Pickering2022-02-081-1/+1
|
* Fix a few Note inconsistenciesBen Gamari2022-02-012-3/+2
|
* Improve migration strategy for the XDG compliance change to the GHC applicationZubin Duggal2022-01-311-29/+47
| | | | | | | | | | | directory. We want to always use the old path (~/.ghc/..) if it exists. But we never want to create the old path. This ensures that the migration can eventually be completed once older GHC versions are no longer in circulation. Fixes #20684, #20669, #20660
* Remove IndefiniteSylvain Henry2021-10-221-3/+2
| | | | We no longer need it after previous IndefUnitId refactoring.
* packaging: Give ghc-pkg the same version as ProjectVersionMatthew Pickering2021-07-271-1/+1
|
* 18000 Use GHC.IO.catchException in favor of Exception.catchSasha Bogicevic2021-04-261-2/+3
| | | | fix #18000
* directory: ensure xdg compliance (Fix #6077)Gauvain 'GovanifY' Roussel-Tarbouriech2021-02-181-4/+4
|
* Add explicit import lists to Data.List importsOleg Grenrus2021-01-291-1/+3
| | | | | | | | | | | | | 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.
* Initial ShortText code and conversion of package db codeWander Hillen2020-10-131-18/+49
| | | | | | | | | | | | | | | | | | | | | | | | | Metric Decrease: Naperian T10421 T10421a T10547 T12150 T12234 T12425 T13035 T18140 T18304 T5837 T6048 T13253-spj T18282 T18223 T3064 T9961 Metric Increase T13701 HFSKJH
* Add a closing parenthesis tooFelix Yan2020-08-101-1/+1
|
* Correct a typo in ghc.mkFelix Yan2020-08-101-1/+1
|
* Move GHC.Platform into the compilerSylvain Henry2020-07-251-14/+7
| | | | | | | 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).
* Put PlatformConstants into PlatformSylvain Henry2020-07-251-1/+6
|
* Rename Package into Unit (2)Sylvain Henry2020-06-131-3/+3
| | | | | | | * rename PackageState into UnitState * rename findWiredInPackages into findWiredInUnits * rename lookupModuleInAll[Packages,Units] * etc.
* Unit: split and rename modulesSylvain Henry2020-04-301-3/+3
| | | | | | | Introduce GHC.Unit.* hierarchy for everything concerning units, packages and modules. Update Haddock submodule
* Factorize mungePackagePaths codeSylvain Henry2020-04-301-33/+6
| | | | | | | | This patch factorizes the duplicated code used in ghc-pkg and in GHC to munge package paths/urls. It also fixes haddock-html munging in GHC (allowed to be either a file or a url) to mimic ghc-pkg behavior.
* Refactor UnitInfo load/store from databasesSylvain Henry2020-04-301-41/+28
| | | | | | | | | | | Converting between UnitInfo stored in package databases and UnitInfo as they are used in ghc-pkg and ghc was done in a very convoluted way (via BinaryStringRep and DbUnitModuleRep type classes using fun deps, etc.). It was difficult to understand and even more to modify (I wanted to try to use a GADT for UnitId but fun deps got in the way). The new code uses much more straightforward functions to convert between the different representations. Much simpler.
* Refactor UnitInfoSylvain Henry2020-04-301-34/+34
| | | | | | | | | | | | | | | | | | | | | * Rename InstalledPackageInfo into GenericUnitInfo The name InstalledPackageInfo is only kept for alleged backward compatibility reason in Cabal. ghc-boot has its own stripped down copy of this datatype but it doesn't need to keep the name. Internally we already use type aliases (UnitInfo in GHC, PackageCacheFormat in ghc-pkg). * Rename UnitInfo fields: add "unit" prefix and fix misleading names * Add comments on every UnitInfo field * Rename SourcePackageId into PackageId "Package" already indicates that it's a "source package". Installed package components are called units. Update Haddock submodule
* Modules (#13009)Sylvain Henry2020-04-181-1/+2
| | | | | | | | | | | | | | * SysTools * Parser * GHC.Builtin * GHC.Iface.Recomp * Settings Update Haddock submodule Metric Decrease: Naperian parsing001
* Update to Cabal submodule to v3.2.0.0-alpha3Oleg Grenrus2020-01-041-3/+4
| | | | | Metric Increase: haddock.Cabal
* Add --show-unit-ids flag to ghc-pkgOleg Grenrus2019-12-121-9/+22
| | | | | I only added it into --simple-output and ghc-pkg check output; there are probably other places where it can be adopted.
* Factor out a smaller part of Platform for host fallbackJohn Ericson2019-10-041-11/+7
|
* Bump Cabal submodule to 3.1Sebastian Graf2019-09-121-1/+1
| | | | | | | | ------------------------- Metric Increase: haddock.Cabal T4029 -------------------------
* Deduplicate "unique subdir" code between GHC and CabalJohn Ericson2019-07-093-20/+9
| | | | | | The code, including the generated module with the version, is now in ghc-boot. Config.hs reexports stuff as needed, ghc-pkg doesn't need any tricks at all.
* Remove most uses of TARGET platform macrosJohn Ericson2019-07-091-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These prevent multi-target builds. They were gotten rid of in 3 ways: 1. In the compiler itself, replacing `#if` with runtime `if`. In these cases, we care about the target platform still, but the target platform is dynamic so we must delay the elimination to run time. 2. In the compiler itself, replacing `TARGET` with `HOST`. There was just one bit of this, in some code splitting strings representing lists of paths. These paths are used by GHC itself, and not by the compiled binary. (They are compiler lookup paths, rather than RPATHS or something that does matter to the compiled binary, and thus would legitamentally be target-sensative.) As such, the path-splitting method only depends on where GHC runs and not where code it produces runs. This should have been `HOST` all along. 3. Changing the RTS. The RTS doesn't care about the target platform, full stop. 4. `includes/stg/HaskellMachRegs.h` This file is also included in the genapply executable. This is tricky because the RTS's host platform really is that utility's target platform. so that utility really really isn't multi-target either. But at least it isn't an installed part of GHC, but just a one-off tool when building the RTS. Lying with the `HOST` to a one-off program (genapply) that isn't installed doesn't seem so bad. It's certainly better than the other way around of lying to the RTS though not to genapply. The RTS is more important, and it is installed, *and* this header is installed as part of the RTS.
* ghc-pkg needs settings file to un-hardcode target platformJohn Ericson2019-06-192-5/+34
| | | | This matches GHC itself getting the target platform from there.
* Factor out 'getLibDir' / 'getBaseDir' into a new GHC.BaseDir ghc-boot moduleJohn Ericson2019-06-071-15/+3
| | | | | | | | | | | | | | ghc-pkg and ghc already both needed this. I figure it is better to deduplicate, especially seeing that changes to one (FreeBSD CPP) didn't make it to the other. Additionally in !1090 I make ghc-pkg look up the settings file, which makes it use the top dir a bit more widely. If that lands, any difference in the way they find the top dir would be more noticable. That change also means sharing more code between ghc and ghc-package (namely the settings file parsing code), so I'd think it better to get off the slipperly slope of duplicating code now.
* Update Wiki URLs to point to GitLabTakenobu Tani2019-03-252-4/+4
| | | | | | | | | | | | | | | | | | | | | | | This moves all URL references to Trac Wiki to their corresponding GitLab counterparts. This substitution is classified as follows: 1. Automated substitution using sed with Ben's mapping rule [1] Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy... New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy... 2. Manual substitution for URLs containing `#` index Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...#Zzz New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...#zzz 3. Manual substitution for strings starting with `Commentary` Old: Commentary/XxxYyy... New: commentary/xxx-yyy... See also !539 [1]: https://gitlab.haskell.org/bgamari/gitlab-migration/blob/master/wiki-mapping.json
* Update Trac ticket URLs to point to GitLabRyan Scott2019-03-151-1/+1
| | | | | This moves all URL references to Trac tickets to their corresponding GitLab counterparts.
* make ghc-pkg shut upMoritz Angermann2019-01-301-1/+1
|
* Revert "Batch merge"Ben Gamari2019-01-301-1/+1
| | | | This reverts commit 76c8fd674435a652c75a96c85abbf26f1f221876.
* Batch mergeBen Gamari2019-01-301-1/+1
|
* Update `Cabal` submoduleHerbert Valerio Riedel2019-01-141-30/+21
| | | | | | | This also requires adapting `ghc-pkg` to use the new Cabal parsing API as the old ReadP-based one has finally been evicted for good. Hadrian bit finished by: Ben Gamari <ben@smart-cactus.org>
* Fix ghc-pkg when only prof way is enabledZejun Wu2018-10-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We saw following errors: ``` $ cabal install --disable-library-vanilla --disable-shared --enable-library-profiling hashable-1.2.7.0: cannot find any of ["libHShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ.a", "libHShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ.p_a", "libHShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ-ghc8.4.3.so", "libHShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ-ghc8.4.3.dylib", "HShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ-ghc8.4.3.dll"] ``` This is because ghc-pkg is looking for `libHShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ.p_a` instead of `libHShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ_p.a`. Test Plan: ./validate Reviewers: simonmar, bgamari Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5234
* Drop GHC 8.2 compatibilityRyan Scott2018-10-031-65/+2
| | | | | | | | | | | | | | | | | Summary: GHC 8.6.1 is out, so now GHC's support window only extends back to GHC 8.4. This means we can delete gobs of code that were only used for GHC 8.2 support. Hooray! Test Plan: ./validate Reviewers: bgamari, Phyx, erikd Reviewed By: bgamari, Phyx Subscribers: rwbarton, erikd, carter Differential Revision: https://phabricator.haskell.org/D5192
* ghc, ghc-pkg: use getExecutablePath on Windows when base >= 4.11.0Tamar Christina2018-08-251-13/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This completes the work started in D4227 by using just 'getExecutablePath' in ghc and ghc-pkg when building with base >= 4.11.0. On the long term, we will be able to simply kill the existing code that follows (or not) symlinks and just get this behaviour for free from getExecutable. For now we however have to require base >= 4.11.0 to be able to just use getExecutablePath under Windows, and use the current code when building with an older base. Original code by @alpmestan commandeering since patch has been stale and bug remains open. Test Plan: Validate Reviewers: angerman, bgamari, erikd, alpmestan Reviewed By: bgamari Subscribers: carter, rwbarton, thomie GHC Trac Issues: #14483 Differential Revision: https://phabricator.haskell.org/D4229
* Handle abi-depends correctly in ghc-pkgTobias Dammers2018-06-021-15/+127
| | | | | | | | | | | | | | | | | | | | | | | | When inferring the correct abi-depends, we now look at all the package databases in the stack, up to and including the current one, because these are the ones that the current package can legally depend on. While doing so, we will issue warnings: - In verbose mode, we warn about every package that declares abi-depends:, whether we actually end up overriding them with the inferred ones or not ("possibly broken abi-depends"). - Otherwise, we only warn about packages whose declared abi-depends does not match what we inferred ("definitely broken abi-depends"). Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14381 Differential Revision: https://phabricator.haskell.org/D4729
* Revert "ghc-pkg: recompute `abi-depends` for updated packages"Ben Gamari2018-05-211-51/+1
| | | | | | This reverts commit 1cdc14f9c014f1a520638f7c0a01799ac6d104e6. This is causing non-deterministic testsuite output.
* ghc-pkg: recompute `abi-depends` for updated packagesAustin Seipp2018-05-201-1/+51
| | | | | | | | | | | | | | | | | | | See `Note [Recompute abi-depends]` for more information. Signed-off-by: Austin Seipp <aseipp@pobox.com> Test Plan: `./validate` Reviewers: bgamari, ezyang Reviewed By: bgamari Subscribers: tdammers, juhp, carter, alexbiehl, shlevy, cocreature, rwbarton, thomie GHC Trac Issues: #14381 Differential Revision: https://phabricator.haskell.org/D4159
* ghc-pkg: Configure handle encodingsBen Gamari2018-05-131-0/+2
| | | | | | | | | | | | | | | | | | This fixes #15021 using a the same approach as was used to fix the issue in ghc (#10762). Test Plan: Validate on Windows as user whose username contains non-ASCII characters Reviewers: simonmar Reviewed By: simonmar Subscribers: lehins, thomie, carter GHC Trac Issues: #15021 Differential Revision: https://phabricator.haskell.org/D4642
* ghc-pkg: Add missing newlines to usage messageBen Gamari2017-11-201-2/+2
|
* Fix #elfi -> #elif; unbreak -Werror.Moritz Angermann2017-11-191-3/+5
| | | | | | | | | | Reviewers: bgamari, erikd Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4209
* Relocatable GHCMoritz Angermann2017-11-181-0/+11
| | | | | | | | | | | | | | GHC and the binary distribution that's produced is not relocatable outside of Windows. This diff tries to address this for at least Linux and macOS. Reviewers: austin, hvr, bgamari, erikd, goldfire, Phyx Reviewed By: bgamari Subscribers: duog, rwbarton, thomie, erikd Differential Revision: https://phabricator.haskell.org/D4121
* Update Win32 version for GHC 8.4.Tamar Christina2017-11-091-5/+3
| | | | | | | | | | | | | | | | | | | Update to Win32 2.6 which is the expected version release for 8.4 This involves moving Cabal forward which brings some backwards incompatible changes that needs various fixups. Bump a bunch of submodules Test Plan: ./validate Reviewers: austin, bgamari, angerman Reviewed By: bgamari, angerman Subscribers: angerman, thomie, rwbarton Differential Revision: https://phabricator.haskell.org/D4133