summaryrefslogtreecommitdiff
path: root/utils/ghc-pkg
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Fix #13703 by correctly using munged names in ghc-pkg.Edward Z. Yang2017-05-161-32/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Cabal internal libraries are implemented using a trick, where the 'name' field in ghc-pkg registration file is munged into a new form to keep each internal library looking like a distinct package to ghc-pkg and other tools; e.g. the internal library q from package p is named z-p-z-q. Later, Cabal library got refactored so that we made a closer distinction between these "munged" package names and the true package name of a package. Unfortunately, this is an example of a refactor for clarity in the source code which ends up causing problems downstream, because the point of "munging" the package name was to make it so that ghc-pkg and similar tools transparently used MungedPackageName whereever they previously used PackageName (in preparation for them learning proper syntax for package name + component name). Failing to do this meant that internal libraries from the same package (but with different names) clobber each other. This commit search-replaces most occurrences of PackageName in ghc-pkg and turns them into MungedPackageName. Otherwise there shouldn't be any functional differenes. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: bgamari, austin Subscribers: rwbarton, thomie GHC Trac Issues: #13703 Differential Revision: https://phabricator.haskell.org/D3590
* Prefer #if defined to #ifdefBen Gamari2017-04-281-5/+5
| | | | Our new CPP linter enforces this.
* Bump process to 1.6Ben Gamari2017-04-271-1/+1
| | | | Also bumps Cabal submodule due to version bound bump.
* Update Cabal submodule, with necessary wibbles.Edward Z. Yang2017-04-261-9/+2
| | | | | | | | | | | | Test Plan: validate Reviewers: bgamari, austin Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3501
* fix 'make install' for cross-stage2Sergei Trofimovich2017-04-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When cross-built GHC is being installed one of latest steps is to register installed libraries with 'ghc-pkg'. GHC uses freshly installed 'ghc-pkg' and 'ghc-stage2' for that. Tested as: ./configure --target=aarch64-unknown-linux-gnu make install DESTDIR=$(pwd)/__s2 STRIP_CMD=: Before the change install failed on ghc-pkg execution phase: ".../ghc-cross/__s2/usr/local/lib/ghc-8.3.20170406/bin/ghc-pkg" \ --force \ --global-package-db \ ".../ghc-cross/__s2/usr/local/lib/ghc-8.3.20170406/package.conf.d" \ update rts/dist/package.conf.install /bin/sh: .../ghc-cross/__s2/usr/local/lib/ghc-8.3.20170406/bin/ghc-pkg: \ No such file or directory To avoid breakage we use 'ghc' and 'ghc-pkg' built by stage0. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Test Plan: run 'make install' on stage2 crosscompiler Reviewers: rwbarton, austin, bgamari Subscribers: thomie, snowleopard Differential Revision: https://phabricator.haskell.org/D3432
* ghc-pkg: Consider .conf files when computing package db mtimeAndrzej Rybczak2017-03-071-64/+21
| | | | | | | | | | | | | | | We can no longer use the mtime of the containing directory since it now contains a lock file in addition to the .cache and .conf files. Fixes #13375. Test Plan: Validate on Windows Reviewers: austin, arybczak Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3289
* Print out sub-libraries of packages more nicely.Edward Z. Yang2017-03-021-2/+13
| | | | | | | | | | | | | | | | | | Previously, we would print out the munged package name which looked like z-bkpcabal01-z-p-0.1.0.0. Now it looks like: bkpcabal01-0.1.0.0:p. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, bgamari, austin Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3235
* Properly acquire locks on not yet existing package databasesAndrzej Rybczak2017-03-021-8/+15
| | | | | | | | | | Reviewers: austin, bgamari, angerman Reviewed By: bgamari, angerman Subscribers: angerman, thomie Differential Revision: https://phabricator.haskell.org/D3259
* Add flag allowing convenient disabling of terminfo supportBen Gamari2017-02-283-4/+23
| | | | | | | | | | | | | This is a common thing that users who cross-compile must fight against. It turns out that it's pretty straightforward to make is convenient. Test Plan: Cross compile without a target `ncurses` available Reviewers: danharaj, hvr, erikd, austin, rwbarton Subscribers: rwbarton, thomie, snowleopard Differential Revision: https://phabricator.haskell.org/D3177
* Add support for concurrent package db access and updatesAndrzej Rybczak2017-02-261-131/+259
| | | | | | | | | | Trac issues: #13194 Reviewers: austin, hvr, erikd, bgamari, dfeuer, duncan Subscribers: DemiMarie, dfeuer, thomie Differential Revision: https://phabricator.haskell.org/D3090
* Correct Windows libdir assumptions.Tamar Christina2017-02-231-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GHC and ghc-pkg make some pretty hard assumptions about where they're running on Windows. They assume that they are always running from `foo/bin/ghc.exe` and that to find the `lib` folder they can drop `bin/ghc.exe` from the base path and append `lib`. This is already false for the testsuite, which when testing thenbindist has one test which puts the binaries in `inplace/test spaces`. For some reason before this was either being skipped or mysteriously passing. But as of `2017.02.11` our luck ran out. the testsuite triggers a failure such as those in #13310 Let's soften the assumption and just check that `../lib` exists instead. 80 chars Test Plan: ./validate Reviewers: austin, erikd, bgamari Reviewed By: bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D3158
* Tweaks and typos in manual, note refs, commentsGabor Greif2017-02-091-1/+1
|