Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix publishing #133

Merged
merged 1 commit into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ boring-sys = { version = "3.0", path = "./boring-sys" }
boring = { version = "3.0", path = "./boring" }
tokio-boring = { version = "3.0", path = "./tokio-boring" }

bindgen = { version = "0.65.1", default-features = false, features = ["runtime"] }
bindgen = { version = "0.66.1", default-features = false, features = ["runtime"] }
cmake = "0.1"
fslock = "0.2"
bitflags = "1.0"
Expand Down
6 changes: 6 additions & 0 deletions boring-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ include = [
"/deps/boringssl/**/CMakeLists.txt",
"/deps/boringssl/**/sources.cmake",
"/deps/boringssl/LICENSE",
"/deps/boringssl-fips/**/*.[chS]",
"/deps/boringssl-fips/**/*.asm",
"/deps/boringssl-fips/src/**/*.cc",
"/deps/boringssl-fips/**/CMakeLists.txt",
"/deps/boringssl-fips/**/sources.cmake",
"/deps/boringssl/LICENSE",
"/build.rs",
"/src",
"/patches",
Expand Down
23 changes: 15 additions & 8 deletions boring-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,23 +406,30 @@ fn get_extra_clang_args_for_bindgen() -> Vec<String> {
}

fn ensure_patches_applied() -> io::Result<()> {
let out_dir = env::var("OUT_DIR").unwrap();
let mut lock_file = LockFile::open(&PathBuf::from(&out_dir).join(".patch_lock"))?;
let src_path = get_boringssl_source_path();

let mut lock_file = LockFile::open(&PathBuf::from(&src_path).join(".patch_lock"))?;
let is_in_submodule = Path::new(&src_path).join(".git").exists();

lock_file.lock()?;

let mut cmd = Command::new("git");
// NOTE: check that we are not in files copied for publishing, otherwise we will reset
// the upper level git repo which is the workspace itself.
if is_in_submodule {
println!("cargo:warning=cleaning up boringssl git submodule dir");

cmd.args(["reset", "--hard"]).current_dir(&src_path);
let mut cmd = Command::new("git");

run_command(&mut cmd)?;
cmd.args(["reset", "--hard"]).current_dir(&src_path);

let mut cmd = Command::new("git");
run_command(&mut cmd)?;

cmd.args(["clean", "-fdx"]).current_dir(&src_path);
let mut cmd = Command::new("git");

run_command(&mut cmd)?;
cmd.args(["clean", "-fdx"]).current_dir(&src_path);

run_command(&mut cmd)?;
}

if cfg!(feature = "pq-experimental") {
println!("cargo:warning=applying experimental post quantum crypto patch to boringssl");
Expand Down
Loading