stack-3.7.1: The Haskell Tool Stack
LicenseBSD-3-Clause
Safe HaskellNone
LanguageGHC2021

GHC.Utils.GhcPkg.Main.Compat

Description

This module is based on GHC's utilsghc-pkgMain.hs at commit f66fc15f2e6849125074bcfeb44334a663323ca6 (see GHC merge request !11142), with:

  • changeDBDir' does not perform an effective ghc-pkg recache,
  • the cache is not used,
  • consistency checks are not performed,
  • use Stack program name,
  • use Stack.Prelude rather than Prelude,
  • use RIO env monad,
  • use well-typed representations of paths from the path package,
  • add pretty messages and exceptions,
  • redundant code deleted,
  • Hlint applied, and
  • explicit import lists.

The version of the ghc-pkg executable supplied with GHCs published before 28 August 2023 does not efficiently bulk unregister. This module exports a function that does efficiently bulk unregister.

Synopsis

Documentation

ghcPkgUnregisterForce Source #

Arguments

:: HasTerm env 
=> Path Abs Dir

Path to the global package database

-> Path Abs Dir

Path to the package database

-> Bool

Apply ghc-pkg's --ipid, --unit-id flag?

-> [String]

Packages to unregister

-> RIO env () 

Function equivalent to:

ghc-pkg --no-user-package-db --package-db=<pkgDb> unregister [--ipid] <P>