-
Notifications
You must be signed in to change notification settings - Fork 521
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
Permission bits are lost in archives #314
Comments
Afaik composer/composer uses Phar to handle tar archives. It could be that these indeed do not support permissions. |
@doalex Do you do |
@oligriffiths on the host while installing packages, but if you always use |
That doesn't work for us as we commit our vendor dir and the .git directories cause problems that way.
|
@oligriffiths Why not exclude them in your .gitignore? Something like |
I should have explained further. We do currently do that, however it causes problems with composer when updating dependencies as it relies on the git directory being there to do a subsequent pull to update the repo.
|
@alcohol I'm running into this issue so wondering if it should be kept open, or that we reopen;
Any possible setups where this is expected to work? I detected this on our server running linux, and the steps above to try different things where done locally on mac with php 7 + zip extension. |
The problem stems from environment. You need to have a good tar/zip handler installed. |
So in regards to these?
|
It's best to use gzip archives and have gzip installed. |
Are you implying I write my own Archiver (if so, anyone have this already?), or that ZipArchive / PharArchive will take advantage of that? |
Oh, wait, this issue is about creating archives. Sorry, that's what you get for digging up ancient stuff 😓 I have no idea. I do not use this functionality myself. |
Yes, and that is why I think this should be opened, maybe a clean new issue with clear info that it's about creating archives.
so you only use satis to generate links to github / ... zipballs, hence act as proxy for composer meta info right? |
I have not used satis in quite a while myself. This project is entirely community maintained. |
I see no reason to (re)open this issue however. Satis does not contain any archiving functionality. |
Maybe not the lib code itself, but it does have archiving features: But you suggest it's rather reported on composer? |
Indeed. There is no code in Satis that actually generates archives. |
@andrerom - what PHP version are you using? You might have got hit with a variant of a bug I hit in PHP's core. |
Nice, missed that bit, so seems to be fixed in:
I was using 7.2.7, so was definitely affected. |
But in my case I had this issue with ZipArchive, so unless it was also fixed there I guess there is still a bug on this somewhere (PHP and/or composer). |
FYI @andrerom your code was correct in resolving the problem, just the reference was off, should be using $localname. See composer/composer#8330 where I opened up a fix for this. |
It seems that files in archived packages are loosing permission bits on Linux, in my case the executable flag which was set for a
php
file.I tried both zip and tar archive formats.
The permission bits are preserved if I use the
--prefer-source
flag while installing the package.I also tried to create an archive using
composer archive
which has the same problem.Is there a way to preserve the permission bits in archives on Linux?
Thanks
The text was updated successfully, but these errors were encountered: