Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,979
    • Issues 4,979
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 475
    • Merge requests 475
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #5977
Closed
Open
Created Mar 28, 2012 by duncan@trac-duncan

Allow ignoring global package db

For sandboxing, users want to be able to use only local package dbs. To handle rts, base etc, they copy those specific packages from the global package db into a local package db.

Currently however there is no sensible way to tell ghc to look only at the listed package dbs, and not the global db. There is a flag -no-user-package-conf to avoid looking at the per-user one, but no equivalent to ignore or to specify the global one.

(Note: as a quirky non-sensible way, you can use GHC_PACKAGE_PATH="" to clear the package db stack, but this should be possible using command line flags.)

The user interface we're now using in cabal is like this:

  • --global sets the initial db stack to [GlobalPackageDB]
  • --user sets the initial db stack to [GlobalPackageDB, UserPackageDB]
  • --package-db=clear clears the db stack to []
  • --package-db=global pushes GlobalPackageDB on the top of the stack
  • --package-db=user pushes UserPackageDB on the top of the stack
  • --package-db=${otherfile} pushes SpecificPackageDB ${otherfile} on the top of the stack

It seems to me we could do something similar with ghc. Currently in ghc we have a -hide-all-packages flag that resets the package set to empty. We could do with an equivalent for the package database stack. I suggest something like:

  • -clear-package-conf
  • -global-package-conf
  • -user-package-conf (and the existing -no-user-package-conf)
  • -package-conf file

The default would remain that the global and user dbs are used, but this can be reset using -clear-package-conf.

Personally I prefer the nomenclarture "package db" rather than "package conf" here, but it's not that important.

Trac metadata
Trac field Value
Version 7.4.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking