-
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
Cannot use out
to set file name in pkg_zip
#414
Comments
I should fix the documentation, and have the rule stop using it. |
I have a rule ala
Because the name of the rule is |
Right. The extra zip in bla.zip.zip is currently a bug.
What is not a bug is getting a symlink of name + '.zip' !=
package_file_name.
In that case the physical file is defined by package_file_name and you will
get a symlink to that.
This allows you do create real output files with dynamically created named
(e.g. containing the --cpu, or date), while also having a predictable file
name if you want to write a script that is a little lazy and just wants to
grab bla.zip without having to look at the OutputGroup provider.
…On Mon, Aug 23, 2021 at 6:26 AM Cornelius Riemenschneider < ***@***.***> wrote:
I have a rule ala
pkg_zip(name = "bla.zip", package_file_name = "bla.zip", srcs = [...])
Because the name of the rule is bla.zip, the rule creates an out file
with name bla.zip.zip. Due to package_file_name, this file gets renamed
to bla.zip (great), but I *also* get a symlink from bla.zip.zip to bla.zip.
Without overwriting out, it is not possible to get rid of this symlink.
It's not a big issue, as I can just ignore the symlink, but it is not as
pretty as it could be, either.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#414 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXHHHHG423RCVZSYIYMST3T6IO4PANCNFSM5COBLB2Q>
.
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&utm_campaign=notification-email>
.
|
So, I ran into an small perf problem related to this. I have a 2+ GiB .zip created by pkg_zip. By not allowing me to use
(Edit: Filed bazelbuild/bazel#14125 to discuss underlying ctx.actions.symlink perf.) |
I'm floored. That seems so wrong. |
Absolutely. :) |
Maybe we could make the symlink "as-needed". The wrapper macro would look at package_file_name and if it had no expansions in it, would pass it as the output file name. The rule, seeing output and package_file_name were identical, would only return the one, not making the symlink. This would only impact people who were scripting picking up the output file based on name+'.zip', but that's not a precise approach anyway. |
- Make 'out' work in a reasonable way. Fixes bazelbuild#414 - Partial fix for bazelbuild#284
- Make 'out' work in a reasonable way. Fixes bazelbuild#414 - Partial fix for bazelbuild#284
The docs of
pkg_zip
sayHowever, using out results in
Presumably this is because
out
is unconditionally set. Instead, it should do something alainstead.
The text was updated successfully, but these errors were encountered: