Skip to content

Read global package database from settings file

Matthew Pickering requested to merge wip/global-package-db into master

Before this patch, the global package database was always assumed to be in libdir </> package.conf.d.

This causes issues in GHC's build system because there are sometimes situations where the package database you need to use is not located in the same place as the settings file.

  • The stage1 compiler needs to use stage2 libraries, so we should set "Global Package DB" for the stage1 compiler to the stage2 package database.

  • Stage 2 cross compilers need to use stage3 libraries, so likewise, we should set to stage

  • When installing we have rearranged everything so that the settings file and package database line up properly, so then everything should continue to work as before.

A reasonable question is why not generate the "right" settings files in the right places in GHC's build system. In order to do this you would need to engineer wrappers for all executables to point to a specific libdir. There are also situations where the same package db is used by two different compilers with two different settings files (think stage2 cross compiler and stage3 compiler).

In short, this 10 line patch allows for some reasonable simplifications in Hadrian at very little cost to anything else.

Merge request reports