Fix publishing

This commit is contained in:
Ivan Nikulin 2023-07-29 10:52:54 +01:00 committed by Ivan Nikulin
parent c71e2bed39
commit 6435c5b8d5
3 changed files with 22 additions and 9 deletions

View File

@ -17,7 +17,7 @@ boring-sys = { version = "3.0", path = "./boring-sys" }
boring = { version = "3.0", path = "./boring" } boring = { version = "3.0", path = "./boring" }
tokio-boring = { version = "3.0", path = "./tokio-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" cmake = "0.1"
fslock = "0.2" fslock = "0.2"
bitflags = "1.0" bitflags = "1.0"

View File

@ -22,6 +22,12 @@ include = [
"/deps/boringssl/**/CMakeLists.txt", "/deps/boringssl/**/CMakeLists.txt",
"/deps/boringssl/**/sources.cmake", "/deps/boringssl/**/sources.cmake",
"/deps/boringssl/LICENSE", "/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", "/build.rs",
"/src", "/src",
"/patches", "/patches",

View File

@ -406,12 +406,18 @@ fn get_extra_clang_args_for_bindgen() -> Vec<String> {
} }
fn ensure_patches_applied() -> io::Result<()> { 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 src_path = get_boringssl_source_path();
let is_in_submodule = Path::new(&src_path).join(".git").exists();
let mut lock_file = LockFile::open(&PathBuf::from(&src_path).join(".patch_lock"))?;
lock_file.lock()?; lock_file.lock()?;
// 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");
let mut cmd = Command::new("git"); let mut cmd = Command::new("git");
cmd.args(["reset", "--hard"]).current_dir(&src_path); cmd.args(["reset", "--hard"]).current_dir(&src_path);
@ -423,6 +429,7 @@ fn ensure_patches_applied() -> io::Result<()> {
cmd.args(["clean", "-fdx"]).current_dir(&src_path); cmd.args(["clean", "-fdx"]).current_dir(&src_path);
run_command(&mut cmd)?; run_command(&mut cmd)?;
}
if cfg!(feature = "pq-experimental") { if cfg!(feature = "pq-experimental") {
println!("cargo:warning=applying experimental post quantum crypto patch to boringssl"); println!("cargo:warning=applying experimental post quantum crypto patch to boringssl");