Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cabal can't configure without global package db #5445

Closed
matthewbauer opened this issue Jul 18, 2018 · 4 comments
Closed

Cabal can't configure without global package db #5445

matthewbauer opened this issue Jul 18, 2018 · 4 comments

Comments

@matthewbauer
Copy link
Collaborator

I am trying to get cabal to build off of a separate package db. Here are the configure flags (built from Nix's generic-builder.nix off of this branch: NixOS/nixpkgs#43300):

Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/m2zc85p4kpbf25i6vf6chiwl3d802bf0-hello-1.0.0.2 --libdir=$prefix/lib/$compiler --libsubdir=$pkgid --docdir=/nix/store/facbpddzx14wi48j4yl8sg38xz7jxr3d-hello-1.0.0.2-doc/share/doc/hello-1.0.0.2 --with-gcc=gcc --package-db=/tmp/nix-build-hello-1.0.0.2.drv-6/package.conf.d --ghc-option=-j1 --disable-split-objs --enable-library-profiling --profiling-detail=all-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --enable-library-vanilla --enable-library-for-ghci --ghc-option=-split-sections --ghc-option=-no-global-package-db --extra-lib-dirs=/nix/store/2ycq3hgnkczlb06hy79lmficf392qgfd-ncurses-6.1/lib --extra-lib-dirs=/nix/store/jvz2yldc7kcfxrfwi44dys82rf9qgwwl-gmp-6.1.2/lib
Using Parsec parser
Configuring hello-1.0.0.2...
Flags chosen: threaded=False
Dependency base >=4.2 && <5: using base-4.12.0.0
<command line>: unknown package: rts

The key new flag is --ghc-option=-no-global-package-db. The package.conf.d file now contains rts & base which should be all that is needed for this package to build (hello). However, there seems to be a conflict with how cabal expects your environment to be set up:

/nix/store/y4g1zsl6cvh941c519nkxrvdh3xyv7h8-ghc-8.6.0.20180714/bin/ghc -hide-all-packages -c /run/user/1000/tmp.5LxTUJ741W/21754-0.c -o /run/user/1000/tmp.5LxTUJ741W/21754-1.o -no-global-package-db
<command line>: unknown package: rts
@bgamari
Copy link
Contributor

bgamari commented Jul 30, 2018

It looks like the --package-db flag didn't make it to ghc. This sounds like a Cabal bug.

Regardless, it would likely be helpful to paste the output of ghc-pkg dump --package-db /tmp/nix-build-hello-1.0.0.2.drv-6/package.conf.d.

@matthewbauer
Copy link
Collaborator Author

Here is the output:

name: rts
version: 1.0
id: rts
key: rts
license: BSD-3-Clause
maintainer: glasgow-haskell-users@haskell.org
exposed: True
library-dirs: /nix/store/wbnmmal4kxfb5354019163z6i46byv6w-rts/lib/ghc-8.6.0.20180714/rts
hs-libraries: HSrts Cffi
extra-libraries:
    m rt dl
include-dirs: /nix/store/wbnmmal4kxfb5354019163z6i46byv6w-rts/lib/ghc-8.6.0.20180714/include
includes:
    Stg.h
ld-options: "-Wl,-u,base_GHCziTopHandler_runIO_closure"
            "-Wl,-u,base_GHCziTopHandler_runNonIO_closure"
            "-Wl,-u,ghczmprim_GHCziTuple_Z0T_closure"
            "-Wl,-u,ghczmprim_GHCziTypes_True_closure"
            "-Wl,-u,ghczmprim_GHCziTypes_False_closure"
            "-Wl,-u,base_GHCziPack_unpackCString_closure"
            "-Wl,-u,base_GHCziWeak_runFinalizzerBatch_closure"
            "-Wl,-u,base_GHCziIOziException_stackOverflow_closure"
            "-Wl,-u,base_GHCziIOziException_heapOverflow_closure"
            "-Wl,-u,base_GHCziIOziException_allocationLimitExceeded_closure"
            "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_closure"
            "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_closure"
            "-Wl,-u,base_GHCziIOziException_cannotCompactFunction_closure"
            "-Wl,-u,base_GHCziIOziException_cannotCompactPinned_closure"
            "-Wl,-u,base_GHCziIOziException_cannotCompactMutable_closure"
            "-Wl,-u,base_ControlziExceptionziBase_absentSumFieldError_closure"
            "-Wl,-u,base_ControlziExceptionziBase_nonTermination_closure"
            "-Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure"
            "-Wl,-u,base_GHCziEventziThread_blockedOnBadFD_closure"
            "-Wl,-u,base_GHCziConcziSync_runSparks_closure"
            "-Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure"
            "-Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure"
            "-Wl,-u,base_GHCziConcziSignal_runHandlersPtr_closure"
            "-Wl,-u,base_GHCziTopHandler_flushStdHandles_closure"
            "-Wl,-u,base_GHCziTopHandler_runMainIO_closure"
            "-Wl,-u,ghczmprim_GHCziTypes_Czh_con_info"
            "-Wl,-u,ghczmprim_GHCziTypes_Izh_con_info"
            "-Wl,-u,ghczmprim_GHCziTypes_Fzh_con_info"
            "-Wl,-u,ghczmprim_GHCziTypes_Dzh_con_info"
            "-Wl,-u,ghczmprim_GHCziTypes_Wzh_con_info"
            "-Wl,-u,base_GHCziPtr_Ptr_con_info"
            "-Wl,-u,base_GHCziPtr_FunPtr_con_info"
            "-Wl,-u,base_GHCziInt_I8zh_con_info"
            "-Wl,-u,base_GHCziInt_I16zh_con_info"
            "-Wl,-u,base_GHCziInt_I32zh_con_info"
            "-Wl,-u,base_GHCziInt_I64zh_con_info"
            "-Wl,-u,base_GHCziWord_W8zh_con_info"
            "-Wl,-u,base_GHCziWord_W16zh_con_info"
            "-Wl,-u,base_GHCziWord_W32zh_con_info"
            "-Wl,-u,base_GHCziWord_W64zh_con_info"
            "-Wl,-u,base_GHCziStable_StablePtr_con_info"
            "-Wl,-u,hs_atomic_add8" "-Wl,-u,hs_atomic_add16"
            "-Wl,-u,hs_atomic_add32" "-Wl,-u,hs_atomic_add64"
            "-Wl,-u,hs_atomic_sub8" "-Wl,-u,hs_atomic_sub16"
            "-Wl,-u,hs_atomic_sub32" "-Wl,-u,hs_atomic_sub64"
            "-Wl,-u,hs_atomic_and8" "-Wl,-u,hs_atomic_and16"
            "-Wl,-u,hs_atomic_and32" "-Wl,-u,hs_atomic_and64"
            "-Wl,-u,hs_atomic_nand8" "-Wl,-u,hs_atomic_nand16"
            "-Wl,-u,hs_atomic_nand32" "-Wl,-u,hs_atomic_nand64"
            "-Wl,-u,hs_atomic_or8" "-Wl,-u,hs_atomic_or16"
            "-Wl,-u,hs_atomic_or32" "-Wl,-u,hs_atomic_or64"
            "-Wl,-u,hs_atomic_xor8" "-Wl,-u,hs_atomic_xor16"
            "-Wl,-u,hs_atomic_xor32" "-Wl,-u,hs_atomic_xor64"
            "-Wl,-u,hs_cmpxchg8" "-Wl,-u,hs_cmpxchg16" "-Wl,-u,hs_cmpxchg32"
            "-Wl,-u,hs_cmpxchg64" "-Wl,-u,hs_atomicread8"
            "-Wl,-u,hs_atomicread16" "-Wl,-u,hs_atomicread32"
            "-Wl,-u,hs_atomicread64" "-Wl,-u,hs_atomicwrite8"
            "-Wl,-u,hs_atomicwrite16" "-Wl,-u,hs_atomicwrite32"
            "-Wl,-u,hs_atomicwrite64"
pkgroot: "/run/user/1000"
---
name: base
version: 4.12.0.0
id: base-4.12.0.0
key: base-4.12.0.0
license: BSD-3-Clause
maintainer: libraries@haskell.org
synopsis: Basic libraries
description:
    This package contains the Standard Haskell "Prelude" and its support libraries,
    and a large collection of useful libraries ranging from data
    structures to parsing combinators and debugging utilities.
category: Prelude
abi: 4634df62c0c1aa2b27c0ddfe2eaf8ac4
exposed: True
exposed-modules:
    Control.Applicative Control.Arrow Control.Category
    Control.Concurrent Control.Concurrent.Chan Control.Concurrent.MVar
    Control.Concurrent.QSem Control.Concurrent.QSemN Control.Exception
    Control.Exception.Base Control.Monad Control.Monad.Fail
    Control.Monad.Fix Control.Monad.IO.Class Control.Monad.Instances
    Control.Monad.ST Control.Monad.ST.Lazy Control.Monad.ST.Lazy.Safe
    Control.Monad.ST.Lazy.Unsafe Control.Monad.ST.Safe
    Control.Monad.ST.Strict Control.Monad.ST.Unsafe Control.Monad.Zip
    Data.Bifoldable Data.Bifunctor Data.Bitraversable Data.Bits
    Data.Bool Data.Char Data.Coerce Data.Complex Data.Data Data.Dynamic
    Data.Either Data.Eq Data.Fixed Data.Foldable Data.Function
    Data.Functor Data.Functor.Classes Data.Functor.Compose
    Data.Functor.Const Data.Functor.Contravariant Data.Functor.Identity
    Data.Functor.Product Data.Functor.Sum Data.IORef Data.Int Data.Ix
    Data.Kind Data.List Data.List.NonEmpty Data.Maybe Data.Monoid
    Data.Ord Data.Proxy Data.Ratio Data.STRef Data.STRef.Lazy
    Data.STRef.Strict Data.Semigroup Data.String Data.Traversable
    Data.Tuple Data.Type.Bool Data.Type.Coercion Data.Type.Equality
    Data.Typeable Data.Unique Data.Version Data.Void Data.Word
    Debug.Trace Foreign Foreign.C Foreign.C.Error Foreign.C.String
    Foreign.C.Types Foreign.Concurrent Foreign.ForeignPtr
    Foreign.ForeignPtr.Safe Foreign.ForeignPtr.Unsafe Foreign.Marshal
    Foreign.Marshal.Alloc Foreign.Marshal.Array Foreign.Marshal.Error
    Foreign.Marshal.Pool Foreign.Marshal.Safe Foreign.Marshal.Unsafe
    Foreign.Marshal.Utils Foreign.Ptr Foreign.Safe Foreign.StablePtr
    Foreign.Storable GHC.Arr GHC.Base GHC.ByteOrder GHC.Char GHC.Clock
    GHC.Conc GHC.Conc.IO GHC.Conc.Signal GHC.Conc.Sync
    GHC.ConsoleHandler GHC.Constants GHC.Desugar GHC.Enum
    GHC.Environment GHC.Err GHC.Event GHC.Exception GHC.Exception.Type
    GHC.ExecutionStack GHC.ExecutionStack.Internal GHC.Exts
    GHC.Fingerprint GHC.Fingerprint.Type GHC.Float
    GHC.Float.ConversionUtils GHC.Float.RealFracMethods GHC.Foreign
    GHC.ForeignPtr GHC.GHCi GHC.Generics GHC.IO GHC.IO.Buffer
    GHC.IO.BufferedIO GHC.IO.Device GHC.IO.Encoding
    GHC.IO.Encoding.CodePage GHC.IO.Encoding.Failure
    GHC.IO.Encoding.Iconv GHC.IO.Encoding.Latin1 GHC.IO.Encoding.Types
    GHC.IO.Encoding.UTF16 GHC.IO.Encoding.UTF32 GHC.IO.Encoding.UTF8
    GHC.IO.Exception GHC.IO.FD GHC.IO.Handle GHC.IO.Handle.FD
    GHC.IO.Handle.Internals GHC.IO.Handle.Lock GHC.IO.Handle.Text
    GHC.IO.Handle.Types GHC.IO.IOMode GHC.IO.Unsafe GHC.IOArray
    GHC.IORef GHC.Int GHC.List GHC.MVar GHC.Maybe GHC.Natural GHC.Num
    GHC.OldList GHC.OverloadedLabels GHC.Pack GHC.Profiling GHC.Ptr
    GHC.RTS.Flags GHC.Read GHC.Real GHC.Records GHC.ResponseFile GHC.ST
    GHC.STRef GHC.Show GHC.Stable GHC.Stack GHC.Stack.CCS
    GHC.Stack.Types GHC.StaticPtr GHC.Stats GHC.Storable GHC.TopHandler
    GHC.TypeLits GHC.TypeNats GHC.Unicode GHC.Weak GHC.Word Numeric
    Numeric.Natural Prelude System.CPUTime System.Console.GetOpt
    System.Environment System.Environment.Blank System.Exit System.IO
    System.IO.Error System.IO.Unsafe System.Info System.Mem
    System.Mem.StableName System.Mem.Weak System.Posix.Internals
    System.Posix.Types System.Timeout Text.ParserCombinators.ReadP
    Text.ParserCombinators.ReadPrec Text.Printf Text.Read Text.Read.Lex
    Text.Show Text.Show.Functions Type.Reflection
    Type.Reflection.Unsafe Unsafe.Coerce
hidden-modules: Control.Monad.ST.Imp Control.Monad.ST.Lazy.Imp
                Data.Functor.Utils Data.OldList Data.Semigroup.Internal
                Data.Typeable.Internal Foreign.ForeignPtr.Imp
                GHC.StaticPtr.Internal System.Environment.ExecutablePath
                System.CPUTime.Utils GHC.Event.Arr GHC.Event.Array
                GHC.Event.Control GHC.Event.EPoll GHC.Event.IntTable
                GHC.Event.Internal GHC.Event.KQueue GHC.Event.Manager GHC.Event.PSQ
                GHC.Event.Poll GHC.Event.Thread GHC.Event.TimerManager
                GHC.Event.Unique System.CPUTime.Posix.ClockGetTime
                System.CPUTime.Posix.Times System.CPUTime.Posix.RUsage
                System.CPUTime.Unsupported
import-dirs: /nix/store/bpzr1bwrfmnwk58jb2aypz1knm5dm3wf-base-4.12.0.0/lib/ghc-8.6.0.20180714/base-4.12.0.0
library-dirs: /nix/store/bpzr1bwrfmnwk58jb2aypz1knm5dm3wf-base-4.12.0.0/lib/ghc-8.6.0.20180714/base-4.12.0.0
dynamic-library-dirs: /nix/store/bpzr1bwrfmnwk58jb2aypz1knm5dm3wf-base-4.12.0.0/lib/ghc-8.6.0.20180714/base-4.12.0.0
data-dir: /nix/store/bpzr1bwrfmnwk58jb2aypz1knm5dm3wf-base-4.12.0.0/share/x86_64-linux-ghc-8.6.0.20180714/base-4.12.0.0
hs-libraries: HSbase-4.12.0.0
include-dirs: /nix/store/bpzr1bwrfmnwk58jb2aypz1knm5dm3wf-base-4.12.0.0/lib/ghc-8.6.0.20180714/base-4.12.0.0/include
includes:
    HsBase.h
depends:
    ghc-prim-0.5.3 integer-gmp-1.0.2.0 rts
abi-depends: ghc-prim-0.5.3=c6eb6790b665fb8d3862cc4c3bbde74d
             integer-gmp-1.0.2.0=dff2b8cd691b5ba96e2b6b781e60316a rts=
haddock-interfaces: /nix/store/0vvb96mp2igc5dcjflwxw8mma4l2w9md-ghc-8.6.0.20180714-doc/share/doc/ghc/html/libraries/base-4.12.0.0/base.haddock
haddock-html: /nix/store/0vvb96mp2igc5dcjflwxw8mma4l2w9md-ghc-8.6.0.20180714-doc/share/doc/ghc/html/libraries/base-4.12.0.0
pkgroot: "/run/user/1000"

@ulysses4ever
Copy link
Collaborator

Is there a way to reproduce this today? If not, maybe this should be closed due to inactivity and unclear way to repro?

@Mikolaj
Copy link
Member

Mikolaj commented Jul 6, 2022

Given no objections, let me close. Thank you for the report and please open a ticket if this recurs.

@Mikolaj Mikolaj closed this as completed Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants