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

Improve message when repo submods not initialized #647

Merged
merged 2 commits into from
Jan 9, 2025
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
3 changes: 3 additions & 0 deletions aws-lc-fips-sys/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ if (BUILD_SHARED_LIBS AND FIPS)
endif()

add_subdirectory(aws-lc aws-lc EXCLUDE_FROM_ALL)
if(NOT EXISTS aws-lc/CMakeLists.txt)
message(WARNING "###### WARNING: MISSING GIT SUBMODULE ###### Did you initialize the repo's git submodules? CMakeLists.txt not found.\n -- run 'git submodule update --init --recursive' to initialize.")
endif()

if (BUILD_LIBSSL)
add_definitions(-DAWS_LC_RUST_INCLUDE_SSL)
Expand Down
3 changes: 3 additions & 0 deletions aws-lc-sys/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ if(BUILD_SHARED_LIBS)
endif()

add_subdirectory(aws-lc aws-lc EXCLUDE_FROM_ALL)
if(NOT EXISTS aws-lc/CMakeLists.txt)
message(WARNING "###### WARNING: MISSING GIT SUBMODULE ###### Did you initialize the repo's git submodules? CMakeLists.txt not found.\n -- run 'git submodule update --init --recursive' to initialize.")
endif()

if (BUILD_LIBSSL)
add_definitions(-DAWS_LC_RUST_INCLUDE_SSL)
Expand Down
25 changes: 18 additions & 7 deletions aws-lc-sys/builder/cc_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,25 @@ impl CcBuilder {
let mut ret_val = false;
let output_dir = self.out_dir.join(format!("out-{basename}"));
let mut cc_build = self.create_builder();
let source_file = self
.manifest_dir
.join("aws-lc")
.join("tests")
.join("compiler_features_tests")
.join(format!("{basename}.c"));
if !source_file.exists() {
emit_warning("######");
emit_warning("###### WARNING: MISSING GIT SUBMODULE ######");
emit_warning(&format!(
" -- Did you initialize the repo's git submodules? Unable to find source file: {:?}.",
&source_file
));
emit_warning(" -- run 'git submodule update --init --recursive' to initialize.");
emit_warning("######");
emit_warning("######");
}
cc_build
.file(
self.manifest_dir
.join("aws-lc")
.join("tests")
.join("compiler_features_tests")
.join(format!("{basename}.c")),
)
.file(source_file)
.warnings_into_errors(true)
.out_dir(&output_dir);

Expand Down
12 changes: 12 additions & 0 deletions aws-lc-sys/builder/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,18 @@ fn main() {
bindings_available = true;
}
} else if is_bindgen_required() {
let aws_lc_crypto_dir = Path::new(&manifest_dir).join("aws-lc").join("crypto");
if !aws_lc_crypto_dir.exists() {
emit_warning("######");
emit_warning("###### WARNING: MISSING GIT SUBMODULE ######");
emit_warning(&format!(
" -- Did you initialize the repo's git submodules? Unable to find crypto directory: {:?}.",
&aws_lc_crypto_dir
));
emit_warning(" -- run 'git submodule update --init --recursive' to initialize.");
emit_warning("######");
emit_warning("######");
}
bindings_available = handle_bindgen(&manifest_dir, &prefix);
} else {
bindings_available = true;
Expand Down
Loading