Skip to content

process >= 1.6.14 requires ghc-9.2.4 to be built again, which causes error #8489

Closed
@Abastro

Description

@Abastro

Describe the bug
At some point, I added process >= 1.6.14 as that version fixed a bug.
After a while, I tried to build a test and it failed:

I use hspec as dependency, which has ghc package as a transitive dependency.
Then, it tries to build ghc-9.2.4 package instead of using what should be already available.
First it complained that alex then happy is missing. After installing those, it error-ed out while trying to build GHC modules.

To Reproduce
Steps to reproduce the behavior:

pulp-commons.cabal:

cabal-version:      2.4
name:               pulp-commons

(... version, synopsis, license, ...)

library
  hs-source-dirs:       src
  default-extensions:
    LambdaCase
  default-language:     GHC2021
  ghc-options:          -W
  build-depends:
      base >=4.14 && <5
    , vector
    , containers
    , mtl
    , text
    , filepath
    , directory
    , X11
    , unix
    , stm == 2.5.*
  exposed-modules:
    Defines

test-suite test-pulp-commons
  type:               exitcode-stdio-1.0
  main-is:            Spec.hs
  hs-source-dirs:     test

  default-extensions:
    LambdaCase
  default-language:     GHC2021

  build-depends:
      base
    , pulp-commons
    , process >= 1.6.14
    , QuickCheck >=2.14
    , hspec ^>=2.10

Ran command

cabal v2-test pulp-commons

Then, e..g this happens when alex is not installed

Resolving dependencies...
Build profile: -w ghc-9.2.4 -O1
In order, the following will be built (use -v for more details):
 - ghc-9.2.4 (lib) (requires build)
 - hspec-core-2.10.6 (lib) (requires build)
 - hspec-2.10.6 (lib) (requires build)
 - pulp-commons-0.1.0.0 (test:test-pulp-commons) (first run)
Starting     ghc-9.2.4 (lib)
Building     ghc-9.2.4 (lib)

Failed to build ghc-9.2.4.
Build log (
/home/abastro/.cabal/logs/ghc-9.2.4/ghc-9.2.4-27443687ed3d50d5763876a9d1e19a85cb41f0467f57d384fbf08b6a809af35b.log
):
Configuring library for ghc-9.2.4..
Preprocessing library for ghc-9.2.4..
Error: cabal-3.8.1.0: The program 'alex' is required but it could not be found

Error: cabal: Failed to build ghc-9.2.4 (which is required by
test:test-pulp-commons from pulp-commons-0.1.0.0). See the build log above for
details.

Expected behavior
If ghc package is never supposed to be built, proper error messages should have complained about the version bounds - it took quite some time to .
If ghc package could be built, it should build successfully without errors.

System information

  • x86, Linux, Ubuntu
  • cabal-3.8.1.0, ghc-9.2.4

Additional context
In the dependencies of the test, when I have process part commented out like:

  build-depends:
      base
    , pulp-commons
    -- , process >= 1.6.14
    , QuickCheck >=2.14
    , hspec ^>=2.10

then existing ghc package is used, and build proceeds normally.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions