Merge branch 'main' into precommit

This commit is contained in:
aiuto 2023-11-22 10:10:51 -05:00 committed by GitHub
commit 0314ccbcb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 88 additions and 60 deletions

View File

@ -5,7 +5,7 @@ common: &common
tasks:
centos7:
platform: centos7
platform: centos7_java11_devtoolset10
<<: *common
ubuntu1804:
platform: ubuntu1804

View File

@ -5,7 +5,7 @@ common: &common
tasks:
centos7:
platform: centos7
platform: centos7_java11_devtoolset10
<<: *common
ubuntu1804:
platform: ubuntu1804

View File

@ -5,7 +5,7 @@ common: &common
tasks:
centos7:
platform: centos7
platform: centos7_java11_devtoolset10
<<: *common
ubuntu1804:
platform: ubuntu1804

View File

@ -1,23 +1,17 @@
lts: &lts
bazel: latest
rolling: &rolling
bazel: rolling
common: &common
platform: ubuntu1804
working_directory: ..
build_targets:
- "distro:*"
- "distro:all"
tasks:
rolling_ubuntu:
name: rolling_distro
<<: *rolling
platform: ubuntu1804
bazel: rolling
<<: *common
lts_ubuntu:
name: lts_distro
platform: ubuntu1804
<<: *lts
bazel: latest
<<: *common

View File

@ -61,13 +61,9 @@ ubuntu1804: &ubuntu
platform: ubuntu1804
<<: *common
<<: *default_tests
build_targets:
- "//distro:distro"
- "//distro:relnotes"
- "//doc_build:*"
centos7: &centos
platform: centos7
platform: centos7_java11_devtoolset10
<<: *common
<<: *default_tests_with_rpm
@ -94,6 +90,9 @@ tasks:
platform: ubuntu1804
build_flags:
- "--enable_bzlmod"
build_targets:
- "//distro:distro"
- "//distro:relnotes"
<<: *common
<<: *rolling
<<: *default_tests
@ -118,6 +117,10 @@ tasks:
name: lts_ubuntu
<<: *ubuntu
<<: *lts
build_targets:
- "//distro:distro"
- "//distro:relnotes"
- "//doc_build:*"
lts_windows:
name: lts_windows
<<: *windows

View File

@ -5,7 +5,7 @@ build_targets: &build_targets
- '-@rules_pkg//pkg:make_rpm'
platforms:
centos7:
centos7_java11_devtoolset10:
build_targets: *build_targets
debian10:
build_targets: *build_targets

View File

@ -1,7 +1,12 @@
* @aiuto @alexeagle
/.bazelci/ @meteorcloudy
/.bcr/ @meteorcloudy
/.github/ @meteorcloudy
/.pre-commit-config.yaml @meteorcloudy
/deb_packages/ @aiuto
/docs/ @aiuto @alexeagle @jylinv0 @gregestren
/docs/ @aiuto @alexeagle @jylinv0
/doc_build/ @aiuto @alexeagle @jylinv0
/pkg/rpm/ @nacl
@ -9,6 +14,6 @@
/legacy/tests/rpm @nacl
/toolchains/rpm @nacl
/pkg/deb.bzl @aiuto @dannysullivan @jylinv0
/pkg/private/deb/ @aiuto @dannysullivan @jylinv0
/pkg/tests/deb/ @aiuto @dannysullivan @jylinv0
/pkg/deb.bzl @aiuto @dannysullivan
/pkg/private/deb/ @aiuto @dannysullivan
/pkg/tests/deb/ @aiuto @dannysullivan

View File

@ -79,8 +79,6 @@ http_archive(
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"],
)
load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains")
load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies")
rules_cc_dependencies()
rules_cc_toolchains()

View File

