summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-04-05Merge "use sys.exit() instead of exit() (#844)" into mainmain-kernel-build-2024mainMatthias Männich
2024-04-05Merge "Upgrade rules_pkg to 0.10.1" into mainMatthias Männich
2024-04-04use sys.exit() instead of exit() (#844)aiuto
This is a cherry-pick of an upstream change. The hermetic Python toolchain that Kleaf uses does not have the exit builtin. To use pkg_install(), temporarily cherry-pick this change. Bug: 324907235 Change-Id: Ie5c73b0a11e5158295c6cff25d4e7950663f4b24 (cherry picked from commit e14245aa9653b462f60a9f202d25fd5956983e03)
2024-04-04Upgrade rules_pkg to 0.10.1Yifan Hong
This project was upgraded with external_updater. Usage: tools/external_updater/updater.sh update external/bazelbuild-rules_pkg For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md Update changelog and version numbers. (#819) Temporarily restore //mappings.bzl and //pkg.bzl (#817) Fix RPM package release and version files expansion (#816) Apply tar remap_paths to runfiles full paths (#812) Update build_tar.py doc and changelog update to go with 0.10.0 (#809) Fill out the CI matrix to cover the bazels that people use. (#807) Explicitly set the FILE bit in zip external attributes. (#804) Allow substitution of user-defined variables in RPM preamble (#787) update docs Add %posttrans scriptlet to RPM package (#799) Allow additional RPM macro defines (#794) back off try stardoc again Fall back to WORKSPACE.bzlmod for examples/naming. Something about a local_repository in MODULE.bazel and bazel 7.0.0 is wonky. turn off doc building in CI Explicitly set `%{_builddir}` macro (#792) Update CODEOWNERS (#791) Bring tar runfiles up to feature parity with pkg_files.runfiles. (#754) Only inject pre and post scriptlets when provided (#788) chore: suppress buildifier lint warnings (#776) CI fixes (#784) Add yun as CI owner (#785) Little fixes to stop lint warnings (#783) Add support for `Obsoletes` tag in RPM definition (#778) fix the imports on the filter directory test (#782) Don't load cc toolchain from rules_cc (#779) doc: Fixup external manual references (#777) chore: buildifier format all files (#775) chore: add a pre-commit hook config (#774) Refactor all the input processing code. (#756) Get bzlmod working in CI (#766) use runfiles from rules_python (#768) Use rules_cc to try to clean up CI runs which are failing on gcc (#764) When pkg_tar.prefix_dir == base of symlink path, don't double-dip. (#749) add imports to fix bazel --noexperimental_python_import_all_repositories flag (#630) Align pkg_rpm returned files with other rules (#692) pkg_deb: allow data.tar.zst (#761) fix(pkg_tar): properly normalize paths for empty files (#760) Add fixed releaser to because this will be done by a bot. (#757) remove --incompatible_use_platforms_repo_for_constraints from ci run (#755) Clean up some nits (#751) chore: update versions of dependencies (#730) Add support for failing on file conflicts. (#683) Remove PackageArtifactsInfo. (#752) Document that package_dir also uses package_variables (#747) include verify_archive_test_main.py.tpl in the distribution (#735) buildifier lint fixes (#744) make build_tar priavte (#748) pkg_tar remap_paths works for TreeArtifacts (bazelbuild#450) (#738) add docs for 0.9 (#740) update docs Fix handling paths with whitepsaces (#733) Add logging and extend doc Fix test on python 3.6 Fix python 3.6, doesn't support compresslevel Make pkg_zip compression configurable Append changelog to RPM spec file (#726) Fix pkg_deb changelog flag getter (#734) Add basic include_runfiles to pkg_files. (#724) Add changelog attribute to pkg_deb (#725) chore: automate publishing releases to BCR (#722) bump platforms because bazel at head requires it. sigh Use Gzip compress level 6 (#720) remove a ling to trtigger build Update CODEOWNERS (#721) default uid and guid on process_src to None fix load(py_library) => load(py_binary) remove unneeded py_binary load write debian Date field in UTC rather than local time (#712) fix import in rpm test. (#713) Create scorecard.yml (#710) Merge verify_archive_test_lib with verify_archive_test_main.py.tpl (#705) Add a MODULE.bazel hint to the release not generator (#709) docs: add a note in pkg_tar#strip_prefix docs (v.0.8.0) about flattening (#699) [pkg_deb] Fix multiline fields in changes file (#691) Add a check to ensure that version.bzl and MODULE.bazel remain in sync. (#697) Fix typos in doc strings in `verify_archive.bzl` (#700) fix working dir on integration tests (#701) Add support for setting uid/gid from pkg_attributes (#671) Fix spelling mistakes (#695) Remove top level .bzl files. They are all in //pkg. (#688) Replace reference to bazel-dev with GitHub Discussions. Test: TreeHugger Bug: 324907235 Change-Id: I921d16c3d7b6fdc7e6fbff25788caea704eefcb1
2024-04-04Adopt ownership of rules_pkg by the Kleaf teamMatthias Maennich
Change-Id: Ie4ea86cf070bdc5bad91f77a8c95b1e9cf858b51 Signed-off-by: Matthias Maennich <maennich@google.com>
2024-02-08Update changelog and version numbers. (#819)upstream/0.10.1tonyaiuto
* update changelog * freshdocs
2024-02-08Temporarily restore //mappings.bzl and //pkg.bzl (#817)aiuto
* Restore mappings.bzl and pkg.bzl as a stopgap until https://github.com/protocolbuffers/protobuf/issues/15779 is fixed. * bump version number for upcoming patch release
2024-02-08Fix RPM package release and version files expansion (#816)Tomasz Wojno
2024-02-01Apply tar remap_paths to runfiles full paths (#812)Diego Ortin
2024-02-01Use raw string for docstring that contains a backslash (#815)Chuck Grindel
Python 3.12 started to complain about invalid escape sequences. https://docs.python.org/dev/whatsnew/3.12.html#other-language-changes One supposed to use r""" when dostrings contains backslashes """ https://stackoverflow.com/a/33734332
2024-01-31Update build_tar.pyAlex Bozhenko
Python 3.12 started to complain about invalid escape sequences. https://docs.python.org/dev/whatsnew/3.12.html#other-language-changes One supposed to use r""" when dostrings contains backslashes """ https://stackoverflow.com/a/33734332
2024-01-10doc and changelog update to go with 0.10.0 (#809)upstream/0.10.0aiuto
* add docs for 10
2024-01-10Fill out the CI matrix to cover the bazels that people use. (#807)aiuto
* Fill out the CI matrix to cover the bazels that people use. - bazel at head, LTS (7.x) and LTS-1 - with and without bzlmod enabled. * add names to replicate the task names - CI should do this rather than making them
2024-01-09Explicitly set the FILE bit in zip external attributes. (#804)aiuto
* 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
2024-01-02Allow substitution of user-defined variables in RPM preamble (#787)Mike Kelly
* Allow substitution of user-defined variables in RPM preamble It's desirable to be able to parameterize some variables in the preamble such as architecture when RPM packages. This change enables variable substitution in the preamble section so that the values may be injected in this fashion in lieu of only using statically defined values. * Deal with mismatched variable definitions Currently we don't handle things like $(foo or (bar) correctly. Lacking regex matching, we can compensate for this somewhat by attempting to find matching pairs of $( and ) and failing if we see the start of a variable declaration but not its termination.
2023-12-22update latest.md docs (#801)Chuck Grindel
They are stale, and looking into causes for #800
2023-12-22update docsTony Aiuto
2023-12-21Add %posttrans scriptlet to RPM package (#799)Tomasz Wojno
* Add %posttrans scriptlet to RPM package * Add scriptlets files tests
2023-12-21Allow additional RPM macro defines (#794)Mike Kelly
For some RPM packaging scenarios users may wish to define additional macros. This change enables us to do this using the `--rpmbuild_arg` argument to the `make_rpm.py` script by passing a dict of defines to the `pkg_rpm()` rule.
2023-12-21turn off doc building in CI (#797)Chuck Grindel
stardoc is borked if you have builds that are both WORKSPACE and bzlmod And at bazel 7.0.0 if we have a local_repository in MODULE.bazel that seems to break the build with a wonky errorr. I reverted to WORKSPACE.bzlmod in examples/naming to correct for that.
2023-12-20Merge remote-tracking branch 'origin/upstream'Inna Palant
Import b/315857945
2023-12-19back offTony Aiuto
2023-12-19try stardoc againTony Aiuto
2023-12-19Fall back to WORKSPACE.bzlmod for examples/naming. Something about a ↵Tony Aiuto
local_repository in MODULE.bazel and bazel 7.0.0 is wonky.
2023-12-19turn off doc building in CITony Aiuto
2023-12-19Explicitly set `%{_builddir}` macro (#792)Mike Kelly
rules_pkg has baked in the assumption that the value of `%{_builddir}` is going to be `%{_topdir}/BUILD` which is where rpmbuild will `cd` to when being run. When using the built in system rpmbuild in a situation where the value of `%{_builddir}` has been overriden with a custom local macro, this assumption may be broken which will result in internal rpmbuild failures. Because we make this assumption about the value of the macro, we can instead be explicit about what we want the value of `%{_builddir}` to be so as to avoid this problem altogether.
2023-12-18Add metadata for rules_pkg.upstreamYifan Hong
Third-Party Import of: https://github.com/bazelbuild/rules_pkg Request Document: go/android3p For CL Reviewers: go/android3p#cl-review For Build Team: go/ab-third-party-imports Bug: http://b/315857945 Change-Id: I28cfa8d9c62fabb65c0c0ba851dde75e01b32f19
2023-12-18Initial empty repositoryInna Palant
2023-12-01Update CODEOWNERS (#791)Alex Eagle
This PR is more of a question. Now that we have a BSD tar in Aspect's bazel-lib, I don't have much reason to get involved with the pkg_tar rule. Also I'm really overcommitted right now and haven't been doing a good job responding to pull requests. I discussed with Chuck that maybe he'd like to take my place here.
2023-11-28Bring tar runfiles up to feature parity with pkg_files.runfiles. (#754)aiuto
* Bring tar runfiles up to feature parity with pkg_files.runfiles. The bulk of the change is to have pkg_tar use pkg_files%add_label_list to process `srcs`. That brings it in conformance with pkg_files and pkg_zip. This changes the behavior of runfiles to be useful, but it is a breaking change. Fixes: #153 Fixes: #579 Other bits: - do not fail verify_archive_test without a min_size or max_size - change `data` file in the sample executable from BUILD to foo.cc so that it is easier to disambiguate from other files. - fix bug in runfiles support where files were not added to file_deps list. - fix bug in runfiles support where the runfiles base was not computed correctly. - some buildifier fixes to make the linters happy.
2023-11-27Only inject pre and post scriptlets when provided (#788)Mike Kelly
Currently if the consumer doesn't provide a value for the pre or post scriplets we inject an empty scriptlet which has the effect of constructing an RPM that appears to have these scriplets (although they're empty). Instead, we likely want to not provide them at all in these cases.
2023-11-22chore: suppress buildifier lint warnings (#776)Alex Eagle
Our goal is just to prevent new ones getting added by turning on buildifier checking in CI. Co-authored-by: aiuto <aiuto@google.com>
2023-11-22CI fixes (#784)aiuto
* do not use bzlmod for integration test * change distro target * split out doc_build to non bzlmod
2023-11-14Add yun as CI owner (#785)aiuto
* add yun as CI owner * remove unknown name
2023-11-13Little fixes to stop lint warnings (#783)aiuto
* Fix some typos, some missing loads and buildifier warnings.
2023-11-13Add support for `Obsoletes` tag in RPM definition (#778)Mike Kelly
Currently there doesn't appear to be any support `Obsoletes` in our RPM structure. This change introduces the support for the `Obsoletes` tag in the RPM specfile. Unlikely `Requires`, there doesn't appear to be a context-specific `Obsoletes`, so this is not added here.
2023-11-13fix the imports on the filter directory test (#782)aiuto
2023-11-07Don't load cc toolchain from rules_cc (#779)Yun Peng
* Don't load cc toolchain from rules_cc The cc toolchain autoconfig is out of sync from Bazel and doesn't work with VS2022. Related: https://github.com/bazelbuild/continuous-integration/pull/1770 * Fixes centos7
2023-11-06doc: Fixup external manual references (#777)Mike Kelly
The original links for the RPM manual that were being referred to appear to have moved. This update the links to point at the correct place.
2023-11-06chore: buildifier format all files (#775)Alex Eagle
2023-11-06chore: add a pre-commit hook config (#774)Alex Eagle
This matches the Bazel recommendation from https://github.com/bazel-contrib/rules-template for configuring an optional, client-side automation for formatting BUILD/bzl files before sending a PR. It has been found to save a bunch of time for contributors who otherwise trip over the server-side CI check and have to do an extra iteration to get their PR green. I imagine Googlers are already relying on some Piper feature to do the equivalent when they work on this code, so they haven't noticed the deficiency.
2023-11-06Refactor all the input processing code. (#756)aiuto
* Refactor all the input processing code. - Create a MappingContext to hold behaviors and defaults - Change calls - from `process_x(ctx, content_map, ..., default_x, default_y, ...)` - to `process_x(mapping_context, ...) 1. This brings the code more in line with the new preferred rule writing style. 1. A major motivation for the change is adding include_runfiles to pkg_tar, where we want to sometimes have add_label_list do the runfiles inclusion for us, and other times we want to revert to legacy behavior. If we always passed it in `ctx`, that would not be possible. * Syle nits * make buildifier happier
2023-10-31Get bzlmod working in CI (#766)aiuto
Get bzlmod CI working * fix a lot of python which needs tochange * make extension for rpmbuild * restore macos CI to rolling * better documentation on how to use rpmbuild. * no docbuild with bzlmod -> stardoc problems * disable a tar test that can not work with bzlmod Next: Split rpmbuild to a separately distributable artifact
2023-10-28use runfiles from rules_python (#768)aiuto
2023-10-24Use rules_cc to try to clean up CI runs which are failing on gcc (#764)aiuto
* try useing rules_cc to clean up CI runs which are failing on gcc" * use their toolchains * add rules_cc so the tests run * do not do distro tests on rolling macos * only tests tests/... for rolling_macos
2023-10-16When pkg_tar.prefix_dir == base of symlink path, don't double-dip. (#749)aiuto
* Correct for case where tar has prefix_dir and files/symlinks, but the user has already mapped the prefix_dir into those paths. Under the old behavior, prefix_dir was (incorrectly) not added to symlinks, so some users made the desired prefix part of the link. Protecting them against the double inclusion of the prefix is probably the least surprising behavior. Add tests for this, which required improving verify_archive_test. * make buildifier happy * do not run the symlink test on windows * huh? why are symlinks in a tree failing on CI?
2023-10-16add imports to fix bazel --noexperimental_python_import_all_repositories ↵August Karlstedt
flag (#630)
2023-10-16Align pkg_rpm returned files with other rules (#692)Tomasz Wojno
* Align pkg_rpm returned files with other rules pkg_rpm returns the package file named after `package_file_name` and a symbolic link to the file called `target_name`, while other rules do not return the symbolic link. * Merge branch 'bazelbuild:main' into main
2023-10-16pkg_deb: allow data.tar.zst (#761)Adam Azarchs
dpkg has officially supported zstandard compression for the data tarball since version 1.21.18, and despite shipping with dpkg version 1.21.1, most .deb packages for Ubuntu 22.04 are also in zst format. While this PR does not do anything to make it easier to create zstd-compressed tarballs, it does make it possible to use them when creating .deb packages. Closes #759
2023-10-06fix(pkg_tar): properly normalize paths for empty files (#760)Adam Azarchs
The directory prefix attribute for a `pkg_tar` was not being honored for empty files or empty directories. Closes #758