8000
Skip to content
< 8000 include-fragment src="/in-product-messaging/budget-threshold-banner?organization=gentoo-haskell" data-nonce="v2:9f2f5d3c-8be4-3ec4-27d9-5f356436c2eb" data-view-component="true">

Packages needing GHC_BOOSTRAP_PACKAGES #1327

Description

@hololeap

Continue reading if you get errors like this:

usr/bin/ghc -hide-all-packages -package Cabal -package base -package binary -package bytestring -package containers -package deepseq -package directory -package exceptions -package filepath -package haskeline -package mtl -package parsec -package pretty -package process -package stm -package template-haskell -package terminfo -package text -package transformers -package unix -package xhtml --make /var/tmp/portage/dev-haskell/xml-conduit-1.9.1.1/work/xml-conduit-1.9.1.1/Setup.hs -j4 +RTS -A256M -qb0 -RTS -threaded -dynamic -o setup
[1 of 1] Compiling Main             ( /var/tmp/portage/dev-haskell/xml-conduit-1.9.1.1/work/xml-conduit-1.9.1.1/Setup.hs, /var/tmp/portage/dev-haskell/xml-conduit-1.9.1.1/work/xml-conduit-1.9.1.1/Setup.o )

/var/tmp/portage/dev-haskell/xml-conduit-1.9.1.1/work/xml-conduit-1.9.1.1/Setup.hs:3:1: error:
    Could not load module ‘Distribution.Extra.Doctest’
    It is a member of the hidden package ‘cabal-doctest-1.0.9’.
    You can run ‘:set -package cabal-doctest’ to expose it.
    (Note: this unloads all the modules in the current scope.)
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
3 | import Distribution.Extra.Doctest (defaultMainWithDoctests)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Add GHC_BOOTSTRAP_PACKAGES to your ebuild to bring a number of packages into scope for Setup.hs. Example:

GHC_BOOTSTRAP_PACKAGES=(
	cabal-doctest
	haskell-gi
)

A change to haskell-cabal.eclass is being added, where extra dependencies to build Setup.hs must now be listed in the ebuild using the new GHC_BOOTSTRAP_PACKAGES variable. Without this new feature, it is possible to get namespace collisions such as:

/var/tmp/portage/dev-vcs/darcs-2.16.5-r3/work/darcs-2.16.5/Setup.hs:7:1: error:
    Ambiguous module name ‘Distribution.PackageDescription’:
      it was found in multiple packages:
      Cabal-3.6.3.0 Cabal-syntax-3.8.1.0
  |
7 | import Distribution.PackageDescription ( PackageDescription )
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Most common packages bundled with GHC are exposed by default, which is all that is needed for most custom Setup.hs setups. However, it is likely there are still packages in the tree that need to be fixed by adding GHC_BOOTSTRAP_PACKAGES.


Packages needing a fix (so far):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    0