diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8dbdbbc..a2fefd1 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -24,6 +24,7 @@ jobs: apt install -y curl build-essential libpcre3 libpcre3-dev zlib1g zlib1g-dev libssl-dev libgd-dev libxml2 libxml2-dev uuid-dev clang curl http://nginx.org/download/nginx-1.25.2.tar.gz | tar xz ls -l + ls -l nginx-1.25.2 echo $PWD cargo build --verbose - name: Run tests diff --git a/nginx_module/build.rs b/nginx_module/build.rs index 4635a2c..d7e5261 100644 --- a/nginx_module/build.rs +++ b/nginx_module/build.rs @@ -77,7 +77,18 @@ fn main() { fn search_nginx_root_folder() -> String { fn check_nginx_root(path: &Path) -> bool { + let mut debug = false; + if path.ends_with("nginx-1.25.2") { + println!("cargo:warning=Testing nginx folder"); + debug = true; + } INCLUDE_SUBDIRS.iter().all(|subdir| { + if debug { + let subdir_path = [path, Path::new(subdir)] + .iter() + .collect::(); + println!("cargo:warning={subdir} is dir: {}", subdir_path.is_dir()) + } [path, Path::new(subdir)] .iter() .collect::() @@ -96,8 +107,9 @@ fn search_nginx_root_folder() -> String { // First, try to find the include folders in any of the parent folders of this folder, // This is the case when this is a submodule of nginx + let manifest_dir = env!("CARGO_MANIFEST_DIR"); for base in base_locations { - let folder = base.to_string(); + let folder = format!("{manifest_dir}/{base}"); if check_nginx_root(Path::new(&folder)) { return folder; } @@ -105,6 +117,7 @@ fn search_nginx_root_folder() -> String { // If we are not a nginx submodule, try to find the folder side by side for base in base_locations { + let base = format!("{manifest_dir}/{base}"); for entry in std::fs::read_dir(base) .expect("Cannot read directory") .flatten()