Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cabal sdist mangles file permissions for files in Extra-Source-Files #6830

Closed
ramsdell opened this issue May 21, 2020 · 3 comments
Closed

Cabal sdist mangles file permissions for files in Extra-Source-Files #6830

ramsdell opened this issue May 21, 2020 · 3 comments

Comments

@ramsdell
Copy link
Contributor

Describe the bug

Cabal sdist mangles file permissions for files in Extra-Source-Files. It sets all of them all to be executable. This is a serious problem for CPSA. It distributes many example source file that obviously are not executable.

To Reproduce

The enclosed file perms.tar.gz demonstrates the error. Run ./showbug to see that README gets the wrong permissions.

$ ./showbug

ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.10.1
cabal --version
cabal-install version 3.2.0.0
compiled using version 3.2.0.0 of the Cabal library
echo

ls -l
total 48
-rw-r--r-- 1 ramsdell MITRE\Domain Users 63 May 21 14:35 Main.hs
-rw-r--r-- 1 ramsdell MITRE\Domain Users 215 May 21 15:41 README
-rw-r--r-- 1 ramsdell MITRE\Domain Users 46 May 21 14:36 Setup.hs
drwxr-xr-x 3 ramsdell MITRE\Domain Users 96 May 21 14:48 doc
-rw-r--r-- 1 ramsdell MITRE\Domain Users 19 May 21 14:36 license.txt
-rw-r--r-- 1 ramsdell MITRE\Domain Users 616 May 21 14:54 perms.cabal
-rwxr-xr-x 1 ramsdell MITRE\Domain Users 131 May 21 15:50 showbug
echo

cabal sdist
Wrote tarball sdist to
/Users/ramsdell/src/perms/dist-newstyle/sdist/perms-4.2.3.tar.gz
echo

tar tvzf dist-newstyle/sdist/perms-4.2.3.tar.gz
drwxr-xr-x 0 0 0 0 Sep 8 2001 perms-4.2.3/
-rw-r--r-- 0 0 0 63 Sep 8 2001 perms-4.2.3/Main.hs
-rwxr-xr-x 0 0 0 215 Sep 8 2001 perms-4.2.3/README
-rw-r--r-- 0 0 0 46 Sep 8 2001 perms-4.2.3/Setup.hs
drwxr-xr-x 0 0 0 0 Sep 8 2001 perms-4.2.3/doc/
-rw-r--r-- 0 0 0 45 Sep 8 2001 perms-4.2.3/doc/data.txt
-rw-r--r-- 0 0 0 19 Sep 8 2001 perms-4.2.3/license.txt
-rw-r--r-- 0 0 0 616 Sep 8 2001 perms-4.2.3/perms.cabal
-rwxr-xr-x 0 0 0 131 Sep 8 2001 perms-4.2.3/showbug
$
perms.tar.gz

@phadej
Copy link
Collaborator

phadej commented May 21, 2020

The next series (3.4) release will make all files read-only in distribution tar. That's already implemented in #6666

@phadej phadej closed this as completed May 21, 2020
@ramsdell
Copy link
Contributor Author

That is a horrible idea to make all files read-only. How is one to include executable scripts? Notice the example includes the script showbug.

@frasertweedale
Copy link
Contributor

^^^^^^^^^^^ this.

cabal-install 3.4 breaks my CI, because I distribute some shell scripts in my package. Will file a new ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants