Skip to content

Commit

Permalink
Switch to rules_license
Browse files Browse the repository at this point in the history
Apparently Bazel has deprecated the built-in licenses() command and now
expects you to pull in an external package. I think I've gotten this
right?

Since our new BUILD.bazel file is actually referenced by the old
-with-bazel branch, this new dependency also needs to work there. That
is still using the legacy WORKSPACE system, but I got that working there
too, I think. However, as the legacy WORKSPACE system does not consider
recursive dependencies, anyone using it and updating BoringSSL will need
to, in turn, update their WORKSPACE file on update.

Fixed: 365824757
Change-Id: I7b49f33d628cec2ec07a47f0e31f16765d0f532a
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/71147
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: Ben Lawson <benlawson@google.com>
Reviewed-by: Adam Langley <agl@google.com>
  • Loading branch information
davidben authored and Boringssl LUCI CQ committed Sep 11, 2024
1 parent 6abe184 commit 40ec347
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 7 deletions.
29 changes: 23 additions & 6 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,31 @@ load(
"urandom_test_sources",
)
load(":util/util.bzl", "bssl_cc_binary", "bssl_cc_library", "bssl_cc_test")
load("@rules_license//rules:license.bzl", "license")

# Disable the parse_headers feature. It does not work well in C right now. See
# https://github.com/bazelbuild/bazel/issues/23460 for details. When that is
# fixed, if enabled, we likely also need to rename some headers to .inc per
# https://google.github.io/styleguide/cppguide.html#Self_contained_Headers
package(features = ["-parse_headers"])
package(
default_applicable_licenses = [":license"],
# Disable the parse_headers feature. It does not work well in C right now.
# See https://github.com/bazelbuild/bazel/issues/23460 for details. When
# that is fixed, if enabled, we likely also need to rename some headers to
# .inc per
# https://google.github.io/styleguide/cppguide.html#Self_contained_Headers
features = ["-parse_headers"],
)

licenses(["notice"])
license(
name = "license",
package_name = "BoringSSL",
# TODO(crbug.com/364634028): Update this once we've aligned with OpenSSL's
# new license.
license_kinds = [
"@rules_license//licenses/spdx:ISC",
"@rules_license//licenses/spdx:OpenSSL",
"@rules_license//licenses/spdx:MIT",
"@rules_license//licenses/spdx:SSLeay-standalone",
],
license_text = "LICENSE",
)

exports_files(["LICENSE"])

Expand Down
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ bazel_dep(name = "googletest", version = "1.15.2")

bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_license", version = "1.0.0")
3 changes: 2 additions & 1 deletion MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions util/WORKSPACE.toplevel
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
workspace(name = "boringssl")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "rules_license",
sha256 = "26d4021f6898e23b82ef953078389dd49ac2b5618ac564ade4ef87cced147b38",
urls = [
"https://github.com/bazelbuild/rules_license/releases/download/1.0.0/rules_license-1.0.0.tar.gz",
],
)

0 comments on commit 40ec347

Please sign in to comment.