Bazel rules for creating packages of many types (zip, tar, deb, rpm, ...) https://bazelbuild.github.io/rules_pkg/
Go to file
Yun Peng e97d155ebe
Don't load cc toolchain from rules_cc (#779)
* 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-07 11:28:30 -05:00
.bazelci Don't load cc toolchain from rules_cc (#779) 2023-11-07 11:28:30 -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 remove the obsolete deb_packages code. (#547) 2022-03-07 10:41:02 -05:00
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 When pkg_tar.prefix_dir == base of symlink path, don't double-dip. (#749) 2023-10-16 16:10:06 -04:00
examples Don't load cc toolchain from rules_cc (#779) 2023-11-07 11:28:30 -05:00
pkg doc: Fixup external manual references (#777) 2023-11-06 19:53:06 -08:00
tests chore: buildifier format all files (#775) 2023-11-06 13:29:07 -05:00
toolchains chore: buildifier format all files (#775) 2023-11-06 13:29:07 -05:00
.bazelignore Add .bazelignore to skip examples, deb_packages subdirectories (#457) 2021-11-04 16:01:56 -04:00
.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 Correct mistakes in a recent push. (#449) 2021-11-04 14:38:00 -04:00
BUILD chore: buildifier format all files (#775) 2023-11-06 13:29:07 -05:00
CHANGELOG.md Fix spelling mistakes (#695) 2023-05-01 13:19:34 -04:00
CODEOWNERS Update CODEOWNERS (#721) 2023-08-09 15:37:49 -04:00
CONTRIBUTING.md html != md 2020-07-14 20:18:47 -04:00
CONTRIBUTORS Start a developer docs page (#413) 2021-09-01 21:42:29 -04:00
LICENSE initial commit 2017-12-21 14:20:32 -05:00
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 Create basic bzlmod setup for rules_pkg. (#625) 2022-10-20 10:46:25 -04:00
deps.bzl Fix some lint warnings. (#519) 2022-02-03 21:38:56 -05:00
developers.md pkg_zip: Some unicode file handling fixes and basic tests (#641) 2023-02-13 23:25:09 -05:00
patching.md Replace reference to bazel-dev with GitHub Discussions. 2023-04-21 13:10:11 +00:00
version.bzl Add a check to ensure that version.bzl and MODULE.bazel remain in sync. (#697) 2023-05-23 00:38:01 -04: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