22 Commits

Author SHA1 Message Date
David Benjamin 7ac48573ce Update bazel dependencies
Change-Id: I3afbf792f654bad779e18eb505f1c820343af2b2
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/96748
Auto-Submit: David Benjamin <davidben@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: Lily Chen <chlily@google.com>
2026-06-05 11:29:31 -07:00
David Benjamin 7865747b91 Update CI deps
Change-Id: I3bbaf32196b0cfe0f2ff7cb37a4ebfa65e6a44a9
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/92108
Commit-Queue: Rudolf Polzer <rpolzer@google.com>
Reviewed-by: Rudolf Polzer <rpolzer@google.com>
Presubmit-BoringSSL-Verified: Boringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: David Benjamin <davidben@google.com>
2026-04-09 00:32:57 -07:00
David Benjamin b2dfa0f4e5 Update dependencies from BCR
Change-Id: Idf127bed5cf7813b996de60c264382e29dc52090
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/92107
Auto-Submit: David Benjamin <davidben@google.com>
Reviewed-by: Rudolf Polzer <rpolzer@google.com>
Commit-Queue: Rudolf Polzer <rpolzer@google.com>
2026-04-09 00:30:01 -07:00
David Benjamin 2e606c2dbf Update other dependencies
While I'm here. Also document how to pick the Bazel version.

libc++'s __config_site needs another update. They keep coming up with
new settings we're required to set.

Change-Id: I49feedd75e5a38f07927aa1880916aadcd6bd91a
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/88947
Auto-Submit: David Benjamin <davidben@google.com>
Commit-Queue: Lily Chen <chlily@google.com>
Reviewed-by: Lily Chen <chlily@google.com>
2026-02-09 15:07:10 -08:00
David Benjamin 2a5cd33a2a Update third_party/benchmark to 1.9.5
Picks up
https://github.com/google/benchmark/commit/d8db2f90b643eb28a12976beb4d57bcfb639911d

This results in deprecation warnings with benchmark::internal::Benchmark
so go ahead and fix those.

Also add third_party/benchmark to .bazelignore. This stops
`bazel test ...` from recursing in here. It looks like we previously
suppressed copying some files, but we can avoid having to post-process
the files this way.

Change-Id: Idf20fce28153a450fe03e121d9bc0d601d43ec6c
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/88948
Auto-Submit: David Benjamin <davidben@google.com>
Reviewed-by: Lily Chen <chlily@google.com>
Commit-Queue: Lily Chen <chlily@google.com>
2026-02-09 14:50:34 -08:00
David Benjamin 9788a2d730 Check in .bazelversion and MODULE.bazel.lock in util/bazel-example
In preparation for testing this on CI. For some reason I don't
understand, there were also some outstanding updates in
MODULE.bazel.lock for the root, yet CI was working. Document the command
to update MODULE.bazel.lock, taken from
https://bazel.build/external/lockfile#best-practices

(I'm not sure why this file is so large. Go's go.sum is fairly small and
controlled.)

Bug: 465497708
Change-Id: I8365c42facf5a345e270113bdc9be7cf8e7771af
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/85430
Reviewed-by: Lily Chen <chlily@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
Commit-Queue: Lily Chen <chlily@google.com>
2025-12-09 14:17:32 -08:00
Xiangfei Ding 23dec3c983 Use google/benchmark for performance tracking
In this patch we would vendor google/benchmark and break down the
benchmark into individual translation units, so that the benchmark
framework can apply filters on which benchmark code to run.

This patch vendors google/benchmark 1.9.4

Source: https://github.com/google/benchmark
Commit: eddb0241389718a23a42db6af5f0164b6e0139af

How to run the benchmark:

Benchmarks need to be built by passing in `-DBUILD_TESTING=ON` to CMake,
which is set by default.
To invoke the benchmarks, execute the `bssl_bench` binary.

