haskell / haskell/cabal

Copied license files may be overwritten

Open
#9,184 0 comments 0 reactions 0 assignees View on GitHub
cabal-install: cmd/install type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the bug**
Multiple license files are allowed in a cabal package description, but their relative paths are not preserved when installing.
Therefore, if the same file name is used in different directories, then only the last entry will be kept.

**To Reproduce**
Steps to reproduce the behavior:

1. Consider any `.cabal` file with an entry:
```
license-files: LICENSE somedir/LICENSE
```

2. Then, install this project
```
$ cabal install ...
```

3. In the directory `~/.cabal/store/ghc-x.y.z//share/doc/`, there will be only one `LICENSE` which is a copy of the last `LICENSE`.

**Expected behavior**
Their relative path should be kept.

In particular, `takeFileName` should be removed from L185 in
https://github.com/haskell/cabal/blob/f465da4d27a488796d357a478bdf454110c4cf3e/Cabal/src/Distribution/Simple/Install.hs#L179-L185

**Additional context**
I intend to fix this in #9172 as well.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.