You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cabal build interprets Extra-source-files relative to CWD #6334
Describe the bug
When using a cabal.project file cabal build seems to interpret "Extra-source-files" relative to the current working directory.
This has changed in cabal-install-head-3.1+git20191103.2.129775a-6~18.04 (from hvr's ppa). cabal-install-3.0 did not have this problem.
To Reproduce
Here is a minimal setup:
/tmp/test-cabal/cabal.project:
Building somepackage from the toplevel dir fails because it can't find the README.md:
$ cd /tmp/test-cabal
$ cabal-head v2-build somepackage
Resolving dependencies...
Build profile: -w ghc-8.8.1 -O1
In order, the following will be built (use -v for more details):
- somepackage-0.1 (lib) (configuration changed)
Configuring library for somepackage-0.1..
Preprocessing library for somepackage-0.1..
Building library for somepackage-0.1..
cabal-head: filepath wildcard 'README.md' does not match any files.
But if I go into somepackage (where it's located)
$ cd /tmp/test-cabal/somepackage
$ cabal-head v2-build somepackage
Build profile: -w ghc-8.8.1 -O1
In order, the following will be built (use -v for more details):
- somepackage-0.1 (lib) (first run)
Preprocessing library for somepackage-0.1..
Building library for somepackage-0.1..
$
Expected behavior
I expect locations in a .cabal file would be interpreted relative to the location of that .cabal file.
Additional context
Interestingly cabal sdist works fine:
$ cd /tmp/cabal-test
$ cabal-head v2-sdist somepackage
Wrote tarball sdist to
/tmp/test-cabal/dist-newstyle/sdist/somepackage-0.1.tar.gz
$ tar taf dist-newstyle/sdist/somepackage-0.1.tar.gz
somepackage-0.1/
somepackage-0.1/README.md
somepackage-0.1/somepackage.cabal
Activity
phadej commentedon Nov 6, 2019
my 5cents: Cabal (starting from
cabal-install?) should move fromFilePath(in favour of something likePath Absolute&Path Unrooteddistinction as inhackage-security)phadej commentedon Nov 13, 2019
This is reproducible with current
cabal-install-headin HVR PPA 3.1+git20191103.2.129775a-6~18.04. (e.g. oncabalown codebase)I'll bisect which commit causes this, if it's easy to fix, I'll try that, otherwise hopefully revert would help.
phadej commentedon Nov 15, 2019
My
git-bisectsays this is caused by 3b54835 by @quasicomputationalAdd regression test, and resolve #6334
Merge pull request #6356 from haskell/issue-6334