Skip to content

Commit

Permalink
Merge branch 'main' into precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
aiuto authored Nov 22, 2023
2 parents e13364c + dd4cb3c commit 0314ccb
Show file tree
Hide file tree
Showing 19 changed files with 88 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .bazelci/examples_naming.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ common: &common

tasks:
centos7:
platform: centos7
platform: centos7_java11_devtoolset10
<<: *common
ubuntu1804:
platform: ubuntu1804
Expand Down
2 changes: 1 addition & 1 deletion .bazelci/examples_rich_structure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ common: &common

tasks:
centos7:
platform: centos7
platform: centos7_java11_devtoolset10
<<: *common
ubuntu1804:
platform: ubuntu1804
Expand Down
2 changes: 1 addition & 1 deletion .bazelci/examples_stamping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ common: &common

tasks:
centos7:
platform: centos7
platform: centos7_java11_devtoolset10
<<: *common
ubuntu1804:
platform: ubuntu1804
Expand Down
14 changes: 4 additions & 10 deletions .bazelci/integration.yml
Original file line number Diff line number Diff line change
@@ -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
13 changes: 8 additions & 5 deletions .bazelci/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -94,6 +90,9 @@ tasks:
platform: ubuntu1804
build_flags:
- "--enable_bzlmod"
build_targets:
- "//distro:distro"
- "//distro:relnotes"
<<: *common
<<: *rolling
<<: *default_tests
Expand All @@ -118,6 +117,10 @@ tasks:
name: lts_ubuntu
<<: *ubuntu
<<: *lts
build_targets:
- "//distro:distro"
- "//distro:relnotes"
- "//doc_build:*"
lts_windows:
name: lts_windows
<<: *windows
Expand Down
2 changes: 1 addition & 1 deletion .bcr/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
* @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
/pkg/tests/rpm/ @nacl
/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
4 changes: 1 addition & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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()
16 changes: 10 additions & 6 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
4 changes: 1 addition & 3 deletions examples/rich_structure/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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()
7 changes: 7 additions & 0 deletions pkg/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
2 changes: 1 addition & 1 deletion pkg/private/deb/deb.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down
3 changes: 1 addition & 2 deletions pkg/private/pkg_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions pkg/private/tar/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
20 changes: 15 additions & 5 deletions pkg/rpm_pfg.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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**
Expand Down Expand Up @@ -913,23 +915,31 @@ 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(
doc = """List of rpm capabilities that this package provides.
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(
Expand Down Expand Up @@ -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)`.
Expand Down
6 changes: 4 additions & 2 deletions tests/mappings/filter_directory/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
)
14 changes: 1 addition & 13 deletions tests/mappings/filter_directory/test_filter_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,9 @@
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.
Expand Down
4 changes: 2 additions & 2 deletions tests/tar/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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",
},
Expand Down
16 changes: 16 additions & 0 deletions toolchains/git/git_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 0314ccb

Please sign in to comment.