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..44121b6 100644 --- a/nginx_module/build.rs +++ b/nginx_module/build.rs @@ -77,6 +77,9 @@ fn main() { fn search_nginx_root_folder() -> String { fn check_nginx_root(path: &Path) -> bool { + if path.ends_with("nginx-1.25.2") { + println!("cargo:warning: Testing nginx folder"); + } INCLUDE_SUBDIRS.iter().all(|subdir| { [path, Path::new(subdir)] .iter() @@ -96,8 +99,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 +109,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()