Bazel rules for creating packages of many types (zip, tar, deb, rpm, ...) https://bazelbuild.github.io/rules_pkg/
Go to file
aiuto 52996b06c3
Temporarily restore //mappings.bzl and //pkg.bzl (#817)
* 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-08 15:43:00 -05:00
.bazelci Fill out the CI matrix to cover the bazels that people use. (#807) 2024-01-10 09:17:10 -05:00
.bcr Don't load cc toolchain from rules_cc (#779) 2023-11-07 11:28:30 -05:00
.github/workflows Create scorecard.yml (#710) 2023-06-27 12:07:47 -04:00
deb_packages
distro chore: buildifier format all files (#775) 2023-11-06 13:29:07 -05:00
doc_build chore: buildifier format all files (#775) 2023-11-06 13:29:07 -05:00
docs doc and changelog update to go with 0.10.0 (#809) 2024-01-10 16:07:09 -05:00
examples Fall back to WORKSPACE.bzlmod for examples/naming. Something about a local_repository in MODULE.bazel and bazel 7.0.0 is wonky. 2023-12-19 14:30:48 -05:00
pkg Fix RPM package release and version files expansion (#816) 2024-02-08 10:05:58 -05:00
tests Fix RPM package release and version files expansion (#816) 2024-02-08 10:05:58 -05:00
toolchains chore: suppress buildifier lint warnings (#776) 2023-11-22 10:15:33 -05:00
.bazelignore
.gitignore use runfiles from rules_python (#768) 2023-10-28 11:14:40 -04:00
.pre-commit-config.yaml chore: add a pre-commit hook config (#774) 2023-11-06 13:21:34 -05:00
AUTHORS
BUILD chore: buildifier format all files (#775) 2023-11-06 13:29:07 -05:00
CHANGELOG.md doc and changelog update to go with 0.10.0 (#809) 2024-01-10 16:07:09 -05:00
CODEOWNERS Update CODEOWNERS (#791) 2023-12-01 14:56:01 -05:00
CONTRIBUTING.md
CONTRIBUTORS
LICENSE
MODULE.bazel chore: buildifier format all files (#775) 2023-11-06 13:29:07 -05:00
README.md Get bzlmod working in CI (#766) 2023-10-31 09:23:37 -04:00
WORKSPACE Don't load cc toolchain from rules_cc (#779) 2023-11-07 11:28:30 -05:00
WORKSPACE.bzlmod CI fixes (#784) 2023-11-22 09:33:50 -05:00
deps.bzl
developers.md
mappings.bzl Temporarily restore //mappings.bzl and //pkg.bzl (#817) 2024-02-08 15:43:00 -05:00
patching.md
pkg.bzl Temporarily restore //mappings.bzl and //pkg.bzl (#817) 2024-02-08 15:43:00 -05:00
version.bzl Temporarily restore //mappings.bzl and //pkg.bzl (#817) 2024-02-08 15:43:00 -05:00

README.md

Bazel package building

Bazel rules for building tar, zip, deb, and rpm for packages.

For the latest version, see Releases (with WORKSPACE setup) / Documentation

Use rules-pkg-discuss@googlegroups.com for discussion.

CI: Build status

Basic rules

Package building rules

  • pkg - Rules for building packages of various types.
  • examples - Cookbook examples for using the rules.

As of Bazel 4.x, Bazel uses this rule set for packaging its distribution. Bazel still contains a limited version of pkg_tar but its feature set is frozen. Any new capabilities will be added here.

WORKSPACE setup

Sample, but see releases for the current release.

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_pkg",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz",
        "https://github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz",
    ],
    sha256 = "8f9ee2dc10c1ae514ee599a8b42ed99fa262b757058f65ad3c384289ff70c4b8",
)
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
rules_pkg_dependencies()

To use pkg_rpm(), you must provide a copy of rpmbuild. You can use the system installed rpmbuild with this stanza.

load("@rules_pkg//toolchains/rpm:rpmbuild_configure.bzl", "find_system_rpmbuild")

find_system_rpmbuild(
    name = "rules_pkg_rpmbuild",
    verbose = False,
)

MODULE.bazel setup

bazel_dep(name = "rules_pkg", version = "0.0.10")

To use pkg_rpm(), you must provide a copy of rpmbuild. You can use the system installed rpmbuild with this stanza.

find_rpm = use_extension("//toolchains/rpm:rpmbuild_configure.bzl", "find_system_rpmbuild_bzlmod")
use_repo(find_rpm, "rules_pkg_rpmbuild")
register_toolchains("@rules_pkg_rpmbuild//:all")

For developers

We hold an engineering status meeting on the first Monday of every month at 10am USA East coast time. Add to calendar / meeting notes