Skip to content
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

There should be a single file zip rule #352

Closed
aiuto opened this issue May 11, 2021 · 5 comments
Closed

There should be a single file zip rule #352

aiuto opened this issue May 11, 2021 · 5 comments
Labels
p4 An idea that we are not considering working on at this time.

Comments

@aiuto
Copy link
Collaborator

aiuto commented May 11, 2021

To build some items like a Unix manual page, we want to simply gzip a file. That is, the source is "myprog.1" and the rule should generate "myprog.1.gz". Some ideas:

  • a rule with a single src and out
  • an attribute on pkg_files to specify zipping each
  • a variation of pkg_zip that does many inputs with many outputs, producing a PackageFilesInfo
    There are obvious tradeoffs w.r.t. actions to compress first and sending compressed files to the final package maker vs. just sending the files to the package maker and having it do it.
@aiuto aiuto added the P3 An issue that we are not working on but will review quarterly label May 11, 2021
@mzeren-vmw
Copy link
Contributor

Since this is about "final layout of files", perhaps this functionality should be a per-file option in "pkg_install" ?

@aiuto
Copy link
Collaborator Author

aiuto commented May 11, 2021

I think that's an additional place where it has to work. If we are installing direct from the workspace maybe it's a single rule.

pkg_install(... srcs=[foo.1], dest=/usr/man/man1, compress=gz)

but maybe pkg_install works just like pkg_rpm and points to a set of srcs that know where they go in the system tree.

pkg_files(name='manpages', srcs=[foo.1], prefix='/usr/man/man1', compress=gz)
pkg_install(..., srcs=[manpages, bins, ...], prefix=/tmp/fakeroot)

@nacl
Copy link
Collaborator

nacl commented May 11, 2021

Hm. The idea of integrating it with pkg_files is appealing -- compression could even occur via a macro. A pkg_compress rule (the pkg_zip "variant" mentioned) sounds interesting as well.

We actually have a similar problem with regards to template expansion. Providing a single expand_template rule (e.g. bazelbuild/bazel-skylib#191) for each and every one proved messy, so they were collapsed into a macro.

I haven't thought about this too much, but any of the options specified would be nice to have, or use as building blocks.

Since this is about "final layout of files", perhaps this functionality should be a per-file option in "pkg_install" ?

Perhaps, but fine-grained file controls better belong in pkg_files and friends, rather than in a specific packaging rule. pkg_install (and pkg_rpm etc) should only be interested in accepting inputs and doing the packaging, rather than manipulating individual files.

@aiuto aiuto added P2 An issue that should be worked on when time is available and removed P3 An issue that we are not working on but will review quarterly labels Jun 9, 2021
@aiuto aiuto added P3 An issue that we are not working on but will review quarterly and removed P2 An issue that should be worked on when time is available labels Oct 27, 2021
@aiuto aiuto added p4 An idea that we are not considering working on at this time. and removed P3 An issue that we are not working on but will review quarterly labels Mar 3, 2022
@aiuto
Copy link
Collaborator Author

aiuto commented Mar 3, 2022

This seems like overbuilding without a real need. Downgrading priority, but we should probably close it as pointless.

@aiuto
Copy link
Collaborator Author

aiuto commented Oct 7, 2022

Closing issues that no one is likely to work on for any forseable future

@aiuto aiuto closed this as completed Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4 An idea that we are not considering working on at this time.
Projects
None yet
Development

No branches or pull requests

3 participants