Why does ghc-9.2.4 require process-1.6.13.2?

May I ask the community for some advice? Any help gratefully received! I am trying to build a development version of Stack on Windows 11 (with the most recent version of Stack). The stack.yaml looks like this (extract):

# GHC 9.2.4
resolver: nightly-2022-08-02

packages:
- .

extra-deps:
# GHC 9.2.4 comes with process-1.6.13.2, which lacks important bug fixes
- process-1.6.15.0@sha256:04df32d9497add5f0b90a27a3eceffa4bad5c2f41d038bd12ed6efc454db3faf,2845
# Although Cabal-3.6.3.0 is a global package, it depends on process
- Cabal-3.6.3.0@sha256:ff97c442b0c679c1c9876acd15f73ac4f602b973c45bde42b43ec28265ee48f4,12459

However, Stack warns that ghc-9.2.4 requires process-1.6.13.2 when everything else requires the later version of process specified as the extra-dep:

Configuring stack-2.7.6...
Warning:
    This package indirectly depends on multiple versions of the same package. This is very likely to cause a compile failure.
      package ghc (ghc-9.2.4) requires process-1.6.13.2
      package x509-system (x509-system-1.6.7-7LYzOCd9hiNIn35Hqv3YXA) requires process-1.6.15.0-7YgH4mi6Un42svYTH51yc2
      package unliftio (unliftio-0.2.22.0-7aYpCdlZTd1BzG1ifowgpt) requires process-1.6.15.0-7YgH4mi6Un42svYTH51yc2
      package typed-process (typed-process-0.2.10.1-FV0C3Zh991v5GT9YjSz5pl) requires process-1.6.15.0-7YgH4mi6Un42svYTH51yc2
      package streaming-commons (streaming-commons-0.2.2.4-KtmwozH1ldC8lnHURqK8C2) requires process-1.6.15.0-7YgH4mi6Un42svYTH51yc2
      package stack (stack-2.7.6) requires process-1.6.15.0-7YgH4mi6Un42svYTH51yc2
      package stack (stack-2.7.6) requires process-1.6.15.0-7YgH4mi6Un42svYTH51yc2
      package stack (stack-2.7.6) requires process-1.6.15.0-7YgH4mi6Un42svYTH51yc2
      package rio (rio-0.1.22.0-6qv51ExpTspEeSYseBxuU) requires process-1.6.15.0-7YgH4mi6Un42svYTH51yc2
      package optparse-applicative (optparse-applicative-0.17.0.0-6hi8JPLpPLD1aZipMKph2m) requires process-1.6.15.0-7YgH4mi6Un42svYTH51yc2
      package open-browser (open-browser-0.2.1.0-Hx2fhcq8KXi5DdArbLJWf2) requires process-1.6.15.0-7YgH4mi6Un42svYTH51yc2
      package githash (githash-0.1.6.2-CkgAgnMvOhZECxJhAOTkzx) requires process-1.6.15.0-7YgH4mi6Un42svYTH51yc2
      package extra (extra-1.7.10-80tfFluQ9OuFuixnOGESj2) requires process-1.6.15.0-7YgH4mi6Un42svYTH51yc2
      package echo (echo-0.1.4-1mVZySbMSwvEtxj6Ny0jYa) requires process-1.6.15.0-7YgH4mi6Un42svYTH51yc2
      package conduit-extra (conduit-extra-1.3.6-BvfbgHagiCHEiVJWoGyx2L) requires process-1.6.15.0-7YgH4mi6Un42svYTH51yc2
      package Cabal (Cabal-3.6.3.0-LgIQysZm0PdEegNtbZi2E8) requires process-1.6.15.0-7YgH4mi6Un42svYTH51yc2

and stack test eventually fails (part way through building the stack-test test suite - EDIT: I should add, stack.exe itself builds without complaint) with:

GHC runtime linker: fatal error: I found a duplicate definition for symbol
   mkNamedPipe
whilst processing object file
   C:\Users\mike\AppData\Local\Programs\stack\x86_64-windows\ghc-9.2.4\lib\x86_64-windows-ghc-9.2.4\process-1.6.13.2\HSprocess-1.6.13.2.o
The symbol was previously defined in
   C:\sr\snapshots\5ed2aec8\lib\x86_64-windows-ghc-9.2.4\process-1.6.15.0-7YgH4mi6Un42svYTH51yc2\HSprocess-1.6.15.0-7YgH4mi6Un42svYTH51yc2.o
This could be caused by:
   * Loading two different object files which export the same symbol
   * Specifying the same object file twice on the GHCi command line
   * An incorrect `package.conf' entry, causing some object to be
     loaded twice.
ghc-9.2.4.exe: panic! (the 'impossible' happened)
  (GHC version 9.2.4:
        loadObj "C:\\Users\\mike\\AppData\\Local\\Programs\\stack\\x86_64-windows\\ghc-9.2.4\\lib\\x86_64-windows-ghc-9.2.4\\process-1.6.13.2\\HSprocess-1.6.13.2.o": failed

Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

This is my question: why would Stack think that ghc-9.2.4 requires process-1.6.13.2? The ghc.cabal for ghc-9.2.4 says process >= 1 && < 1.7.

In case it was a ‘past build artefact’ somewhere, I deleted first my Stack root, GHC 9.2.4 and the .stack-work directory. Same result.

2 Likes

I can be more specific, it is only stack build stack:test:stack-test that causes the problem. In case it is relevant, the package.yaml for that looks like this:

tests:
  stack-test:
    main: Spec.hs
    source-dirs: src/test
    ghc-options:
    - -threaded
    dependencies:
    - QuickCheck
    - hspec
    - raw-strings-qq
    - stack
    - smallcheck
    verbatim: |
      build-tool-depends:
          hspec-discover:hspec-discover

hspec-2.9.7 depends on hspec-core-2.9.7 which depends on ghc.

That’s likely because ghc package is not reinstallable: you cannot compile it yourself against another version of process and must use whatever build configuration was used by GHC bindist. The only workaround is not to depend on ghc package one way or another.

2 Likes

Many thanks! This then is my knotty problem:

GHC 9.2.4 (and GHC 9.2.3) ships with process-1.6.13.2, but that lacks the important subsequent macOS bug fixes found in process-1.6.15.0.

Builds of Stack are tested extensively using hspec, but hpsec depends on hspec-core which, in turn, depends on ghc. stack-test built with GHC 9.2.4 and process-1.6.15.0 can’t build ghc on most operating systems (the CI suggests that, somehow, failure is avoided on macOS).

The release of GHC 9.4 may cut through my knot. process-1.6.15.0 was released as a precursor for the release of GHC 9.4.

1 Like

It sounds like this is rather important to bring to the attention of the GHC devs. GHC 9.2.4 was only just released last week. Perhaps they didn’t know they were shipping with a buggy process?

1 Like

I made Bump process submodule for 9.2.5 release (#21967) · Issues · Glasgow Haskell Compiler / GHC · GitLab

2 Likes

9.2.5 is shaping up to be an important print, replacing 8.10.7.