Skip to content

cabal test doesn't change to package directory #10704

@phadej

Description

@phadej

See https://github.com/phadej/regression-simple/actions/runs/12600704188/job/35120309804?pr=14

I'm puzzled what's happening, as I cannot reproduce that locally. Locally cabal test changes directory.

The important part of log:

["--working-dir=/__w/regression-simple/regression-simple/unpacked/regression-simple-0.2.2","test","--verbose=2","--builddir=/__w/regression-simple/regression-simple/dist-newstyle/build/x86_64-linux/ghc-8.8.4/regression-simple-0.2.2/t/regression-simple-tests","--log=$pkgid-$test-suite.log","--machine-log=$pkgid.log","--show-details=direct","regression-simple-tests"]
Reading installed packages...
Running: /github/home/.ghcup/ghc/8.8.4/bin/ghc-pkg-8.8.4 dump --global -v0
Running: /github/home/.ghcup/ghc/8.8.4/bin/ghc-pkg-8.8.4 dump '--package-db=/github/home/.cabal/store/ghc-8.8.4/package.db' -v0
Running: /github/home/.ghcup/ghc/8.8.4/bin/ghc-pkg-8.8.4 dump '--package-db=/__w/regression-simple/regression-simple/dist-newstyle/packagedb/ghc-8.8.4' -v0
Running: /github/home/.ghcup/ghc/8.8.4/bin/ghc-pkg-8.8.4 dump '--package-db=/__w/regression-simple/regression-simple/dist-newstyle/build/x86_64-linux/ghc-8.8.4/regression-simple-0.2.2/t/regression-simple-tests/package.conf.inplace' -v0
Running: /github/home/.ghcup/ghc/8.8.4/bin/ghc --print-libdir -hide-all-packages '+RTS' -M3G -RTS '-Werror=missing-methods'
Running 1 test suites...
Test suite regression-simple-tests: RUNNING...
Running: /__w/regression-simple/regression-simple/dist-newstyle/build/x86_64-linux/ghc-8.8.4/regression-simple-0.2.2/t/regression-simple-tests/build/regression-simple-tests/regression-simple-tests
"/__w/regression-simple/regression-simple"

the --working-dir argument is the package directory, but when program is run, it's not respected, the test suite starts with

getCurrentDirectory >>= print

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions