-
Notifications
You must be signed in to change notification settings - Fork 696
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
Fix sdist permissions #6666
Fix sdist permissions #6666
Conversation
253db6b
to
e77222e
Compare
e77222e
to
f26175e
Compare
Also refactor ./Setup sdist to not do anything fancy. Now `./Setup sdist` and `v2-sdist` should produce close(r) to same tarballs.
f26175e
to
b2ee5e6
Compare
I have just been informed that Cabal sdist will make all files in Extra-Source-Files read-only. This is very bad for the CPSA distribution because Extra-Source-Files contains executable scripts. How do you propose executable scripts be included in a distribution? |
What kind of executable scripts. If they are truly scripts, execute them using explicitly calling an interpreter. |
We deliver several scripts. One script runs our tests suite. One script finds the largest amount of memory that can be safely used on a Linux system by consulting /proc/meminfo. It exports its result by setting GHCRTS. Another uses Python to perform a complex transformation on CPSA input. They are programs to be executed. Why should one not be able to include executable scripts in a distribution? Seems arbitrary to fail to allow this. |
Because it's very hard for I don't want rely on the existing file permissions, as those are very implicit. E.g. on Windows. Additionally the packages may be unpacked on filesystems with See e.g. how |
Hmm. I thought Cabal was inferring permissions correctly in pre 3.0 versions of Cabal, but then I had strange problems with sdist on Macs, so I was always building distributions on Linux. (There was some weird issue with the size of uuid because my company uses employee numbers.) In any event, that is the past. Let me ask for something different to solve the problem. Please add a new field called |
Can you please confirm why oleg's proposed solution (calling the script file explicitly with an interpreter) does not work? |
The user has to know what interpreter to call. A user should not need to know that. That is what the |
It just occurred to me that some people many not know about shebang in Unix. It's a standard feature that allows a text file to used as if it were an executable. The feature is enabled when the file is given execute permission and the first two characters of the file are
As it says in Shebang, the purpose is to "allow scripts and data files to be used as commands, hiding the details of their implementation from users and other programs, by removing the need to prefix scripts with their interpreter on the command line." A CPSA distribution contains several Bourne shell scripts and a few Python scripts. |
Cabal 3.4 strips the execute permission from extra source files; see haskell/cabal#6666. This impacts our test scripts and causes CI to fail. Execute test scripts via sh(1) to avoid test failure due to no execute permission.
Cabal 3.4 strips the execute permission from extra source files; see haskell/cabal#6666. This impacts our test scripts and causes CI to fail. Execute test scripts via sh(1) to avoid test failure due to no execute permission.
Please include the following checklist in your PR:
[ci skip]
is used to avoid triggering the build bots.Please also shortly describe how you tested your change. Bonus points for added tests!