You have the option to enumerate all of the benchmarks first by passing in
`--benchmark_list_tests`.
To run specific benchmarks, you may pass in `--benchmark_filter=$regex` where
`$regex` is an [`ECMAScript regular expression`](https://cppreference.com/w/cpp/regex/ecmascript.html).

You can specify a set of input sizes in bytes for relevant cipher suites
with the repeatable flag `-i` or `--input-size`.
You can let the benchmark run with a set of various thread counts with the
repeatable flag `-t` or `--threads`.
For more benchmark configuration options, you may read the manual by passing
in `--help` flag on launch.

Co-authored-by: Rudolf Polzer <rpolzer@google.com>
Bug: 383769319
Change-Id: Ic8d4cfd65065e61ae90c58bddb34463a5f398f14
Signed-off-by: Xiangfei Ding <xfding@google.com>
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/83327
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
2025-12-08 10:33:22 -08:00
David Benjamin 2e2a00337a Update all the Bazel things
It seems we need Bazel 7.6.2 or later to pick up a fix to the
apple_support package for the newest Xcode. Ideally we'd go to 7.7.0,
but CIPD seems not to have a package.

While I'm here, update other deps from BCR.

Change-Id: I30c339eda4aab22beed11d0acf1094dc5e16e4c9
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/83947
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: Lily Chen <chlily@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
Commit-Queue: Lily Chen <chlily@google.com>
2025-11-10 12:06:04 -08:00
David Benjamin 52bb3988e3 Update Bazel deps and bump version for BCR
Change-Id: I4cec91ceadf1be7413085f56c2f9efaa18fc8ca2
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/82547
Reviewed-by: Lily Chen <chlily@google.com>
Commit-Queue: Lily Chen <chlily@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
2025-10-02 10:17:00 -07:00
David Benjamin e20e848655 Bump Bazel deps and version for BCR
Change-Id: I0dfb264c2b7db6311902dd8b190da200a3092f24
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/81127
Auto-Submit: David Benjamin <davidben@google.com>
Commit-Queue: Adam Langley <agl@google.com>
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
2025-08-07 14:19:07 -07:00
David Benjamin f3dcc4660d Update tools and prep for 0.20250701.0
Change-Id: Ib5ea19193fac2956d0b57117bbe0a7109b51fe21
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/80067
Commit-Queue: Adam Langley <agl@google.com>
Reviewed-by: Adam Langley <agl@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
2025-07-01 10:17:32 -07:00
David Benjamin 02bc0949e5 Update most deps and bump version
I've kept the LLVM things back for now because Chrome seems to be in
some weird halfway point where libc++abi depends on a macro that libc++
doesn't have yet? I'm not really sure what's going on there and why it's
building for Chrome, but hopefully next time it will have settled.

I've also, for now, kept bazel at 7.5.0. We probably shouldn't update to
8.x on CI until that's our minimum version. There is a 7.6.1, but CIPD's
Bazel packages seem to only make a build for a version if newer than the
latest one, so all 7.x versions after 8.0.0's release are missing.

We may need to do something about this later, but ignoring the problem
for now.

Change-Id: Id17a3b394f68659e91a6dc563aaa40cd6912c1db
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/79327
Commit-Queue: Adam Langley <agl@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
2025-05-14 15:04:40 -07:00
David Benjamin b78bfd7153 Update dependencies
Notably Go and rules_cc, but also pick up the rest while I'm here.
Updating libc++ once again required reworking the config. They seem to
change it every couple of weeks.

Bug: 396087264
Change-Id: Ied0f6fa11cd8c34fe9f0f87e63fd6283a699a22c
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/76167
Auto-Submit: David Benjamin <davidben@google.com>
Reviewed-by: Bob Beck <bbe@google.com>
Commit-Queue: Bob Beck <bbe@google.com>
2025-02-13 09:45:44 -08:00
David Benjamin 571a7432a1 Bump MODULE.bazel for another snapshot
Also update deps from BCR while I'm here.

Change-Id: I7afe58655e966ab9e7d1c99d13a9c9f7594af51c
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/75229
Auto-Submit: David Benjamin <davidben@google.com>
Reviewed-by: Bob Beck <bbe@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
2025-01-14 14:15:03 -08:00
David Benjamin 059585c8da Update tools and add a .bazelversion
So that MODULE.bazel.lock is actually checked to be up-to-date, we
should run with --lockfile_mode=error on CI. But since the lock file
format changes by Bazel version, that means we also need to pick a
particular Bazel version.

This matches the best practices documented here:
https://bazel.build/external/lockfile#best-practices

To update libc++, we now need to pull in a bit of LLVM libc. See
https://discourse.llvm.org/t/rfc-project-hand-in-hand-llvm-libc-libc-code-sharing/77701

Change-Id: I53b28067bab86d34be8c76625d6bedc23f0baeba
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/73487
Commit-Queue: Adam Langley <agl@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
2024-11-28 00:01:55 +00:00
David Benjamin 81345b8450 Bump module version and Bazel dependencies
Not sure what cadence we'll settle to for these snapshots, but let's
kick off another one. I've gone ahead and updated the dependencies from
https://registry.bazel.build, because it seemed natural to just do those
at the same time.

Change-Id: Ifa609a80c110a1cbf196f9f1a23fb8d533b029f9
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/71667
Reviewed-by: Bob Beck <bbe@google.com>
Commit-Queue: Bob Beck <bbe@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
2024-10-01 22:18:09 +00:00
David Benjamin 40ec347196 Switch to rules_license
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>
2024-09-11 00:38:27 +00:00
David Benjamin 6abe18402e Update bzlmod dependencies
Change-Id: I073ca90b6f675bf0461ab1a953a5de6808d66968
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/71047
Commit-Queue: Adam Langley <agl@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
2024-09-10 23:16:32 +00:00
David Benjamin 824867d110 Fix one of two issues breaking the Bazel build
Adding a C++ file into libcrypto triggered some more Bazel workarounds
in our build. For whatever reason, that's now being passed a "frozen"
list, so we cannot mutate the values.

This isn't sufficient to fix it, as we're also running into issues with
aes/aes.c being an internal "header". To fix that, I think we have to
bite the bullet and finally rename the FIPS fragments to .h, reflecting
the fact that they are intended to be #included.

Also the new Bazel seems to have a different MODULE.bazel.lock format,
so pick up that update.

Bug: 362664827
Change-Id: Ibf80fa389e0e1fd2b6f1ab110f0dea78a2a1a89b
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/70627
Commit-Queue: Adam Langley <agl@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
2024-08-28 15:31:18 +00:00
David Benjamin 3a01cba9a5 Fix the Bazel build
The good news is we now have a way to test mistakes in the header lists
standalone. The bad news is we don't run it on CI.

Change-Id: Ie9e6efeb7922374efa38f8e4e8aab85174424f26
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/68469
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
2024-05-15 23:29:51 +00:00
David Benjamin 2db0eb3f96 Make googletest a full dependency, not a dev_dependency
In principle, googletest is only needed for tests and could be a
dev_dependency. But it would then be impossible for downstream modules
to run BoringSSL's tests. The downstream module provides the toolchain,
so we may need to request they run tests when triaging issues. If
https://github.com/bazelbuild/bazel/issues/22187 is ever fixed, we can
change this.

With this change, the following works:

  cd util/bazel-example
  bazelisk test @boringssl//:crypto_test

Change-Id: Ied2276047de134883d6b61b0789f3c7bfcaad669
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/68127
Commit-Queue: David Benjamin <davidben@google.com>
Commit-Queue: Adam Langley <agl@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
2024-04-29 23:21:36 +00:00
David Benjamin e2d7f2d625 Add a standalone Bazel build
Now that we can generate build files, we can actually maintain a Bazel
build in HEAD, without synthesizing a separate "-with-bazel" branch.
(Though we'll still need both for a transition, and until all the other
build modes have migrated.) Note this has a slightly different directory
structure than the old -with-bazel branch. But the targets are the same
and #include <openssl/whatever.h> still works, so hopefully it's
compatible.

For now, I'm only setting this up with the new bzlmod scheme. Also since
pulling in googletest is much less tedious with bzlmod, I've wired up
tests and everything.

https://bazel.build/external/overview#bzlmod

To build, run commands like:

   bazelisk build ...
   bazelisk test ...
   bazelisk run :bssl

The thinking is we can also go add this to CI and whatnot.

This is also intended to replace the boringssl module in the
bazel-central-registry which someone else set up already. To ease the
transition, I've seeded the compatibility_level value with theirs. (I
think we want to never bump it. Although we don't do SemVer, I think
bzlmod's MVS version selection scheme is generally reasonable. Bumping
it just introduces hiccups into the update process where projects need
to coordinate updates, and we do not want that.)

