Skip to content

Error: Setup: Encountered missing or private dependencies: system-cxx-std-lib ==1.0 when trying to build double-conversion #1939

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

Closed
ocharles opened this issue May 8, 2023 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@ocharles
Copy link
Contributor

ocharles commented May 8, 2023

circuithub-haskell-nix is a Haskell.nix project. If I do:

nix-build nix/pkgs -A circuithub-haskell-nix.double-conversion

I get

@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/crfiy8a8h5nyzph2l5fxmssg5zdgqwxv-double-conversion-2.0.4.2.tar.gz
source root is double-conversion-2.0.4.2
setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file double-conversion-2.0.4.2/tests/Regressions.hs
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
'/build/.attr-0h9ydb7s8pfhl5kfs3rmmwnmpi49yyiw7jgr5dpw9rmvv8sy0f2b' -> 'double-conversion.cabal'
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
Configure flags:
--prefix=/nix/store/2lsl2y8jf6iid3lfim1jma1j5nx239bc-double-conversion-lib-double-conversion-2.0.4.2 lib:double-conversion --package-db=clear --package-db=/nix/store/3wgf9f3rfi1295r3lh3ypqwacp6hxw77-double-conversion-lib-double-conversion-2.0.4.2-configFiles/lib/ghc-9.4.5/lib/package.conf.d --flags=-developer --flags=embedded_double_conversion --exact-configuration --dependency=array=array-0.5.4.0 --dependency=base=base-4.17.1.0 --dependency=binary=binary-0.8.9.1 --dependency=bytestring=bytestring-0.11.4.0 --dependency=containers=containers-0.6.7 --dependency=deepseq=deepseq-1.4.8.0 --dependency=directory=directory-1.3.7.1 --dependency=exceptions=exceptions-0.10.5 --dependency=filepath=filepath-1.4.2.2 --dependency=ghc=ghc-9.4.5 --dependency=ghc-bignum=ghc-bignum-1.3 --dependency=ghc-boot=ghc-boot-9.4.5 --dependency=ghc-boot-th=ghc-boot-th-9.4.5 --dependency=ghc-compact=ghc-compact-0.1.0.0 --dependency=ghc-heap=ghc-heap-9.4.5 --dependency=ghc-prim=ghc-prim-0.9.0 --dependency=hpc=hpc-0.6.1.0 --dependency=integer-gmp=integer-gmp-1.1 --dependency=mtl=mtl-2.2.2 --dependency=parsec=parsec-3.1.16.1 --dependency=pretty=pretty-1.1.3.6 --dependency=process=process-1.6.16.0 --dependency=rts=rts-1.0.2 --dependency=stm=stm-2.5.1.0 --dependency=template-haskell=template-haskell-2.19.0.0 --dependency=terminfo=terminfo-0.4.1.5 --dependency=text=text-2.0.2 --dependency=time=time-1.12.2 --dependency=transformers=transformers-0.5.6.2 --dependency=unix=unix-2.7.3 --dependency=xhtml=xhtml-3000.2.2.1 --with-ghc=ghc --with-ghc-pkg=ghc-pkg --with-hsc2hs=hsc2hs --with-gcc=cc --with-ar=ar --with-strip=strip --enable-executable-stripping --enable-library-stripping --enable-library-profiling --disable-profiling --enable-static --enable-shared --disable-coverage --enable-library-for-ghci --datadir=/nix/store/rrj0j6jvql6ylhdf4dcc09003xw3l86w-double-conversion-lib-double-conversion-2.0.4.2-data/share/ghc-9.4.5 --profiling-detail=default --enable-split-sections 
Configuring library for double-conversion-2.0.4.2..
Error: Setup: Encountered missing or private dependencies:
system-cxx-std-lib ==1.0

I believe system-cxx-std-lib is some kind of built-in library that comes with GHC.

@ocharles ocharles added the bug Something isn't working label May 8, 2023
@angerman
Copy link
Collaborator

angerman commented May 8, 2023

Yes. It's GHC c++ routing library so that the rest of the ecosystem doesn't need to deal with figuring out how to link c++.

I believe this is with ghc961?

@hamishmack
Copy link
Collaborator

It looks like it was with ghc 9.4.5 based on the configure flags.

double-conversion.cabal 2.0.4.2 has:

  if impl(ghc >= 9.4)
    build-depends: system-cxx-std-lib == 1.0

I can't reproduce the issue building the double-conversion library though. For instance with:

nix-build  -E '((import ./. {}).pkgs-unstable.haskell-nix.hackage-package { compiler-nix-name = "ghc945"; name = "double-conversion"; }).components.library'

It looks like somehow the --dependency args in your output are strangly missing --dependency=system-cxx-std-lib=system-cxx-std-lib-1.0. It is also odd that --dependency=exceptions=exceptions-0.10.5 and --dependency=stm=stm-2.5.1.0 are included when they are not needed.

Do you have any modules that change nonReinstallablePkg or bootPkgs?

@ocharles
Copy link
Contributor Author

ocharles commented May 9, 2023

@hamishmack is right, this is GHC 9.4. We also do specify nonReinstallablePkgs, here's the relevant module for that:

      {
        # https://github.com/input-output-hk/haskell.nix/issues/1809#issuecomment-1358469589
        reinstallableLibGhc = false;
        nonReinstallablePkgs =
          [
            "rts"
            "ghc-heap"
            "ghc-prim"
            "integer-gmp"
            "integer-simple"
            "base"
            "deepseq"
            "array"
            "ghc-boot-th"
            "pretty"
            "template-haskell"
            "ghc-boot"
            "ghc"
            "Win32"
            "array"
            "binary"
            "bytestring"
            "containers"
            "directory"
            "filepath"
            "ghc-boot"
            "ghc-compact"
            "ghc-prim"
            "hpc"
            "mtl"
            "parsec"
            "process"
            "text"
            "time"
            "transformers"
            "unix"
            "xhtml"
            "ghc-bignum"
            # package ghc-9.4.3 is unusable due to missing dependencies:
            # exceptions-0.10.5 stm-2.5.1.0 terminfo-0.4.1.5
            "stm"
            "exceptions"
            "terminfo"
            #
          ];
      }

@ocharles
Copy link
Contributor Author

ocharles commented May 9, 2023

Ok, it looks like adding "system-cxx-std-lib" to nonReinstallablePkgs was all I needed to do. Shall we close this?

@hamishmack
Copy link
Collaborator

Actually now that reinstallableLibGhc = true is the default, I think we can be more aggressive making nonReinstallablePkgs when it is false include the full set of packages needed by ghc. I think that means adding:

  • exceptions (ghc >=9.0.1)
  • stm (ghc >=9.0.1)
  • system-cxx-std-lib (ghc >=9.4.1)

We have been reluctant to change this in the past because reinstallableLibGhc = false was the default and having these packages pinned to the version that comes with GHC might have been a confusing change for people not building ghc packages (see #1183).

@hamishmack
Copy link
Collaborator

What breaks if you remove that whole module (setting reinstallableLibGhc = false and nonReinstallablePkgs = ...)?

@hamishmack
Copy link
Collaborator

I have merged #1941 so we should not need to include nonReinstallablePkgs now. Just { reinstallableLibGhc = false; } should cause all the packages required by ghc to be included in nonReinstallablePkgs.

@ocharles
Copy link
Contributor Author

Yea, just specifying reinstallableLibGhc = false has sorted it now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants