-
Notifications
You must be signed in to change notification settings - Fork 179
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
Zip file created with a default (file) mode causes corrupted Azure function #802
Comments
It looks like we should be adding the file mode bits in addition to permissions. |
This should not be needed, but it seems to be for some Azure users. Fixes bazelbuild#802
Please patch and try #804. |
@aiuto thanks for the quick reply. I'll double check what happens on Windows. |
This works for me. Baseline without the patch:
Then I used a
Created the zip again and now I get the proper file attributes:
|
* Explicitly set the FILE bit in zip external attributes. This should not be needed, but it seems to be for some Azure users. Fixes #802 * remove a comment that proved unneeded
Disclaimer: I'm not sure whether this is a bug in rules_pkg or really a problem in Azure. However I thought I better file it regardless in case others stumble over this since the "workaround" is easy. So feel free to close.
We're using the packaging rules to package up Azure Function Apps. The mode used to create a
zipfile.ZipInfo
object in the zip file created, causes a broken Azure Function App deployment. The main problem seems to be the file mode which differs significantly when usedzipfile.ZipInfo.from_file
:Env details
OS: GNU/Linux - Ubuntu 22.04 running in WSL2
Python: 3.11.0
Problem description
The
filemode
set with the current code:The
filemode
when the info is constructed withzipfile.ZipInfo.from_file
:You'll notice the
?
at the beginning of the zipinfo for the file if constructed with the current default mode.Reproducer
I can reproduce this 100% with access to deploying a function app. I see if I can file a bug somewhere in Azure too. A minimal reproducer is to create a zip file with the
make_zipinfo
method frombuild_zip.py
using a 16bit? file mode (0o644).Workaround
The workaround I currently use is to set an explicit file mode:
It seems using a 32bit file mode (sorry only stumbled over it in a Stackoverflow post about git file modes is not causing this confusing behaviour in deployment.
The text was updated successfully, but these errors were encountered: