-
Notifications
You must be signed in to change notification settings - Fork 178
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
pkg_zip does not maintain directory structure #434
Comments
This should not be done within pkg_zip. You can do it with a glob in a pkg_files. |
I hit the same thing. |
The recommendation is to create a one or more For a more concrete example, take a peek at the one @aiuto mentioned in his comment, above. |
pkg_files should be the srcs to pkg_zip.
The complaint some people might have that this takes two rules instead of one. That design choice is intentional. pkg_files and related rules like pkg_dirs are a suite of composable rules that allow you do define the structure you want in the final output, and then package that up with any of pkg_{tar, zip, deb, rpm}. This lets us put the mapping logic in one place, rather than reimplementing things like strip_prefix in every rule. |
Sorry to get back to this so late, went down some other related rabbit holes. Using Thank you for the help! |
Thanks! |
Just for closure. I do actually agree that |
@aiuto out of curiosity, WDYT about adding a |
Perhaps this discussion should be continued in #354, where we are considering this very problem? I would personally argue that it isn't necessarily bad behavior -- if your default mode of operation has files going to odd locations that have nothing to do with your source paths, you're going to be stripping everything pretty much by default anyway. Regardless, that behavior may be too surprising to be effective. |
Sounds good. One place for discussion is best.
…On Thu, Dec 2, 2021 at 7:58 AM Andrew Psaltis ***@***.***> wrote:
Perhaps this discussion should be continued in #354
<#354>, where we are
considering this very problem?
I would personally argue that it isn't necessarily bad behavior -- if your
default mode of operation has files going to odd locations that have
nothing to do with your source paths, you're going to be stripping
everything pretty much by default anyway.
Regardless, that behavior may be too surprising to be effective.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#434 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXHHHBTSQXC2HX43AY42TLUO5UO7ANCNFSM5F3DXCBQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
pkg_zip
does not maintain the directory structure of the files placed inside it, nor does it have an option to.For the iOS package manager CocoaPods, when archiving code for distribution (rather than relying on git), the directory structure of the decompressed archive must match the globs in the package specification file (
.podspec
)if i have a podspec with the following:
and use the same in
pkg_zip
:All of the
.swift
files are unpacked at the root level of the archive. This breaks the CocoaPod import, since the package expects files to be underSources
While this specific usecase is fixable (with
package_dir
), CocoaPods supports "subspecs", that allows for optionally importing chunks of code:When compressed, all of the code needs to be available in the archive, so adding
package_dir
asSources
would then leave everything in theSources
directory when decompressed, and the.podspec
would not match any files.In order for these
pkg_
rules to work for CocoaPods, there needs to be a way to maintain the directory structure when archiving files.The text was updated successfully, but these errors were encountered: