Skip to content

OC BEP: consistent ordering for program search paths - #12556

Open
sheaf wants to merge 2 commits into
haskell:masterfrom
sheaf:b-e-p
Open

sheaf wants to merge 2 commits into
haskell:masterfrom
sheaf:b-e-p

Conversation

@sheaf

@sheaf sheaf commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

The way program search paths were handled was just a mess. I tried to bring some order to it, explained in Note [Program search paths]:

  • O: overrides --with-PROG=<...>
  • C: programs bundled with the compiler, e.g. look up ghc-pkg next to where we found ghc
  • B: build-tools, as they were solved for so should be picked up in priority
  • E: --extra-prog-path
  • P: fallback to PATH

QA notes: pass various kinds of --with-PROG, build-tool-depends:... etc and check they abide by the order above. A lot of these are kind of fiddly to test by hand; see for example ExtraProgPathTopLevel which shows that a top-level extra-prog-path only applies to the local package, not to its dependencies, and ProgramSearchPath which checks the ordering above.


Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

The program search path of each package started from the search path of
the compiler's ProgramDb, which leaked the extra-prog-path of the local
packages.
The program search path used to find programs is now consistently structured
to avoid duplicates and enforce the following ordering:

  (B) Programs specified in `build-tool-depends`
  (E) Programs found from `--extra-prog-path`
  (P) Fallback search on `PATH`.

See Note [Program search paths] in Distribution.Simple.Configure.

Fixes haskell#12544.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants