Skip to content

Commit

Permalink
Patch with a prebuilt bindgen file to unblock development of crypto p…
Browse files Browse the repository at this point in the history
…rovider implementations. Will remove this patch once BUILD files are checked into boringssl repo.

Bug: b/354710816

Change-Id: Iba14ecda19ccc1f754766035e16a47470be9e75f
  • Loading branch information
Alex Orozco committed Aug 7, 2024
1 parent e873d98 commit 743f142
Show file tree
Hide file tree
Showing 4 changed files with 30,852 additions and 104 deletions.
39 changes: 4 additions & 35 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ http_archive(
name = "bssl",
patch_args = ["-p1"],
patch_tool = "patch",
patches = ["//third_party/boringssl:0001-add-bazel-rules-to-build-bssl-crypto.patch"],
sha256 = "6479eea14710345d131a3459b5622d23921d5c94d938038506a5cfb47a232789",
strip_prefix = "boringssl-00364d10b265d501f3800e6456e94bde88df58ef",
patches = ["//third_party/boringssl:boringssl.patch"],
sha256 = "a6d197fe3e5ad4d59dd5912a6ec9a8b69fc87f496ab11e05e7d0017b0ec70ecd",
strip_prefix = "boringssl-7a6e828dc53ba9a56bd49915f2a0780d63af97d2",
urls = [
# Head commit on 2024-07-25.
"https://github.com/google/boringssl/archive/00364d10b265d501f3800e6456e94bde88df58ef.zip",
"https://github.com/google/boringssl/archive/7a6e828dc53ba9a56bd49915f2a0780d63af97d2.zip",
],
)

Expand Down Expand Up @@ -338,34 +338,3 @@ create_oak_crate_repositories()
load("//bazel/crates:crates.bzl", "load_oak_crate_repositories")

load_oak_crate_repositories()

load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains")

rules_rust_dependencies()

rust_register_toolchains(
edition = "2021",
sha256s = {
"2024-02-01/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz": "7247ca497c7d9194c9e7bb9b6a51f8ccddc452bbce2977d608cabdbc1a0f332f",
"2024-02-01/clippy-nightly-x86_64-unknown-linux-gnu.tar.xz": "1271eaa89d50bd7f63b338616c36f41fe1e733b5d6c4cc2c95eaa6b3c8faba62",
"2024-02-01/cargo-nightly-x86_64-unknown-linux-gnu.tar.xz": "1d859549b5f3d2dd146b84aa13dfec24a05913653af2116b39a919cab69de850",
"2024-02-01/llvm-tools-nightly-x86_64-unknown-linux-gnu.tar.xz": "b227753189981d9a115527ba0e95b365388fb0fe7f1a1ff93116c4448c854197",
"2024-02-01/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz": "b1a444f8e8f33d813c4d532c12717743edd9b34f685ff5293b6375fc75c2421e",
},
versions = [
"1.76.0",
"nightly/2024-02-01",
],
)

# Additional setup for bindgen

load("@rules_rust//bindgen:repositories.bzl", "rust_bindgen_dependencies", "rust_bindgen_register_toolchains")

rust_bindgen_dependencies()

rust_bindgen_register_toolchains()

load("@rules_rust//bindgen:transitive_repositories.bzl", "rust_bindgen_transitive_dependencies")

rust_bindgen_transitive_dependencies()

This file was deleted.

32 changes: 32 additions & 0 deletions third_party/boringssl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Steps to reproduce boringssl.patch

## bindgen.rs

Make sure you have the dependencies needed to build
[bssl-sys](https://boringssl.googlesource.com/boringssl/+/refs/heads/master/rust/bssl-sys/README.md)

```shell
sudo apt install bindgen
sudo apt install cmake
sudo apt install ninja-build
cargo install cargo-deny
```

Download boringssl repo and build bssl-sys

```shell
git clone https://boringssl.googlesource.com/boringssl
cd boringssl
cmake -GNinja -B build -DRUST_BINDINGS=x86_64-unknown-linux-gnu
ninja -C build
```

This will generate the bindgen.rs file seen in the boringssl.patch file

## rest of files

The rest of the files (3) can just be manually created(bssl-crypto/BUILD, bssl-sys/BUILD) and edited(bssl-sys/src/lib.rs)

The BUILD files will not change (neither will the lib.rs file). The bindgen.rs file may need to be re-generated if the
boringssl commit in WORKSPACE is updated (ideally we will have upstreamed this patch to boringssl before then
[b/354710816](b/354710816)).
Loading

0 comments on commit 743f142

Please sign in to comment.