Patrick
Patrick

Reputation: 881

cabal v2-install --lib has dependency conflicts whereas v2-build succeeds on NixOS for HStringTemplate

I am trying to solve a potential bug (removal of backslashes in templates) of the unmaintained HStringTemplate. I am using modified fork of the project, hoping to be able to eventually submit it to hackage.

In order to use the library within my project I added the dependency to my cabal project:

executable texgeneration
    -- Import common warning flags.
    import:           warnings

    -- .hs or .lhs file containing the Main module.
    main-is:          Main.hs

    build-depends:    
        base ^>=4.16.3.0,
        HStringTemplate ^>=0.9.0,

Note that I increased the version number of HStringTemplate to 0.9.0 to ensure my version and not a different one from hackage will be used.

I cloned the HStringTemplate project from github, modified the cabal project version and ran cabal v2-build --constraint "directory == 1.3.8.1", followed by cabal v2-freeze. These commands worked fine, but a subsequent execution of cabal v2-install --lib all to make HStringTemplate 0.9.0 available to my project failed with:

Wrote tarball sdist to
/home/me/Documents/repos/texgeneration/hstringtemplate/dist-newstyle/sdist/HStringTemplate-0.9.0.tar.gz
Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] next goal: directory (user goal)
[__0] rejecting: directory-1.3.8.1, directory-1.3.8.0 (constraint from user
target requires ==1.3.7.1)
[__0] rejecting: directory-1.3.7.1 (constraint from project config
/home/me/Documents/repos/texgeneration/hstringtemplate/cabal.project.freeze
requires ==1.3.8.1)
[__0] rejecting: directory-1.3.7.0, directory-1.3.6.2/installed-1.3.6.2,
directory-1.3.6.2, directory-1.3.6.1, directory-1.3.6.0, directory-1.3.5.0,
directory-1.3.4.0, directory-1.3.3.2, directory-1.3.3.1, directory-1.3.3.0,
directory-1.3.2.2, directory-1.3.2.1, directory-1.3.2.0, directory-1.3.1.5,
directory-1.3.1.4, directory-1.3.1.3, directory-1.3.1.2, directory-1.3.1.1,
directory-1.3.1.0, directory-1.3.0.2, directory-1.3.0.1, directory-1.3.0.0,
directory-1.2.7.1, directory-1.2.7.0, directory-1.2.6.3, directory-1.2.6.2,
directory-1.2.5.1, directory-1.2.5.0, directory-1.2.4.0, directory-1.2.3.1,
directory-1.2.3.0, directory-1.2.2.1, directory-1.2.2.0, directory-1.2.1.0,
directory-1.2.0.1, directory-1.2.0.0, directory-1.1.0.2, directory-1.1.0.1,
directory-1.1.0.0, directory-1.0.1.2, directory-1.0.1.1, directory-1.0.1.0,
directory-1.0.0.3, directory-1.0.0.0, directory-1.2.6.1 (constraint from user
target requires ==1.3.7.1)
[__0] fail (backjumping, conflict set: directory)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: directory

I failed to find more information on how this could be debugged (e.g. understanding the dependency tree) and I wonder why cabal v2-build worked fine.

Upvotes: 1

Views: 86

Answers (0)

Related Questions