I wasn't clear on what to put in the version field in the tree, so I
just went with 0.0.0-dev so we don't have to change it, but it's still
vaguely analogous to the versions already in there.

As part of this, I've added support for Bazel's runfiles mechanism in
crypto/test/test_data.cc. This is completely undocumented and I had to
figure out how it works by guessing, but I believe this is the
officially supported way to make cc_test(data = ...) work? The official
documentation says to use devtools_build::GetDataDependencyFilepath, but
that API does not exist in the first place. I've also made it build with
C++17 for now, so we can build libpki, but C++14 consumers should still
be able to use this module, just not build libpki.

To that end, one difference between this and the old module is that we
no longer specify the C++ version in the build. From what I can tell,
Bazel does *not* want libraries to set the C/C++ version and prefers it
only come from the root. Unfortunately, they provide zero tools to
effectively manage this. I've followed this pattern for C++ versions, as
we can assume that Bazel projects are very aware of their C++ version,
but I've explicitly ignored it for the C version. Projects tend not to
change ABIs by C version, so it should be fine to set it internally.

For context when reviewing, the unreadable MODULE.bazel.lock is
automatically generated. I think the idea is that subsequent diffs will
be more readable??

Bug: 542
Change-Id: I88f68b2602a75f58cc6d18832a956f01dc054f58
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/67301
Auto-Submit: David Benjamin <davidben@google.com>
Commit-Queue: Bob Beck <bbe@google.com>
Reviewed-by: Bob Beck <bbe@google.com>
2024-04-26 22:19:48 +00:00