Skip to content

Rebase PR #9422 (Add separate cache for getPkgConfigDb) on haskell/cabal master - #3

Closed
andreabedini with Copilot wants to merge 43 commits into
masterfrom
copilot/rebase-pull-9422-on-master
Closed

Rebase PR #9422 (Add separate cache for getPkgConfigDb) on haskell/cabal master#3
andreabedini with Copilot wants to merge 43 commits into
masterfrom
copilot/rebase-pull-9422-on-master

Conversation

Copilot AI commented Apr 10, 2026

Copy link
Copy Markdown

This PR rebases the changes from haskell/cabal#9422 ("Add separate cache for getPkgConfigDb") on top of the current master of haskell/cabal (commit 41f5e57e1).

Summary

The original PR adds a separate, per-project cache for PkgConfigDB to reduce the cost of querying pkg-config from "every plan change" to "every pkg-config-db change per project". The cache key is composed of the configured pkg-config program and the list of directories it reports via pc_path.

Conflict Resolutions

The rebase encountered conflicts in 3 files, which were resolved as follows:

ProjectConfig.hs

  • Export both resolveNumJobsSetting (HEAD addition) and resolveProgramDb (PR addition)
  • Keep both function definitions

ProjectPlanning.hs

  1. configureCompiler: Kept HEAD's version which uses Cabal.configCompiler + Cabal.configCompilerProgDb (separate step outside caching, per Note [Caching the result of configuring the compiler]). Restored pattern match destructuring of projectConfigLocalPackages needed by HEAD's implementation.

  2. getPkgConfigDb: Used PR's cached version with rerunIfChanged but adapted for the current API — replaced the removed NoPkgConfigDb constructor with Nothing, so the function returns Rebuild (Maybe PkgConfigDb) instead of Rebuild PkgConfigDb.

  3. phaseRunSolver: Used PR's return type (3-tuple without PkgConfigDb); changed the parameter type from PkgConfigDb to Maybe PkgConfigDb to match the type returned by the updated getPkgConfigDb.

cabal.test.hs (RejectFutureIndexStates)

  • Used PR's simpler sed approach (avoids macOS-incompatible -i flag)

Verification

  • ✅ Clean build: cabal build cabal-install succeeds with no type errors
  • ✅ Formatting: fourmolu --mode check passes on changed files

geekosaur and others added 30 commits March 12, 2026 20:33
Without some distinct identifier, downloaded sources will accumulate
(and have been since the last time the datestamp was updated).

The old caches are ignored and will be purged according to GitHub's
cache expiration, because otherwise we'd continue to carry 4 years'
worth of outdated source tarballs.
When a non-library component has unfilled Backpack signature requirements,
the error message now shows where each requirement came from (e.g.
"brought into scope by build-depends: Fail1") using the ModuleSource
information already available in the ModuleScope.

Updated the Fail3 test golden files and strengthened the test assertion
to verify provenance information is present.

Addresses haskell#7192

run fourmalou

more formatting
Remove commented-out `planPkgOf` function from `SolverInstallPlan`.
The primary entrypoint is now `make bootstrap-jsons`, which is now
documented and called out in `bootstrap/README.md`. It automatically
tries to obtain ghc versions from first `ghcup`, falls back to Nix if
`nix-shell` is found, and if all else fails warns the user to install
the appropriate ghcs. The Nix script can still be used directly, but
now obtains the list of ghc versions from the `Makefile`.
- Format ghc-supported-languages module
- Add an args check with help
- All extensions should be registered
- Exclude known languages
- Rename exceptions to langsAsExts
- Rename executable to ghc-supported-extensions
- Use explicit import lists, except for prelude
- Don't use dieNoVerbosity
- Move to exes/GhcSupportedExtensions.hs
- Handle the zero args case gracefully
- Satisfy fourmolu
- We're checking KnownExtension
- Avoid _ in registered pattern match
- Mention language editions
- Add a note about missing language editions
- Add to vim syntax and sort
- Update md5 check expectation
Highly incomplete. Also, revise contributor documentation including
moving some things to the maintainer documentation and absorbing the old
maintainers list which is now at the top.
This commit updates the logic in Distribution.Client.Dependency,
namely addDefaultSetupDependencies, to add an implicit Cabal dependency
for the custom setup stanza of packages with build-type: Hooks.

This ensures we always pick a version of Cabal that is compatible with
whatever other libraries the custom-setup stanza depends on (such as
Cabal-hooks).

Test in T11331.

Fixes haskell#11331
Follow hlint suggestion: move guards forward
…ad-code

refactor(cabal-install): remove dead code
…eanup

clean up bootstrap JSON generation
…e-timestamp

remove datestamp from bootstrap cache keys
first cut at maintainer documentation
"Warning: Unknown/unsupported 'ghc' version detected (Cabal 3.12.1.0 supports 'ghc' version < 9.12): /usr/bin/ghc-9.12.3 is version 9.12.3" is now only shown at Info level of verbosity

Closes haskell#9734
Hooks: use the appropriate Cabal unit ID
Derive Foldable for CondBranch
We no longer support building Cabal with GHCs this old (8.0.1/8.0.2).
The hand-written instance that was a necessary workaround for older GHCs
was removed.

Update testsuite fixtures
Since CondTree refactor, trailing zeros in generated GPD in the
testsuite started tripping GPD validation checks.
Notably the `BaseNoUpperBounds` and `TrailingZeroUpperBounds` errors.
The refactor removes the trailing zeros and adds a upperbound to base.
Bumps the github-actions group with 1 update: [haskell-actions/run-fourmolu](https://github.com/haskell-actions/run-fourmolu).


Updates `haskell-actions/run-fourmolu` from 11 to 12
- [Release notes](https://github.com/haskell-actions/run-fourmolu/releases)
- [Changelog](https://github.com/haskell-actions/run-fourmolu/blob/master/CHANGELOG.md)
- [Commits](haskell-actions/run-fourmolu@v11...v12)

---
updated-dependencies:
- dependency-name: haskell-actions/run-fourmolu
  dependency-version: '12'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
configure GHC: reduce verbosity of newer version warn to info
Include provenance in Backpack unfilled requirements error
mergify Bot and others added 13 commits April 2, 2026 00:49
…ns/github-actions-33ba744d50

Bump haskell-actions/run-fourmolu from 11 to 12 in the github-actions group
* Fix the OS string encoding for GNU/Hurd

Following https://github.com/haskell/cabal/pull/9434/files , and as seen
in the various gnu_HOST_OS usages in the ghc source code, it is expected that
GNU/Hurd is advertised as "gnu", like the autotools do.

* Update changelog.d/pr-11401

Co-authored-by: ffaf1 <fa-ml@ariis.it>

* Fixups

---------

Co-authored-by: ffaf1 <fa-ml@ariis.it>
…straints

Remove duplicated constraints from CondTree
upgrade uv dependencies per dependabot 2026-03-31
It was only used to avoid #ifdefs for GHC 7.10 compatibility, which is no longer needed.
remove "GHC < 6.10 → put /include/mingw in rts's installDirs" condition (ancient GHC)
…tore-ghc

Ignore testdb/intree/store/ghc-*/
Querying pkg-config for the version of every module can be a very
expensive operation on some systems. This change adds a separate,
per-project, cache for PkgConfigDB; reducing the cost from "every plan
change" to "every pkg-config-db change per project".

The cache key is composed by the pkg-config configured program and the
list of directories reported by pkg-config's pc_path variable.

Co-authored-by: andreabedini <69135+andreabedini@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.