Skip to content

Building test library without depending on itself #133

Open

Description

@L0neGamer

In #127 (comment) @mniip suggested that we depend on the local transformers library directly.

However, when rebasing #128 I noted that cabal is now complaining about being unable to solve transformers-0.7. This suggests that the "re-include modules" pattern is actually neccessary here to get the test packages compiling with this version of transformers.

See below CI error (https://github.com/haskell/transformers/actions/runs/38917874158/job/117029916949?pr=128)

Run cabal freeze
Resolving dependencies...
Error: [Cabal-7107]
Could not resolve dependencies:
[__0] trying: transformers-0.7.0.0 (user goal)
[__1] trying: base-4.22.0.0/installed-fde1 (dependency of transformers)
[__2] trying: transformers-test-0 (user goal)
[__3] trying: transformers-test:*test
[__4] trying: tasty-quickcheck-0.11.1 (dependency of transformers-test *test)
[__5] next goal: optparse-applicative (dependency of tasty-quickcheck)
[__5] rejecting: optparse-applicative-0.19.0.0 (conflict: transformers==0.7.0.0, optparse-applicative => transformers>=0.5 && <0.7)
[__5] skipping: optparse-applicative; 0.18.1.0, 0.17.1.0, 0.17.0.0, 0.16.1.0, 0.16.0.0, 0.15.1.0, 0.15.0.0, 0.14.3.0, 0.14.2.0, 0.14.1.0, 0.14.0.0, 0.13.2.0, 0.13.1.0, 0.13.0.0, 0.12.1.0, 0.12.0.0, 0.11.0.2, 0.11.0.1, 0.11.0, 0.10.0, 0.9.1.1, 0.9.1, 0.9.0, 0.8.1, 0.8.0.1, 0.8.0, 0.7.0.2, 0.7.0.1, 0.7.0, 0.6.0, 0.5.2.1, 0.5.2, 0.5.1, 0.5.0, 0.4.3, 0.4.2, 0.4.1, 0.4.0, 0.3.2, 0.3.1, 0.3.0, 0.2.0, 0.1.1, 0.1.0 (has the same characteristics that caused the previous version to fail: excludes 'transformers' version 0.7.0.0)
[__5] trying: optparse-applicative-0.0.1
[__6] next goal: data-lens-template (dependency of optparse-applicative)
[__6] rejecting: data-lens-template-2.2 (conflict: optparse-applicative => data-lens-template>=2.1 && <2.2)
[__6] trying: data-lens-template-2.1.10
[__7] next goal: template-haskell (dependency of data-lens-template)
[__7] rejecting: template-haskell-2.24.0.0/installed-7190 (conflict: data-lens-template => template-haskell>=2.4 && <2.11)
[__7] skipping: template-haskell; 2.24.0.0, 2.23.0.0, 2.22.0.0, 2.21.0.0, 2.20.0.0, 2.19.0.0, 2.18.0.0, 2.17.0.0, 2.16.0.0, 2.15.0.0, 2.14.0.0, 2.13.0.0, 2.12.0.0, 2.11.1.0, 2.11.0.0 (has the same characteristics that caused the previous version to fail: excluded by constraint '>=2.4 && <2.11' from 'data-lens-template')
[__7] rejecting: template-haskell-2.10.0.0 (conflict: base==4.22.0.0/installed-fde1, template-haskell => base>=4.8 && <4.9)
[__7] skipping: template-haskell; 2.9.0.0, 2.8.0.0, 2.7.0.0, 2.6.0.0, 2.5.0.0, 2.4.0.1, 2.4.0.0, 2.3.0.1, 2.3.0.0, 2.2.0.0 (has the same characteristics that caused the previous version to fail: excludes 'base' version 4.22.0.0)
[__7] fail (backjumping, conflict set: base, data-lens-template, template-haskell)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: transformers, optparse-applicative, data-lens-template, base, template-haskell, tasty-quickcheck, transformers-test, transformers-test:test
Try running with --minimize-conflict-set to improve the error message.

Opening this issue as a discussion point for this pattern; for now I will restore the modules to the import list.

Activity

  1. L0neGamer commented on Oct 16, 2026

    @L0neGamer
    CollaboratorAuthor

    Further notes: even when removing transformers from the deps of the transformers-test cabal file, it can't be solved.

  2. L0neGamer commented on Oct 16, 2026

    @L0neGamer
    CollaboratorAuthor

    I've simply done what containers does and added allow-newer: all:transformers to the cabal.project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions