Description
Describe the bug
In cabal.project
, it's no longer possible to use a source-repository-package
with a subdir
containing symlinks to its ancestor or sibling directories.
- Haskell.nix tag
2024.10.13
Steps To Reproduce
In a cabal.project
:
source-repository-package
type: git
location: https://github.com/AccelerateHS/accelerate-llvm.git
tag: 2b5d69448557e89002c0179ea1aaf59bb757a6e3
subdir: accelerate-llvm-native/
accelerate-llvm/
This fails in the installPhase
:
$ nix -L build .#project.hsPkgs.accelerate-llvm.components.library
accelerate-llvm-lib-accelerate-llvm> Running phase: installPhase
accelerate-llvm-lib-accelerate-llvm> LICENSE: copyFile: does not exist (No such file or directory)
Because accelerate-llvm/LICENSE
is a symlink to a file outside the component's directory:
$ readlink accelerate-llvm/LICENSE
../LICENSE
Expected behavior
The installPhase
succeeds by having access to the whole initial file hierarchy of the git repository.
Additional context
It's the same symptom as in #1134 but very likely unrelated, since the present regression was introduced just one month ago in #2239. Indeed, it worked correctly just before 61fbe40
Possible cause may be that in lib/load-cabal-plan.nix
, src
is no longer defined using a origSrc
and origSubDir
, that lib/clean-cabal-component.nix
could use to know the component is a subdir
:
haskell.nix/lib/load-cabal-plan.nix
Lines 103 to 104 in 5de65a1