@ -15,9 +15,13 @@ local_repository(
#)
# Needed for making our release notes
#load("//toolchains/git:git_configure.bzl", "experimental_find_system_git")
#
#experimental_find_system_git(
# name = "rules_pkg_git",
# verbose = False,
#)
load("//toolchains/git:git_configure.bzl", "experimental_find_system_git_bzlmod")
experimental_find_system_git_bzlmod(
name = "rules_pkg_git",
verbose = False,
)
register_toolchains(
"@rules_pkg_git//:git_auto_toolchain",
"//toolchains/git:git_missing_toolchain",
)

View File

@ -32,8 +32,6 @@ http_archive(
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"],
)
load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains")
load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies")
rules_cc_dependencies()
rules_cc_toolchains()

View File

@ -105,4 +105,11 @@ py_binary(
visibility = ["//visibility:public"],
)
py_library(
name = "filter_directory_lib",
srcs = ["filter_directory.py"],
srcs_version = "PY3",
visibility = ["//visibility:public"],
)
exports_files(["verify_archive_test_main.py.tpl"])

View File

@ -181,7 +181,7 @@ pkg_deb_impl = rule(
Create a Debian package.
This rule produces 2 artifacts: a .deb and a .changes file. The DefaultInfo will
include both. If you need downstream rule to specificially depend on only the .deb or
include both. If you need downstream rule to specifically depend on only the .deb or
.changes file then you can use `filegroup` to select distinct output groups.
**OutputGroupInfo**

View File

@ -228,7 +228,7 @@ def _process_pkg_symlink(mapping_context, pkg_symlink_info, origin):
link_to = pkg_symlink_info.target,
)
def _process_pkg_filegroup(mapping_context, pkg_filegroup_info, _):
def _process_pkg_filegroup(mapping_context, pkg_filegroup_info):
if hasattr(pkg_filegroup_info, "pkg_dirs"):
for d in pkg_filegroup_info.pkg_dirs:
_process_pkg_dirs(mapping_context, d[0], d[1])
@ -267,7 +267,6 @@ def process_src(mapping_context, src, origin):
_process_pkg_filegroup(
mapping_context,
src[PackageFilegroupInfo],
origin,
)
found_info = True
if PackageSymlinkInfo in src:

View File

@ -18,6 +18,10 @@ All interfaces are subject to change at any time.
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
package(
default_applicable_licenses = ["//:license"],
)
licenses(["notice"])
filegroup(

View File

@ -321,6 +321,8 @@ def _pkg_rpm_impl(ctx):
preamble_pieces.extend(["Provides: " + p for p in ctx.attr.provides])
if ctx.attr.conflicts:
preamble_pieces.extend(["Conflicts: " + c for c in ctx.attr.conflicts])
if ctx.attr.obsoletes:
preamble_pieces.extend(["Obsoletes: " + o for o in ctx.attr.obsoletes])
if ctx.attr.requires:
preamble_pieces.extend(["Requires: " + r for r in ctx.attr.requires])
if ctx.attr.requires_contextual:
@ -710,7 +712,7 @@ pkg_rpm = rule(
Is the equivalent to `%config(missingok, noreplace)` in the `%files` list.
This rule produces 2 artifacts: an .rpm and a .changes file. The DefaultInfo will
include both. If you need downstream rule to specificially depend on only the .rpm or
include both. If you need downstream rule to specifically depend on only the .rpm or
.changes file then you can use `filegroup` to select distinct output groups.
**OutputGroupInfo**
@ -913,7 +915,7 @@ pkg_rpm = rule(
Corresponds to the "Conflicts" preamble tag.
See also: https://rpm.org/user_doc/dependencies.html
See also: https://rpm-software-management.github.io/rpm/manual/dependencies.html
""",
),
"provides": attr.string_list(
@ -921,15 +923,23 @@ pkg_rpm = rule(
Corresponds to the "Provides" preamble tag.
See also: https://rpm.org/user_doc/dependencies.html
See also: https://rpm-software-management.github.io/rpm/manual/dependencies.html
""",
),
"obsoletes": attr.string_list(
doc = """List of rpm capability expressions that this package obsoletes.
Corresponds to the "Obsoletes" preamble tag.
See also: https://rpm-software-management.github.io/rpm/manual/dependencies.html
""",
),
"requires": attr.string_list(
doc = """List of rpm capability expressions that this package requires.
Corresponds to the "Requires" preamble tag.
See also: https://rpm.org/user_doc/dependencies.html
See also: https://rpm-software-management.github.io/rpm/manual/dependencies.html
""",
),
"requires_contextual": attr.string_list_dict(
@ -964,7 +974,7 @@ pkg_rpm = rule(
For capabilities that are always required by packages at runtime,
use the `requires` attribute instead.
See also: https://rpm.org/user_doc/more_dependencies.html
See also: https://rpm-software-management.github.io/rpm/manual/more_dependencies.html
NOTE: `pkg_rpm` does not check if the keys of this dictionary are
acceptable to `rpm(8)`.

View File

@ -227,7 +227,9 @@ directory(
py_test(
name = "negative_tests",
srcs = ["test_filter_directory.py"],
data = ["//pkg:filter_directory"],
main = "test_filter_directory.py",
deps = ["@rules_python//python/runfiles"],
deps = [
"//pkg:filter_directory_lib",
"@rules_python//python/runfiles",
],
)

View File

@ -24,21 +24,9 @@ import sys
import tempfile
import unittest
from pkg import filter_directory
from python.runfiles import runfiles
# Get the filter_directory script into the import path. There might be a
# better way to do this, but it works.
rf = runfiles.Create()
filter_directory_script = rf.Rlocation('/'.join([
os.environ["TEST_WORKSPACE"],
"pkg",
"filter_directory"
]))
sys.path.append(os.path.dirname(filter_directory_script))
import filter_directory # noqa: E402
# TODO: These tests are largely to ensure that filter_directory fails, but it
# does not check _why_ they fail.

View File

@ -14,7 +14,7 @@
# -*- coding: utf-8 -*-
"""Tests for pkg_tar."""
load("@rules_python//python:defs.bzl", "py_test")
load("@rules_python//python:defs.bzl", "py_binary", "py_test")
# buildifier: disable=bzl-visibility
load("//pkg:mappings.bzl", "pkg_attributes", "pkg_files", "pkg_mkdirs", "pkg_mklink")
@ -579,7 +579,7 @@ pkg_tar(
symlinks = {
# We expect package_dir to apply to this
"tree_artifact/toss_in_another": "some_target",
# But we protect the user from duplicationg package_dir in their
# But we protect the user from duplicating package_dir in their
# link. That was the old behavior of symlink.
"new/base/something/this": "that",
},

View File

@ -77,3 +77,19 @@ def experimental_find_system_git(name, workspace_file = None, verbose = False):
"@%s//:git_auto_toolchain" % name,
"@rules_pkg//toolchains/git:git_missing_toolchain",
)
# buildifier: disable=function-docstring-args
def experimental_find_system_git_bzlmod(name, workspace_file = None, verbose = False):
"""Create a toolchain that lets you run git.
WARNING: This is experimental. The API and behavior are subject to change
at any time.
This presumes that your Bazel WORKSPACE file is located under your git
client. That is often true, but might not be in a multi-repo where you
might weave together a Bazel workspace from several git repos that are
all rooted under the WORKSPACE file.
"""
if not workspace_file:
workspace_file = Label("//:MODULE.bazel")
_find_system_git(name = name, workspace_file = workspace_file, verbose = verbose)