Skip to content

Commit

Permalink
Detect non-bazel builds and adjust patch paths accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
rushilmehra committed Jan 26, 2024
1 parent 01b14dc commit 2a474eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion boring-sys/build/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,15 +501,23 @@ fn ensure_patches_applied(config: &Config) -> io::Result<()> {

fn apply_patch(config: &Config, patch_name: &str) -> io::Result<()> {
let src_path = get_boringssl_source_path(config);
let is_bazel = src_path.join("/src").exists();
let cmd_path = config
.manifest_dir
.join("patches")
.join(patch_name)
.canonicalize()?;

let mut args = vec!["apply", "-v", "--whitespace=fix"];

// non-bazel versions of BoringSSL have no src/ dir
if !is_bazel {
args.push("-p2");
}

run_command(
Command::new("git")
.args(["apply", "-v", "--whitespace=fix"])
.args(&args)
.arg(cmd_path)
.current_dir(src_path),
)?;
Expand Down
2 changes: 1 addition & 1 deletion boring-sys/patches/rpk.patch
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@ index 8d5a23872..b9ac70dfe 100644

@@ -150,6 +169,7 @@ SSL_HANDSHAKE::SSL_HANDSHAKE(SSL *ssl_arg)
cert_compression_negotiated(false),
+ server_certificate_type_negotiated(false),
apply_jdk11_workaround(false),
can_release_private_key(false),
+ server_certificate_type_negotiated(false),
channel_id_negotiated(false) {
assert(ssl);

Expand Down

0 comments on commit 2a474eb

Please sign in to comment.