Skip to content

feat!: add nginx-src crate with vendored nginx sources #160

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bavshin-f5
Copy link
Member

See #85 for rationale. Also "solves" all the issues with the dependency URLs, bad signatures etc.

Proof of concept. I'm planning to restore the download code and make it strictly opt-in before I mark this as ready for review.

We had an inconvenient expectation that the nginx binary is installed
to the configured location and the default prefix is writable.

Instead of that, we should take the same approach as perl tests:

 * Create a temporary prefix and pass it to nginx.
 * Use binary from the build dir and allow overriding it with environment
   variable.
Ensure that nginx-sys/vendored is enabled and limit targets to Linux
x86_64.
@bavshin-f5 bavshin-f5 force-pushed the nginx-src branch 2 times, most recently from 9744571 to 4b7fd2c Compare July 7, 2025 16:31
@bavshin-f5 bavshin-f5 changed the title wip: add nginx-src crate with vendored nginx sources feat: add nginx-src crate with vendored nginx sources Jul 7, 2025
@bavshin-f5 bavshin-f5 changed the title feat: add nginx-src crate with vendored nginx sources feat!: add nginx-src crate with vendored nginx sources Jul 7, 2025
@bavshin-f5 bavshin-f5 marked this pull request as ready for review July 7, 2025 16:36
@bavshin-f5
Copy link
Member Author

I think that's good enough to start looking. The only remaining item is README.md update.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new nginx-src crate to vendor NGINX sources and updates the existing nginx-sys build to use it, refactors test harness for finding and running a local NGINX binary, and cleans up the old vendored.rs logic.

  • Introduces nginx-src submodule and crate for downloading, verifying, and building NGINX sources
  • Switches nginx-sys’s vendored feature to depend on nginx-src instead of in-repo vendored.rs
  • Updates tests to locate an NGINX binary via environment variables and cleans up deprecated test build script
Comments suppressed due to low confidence (4)

nginx-src/src/verifier.rs:28

  • There is no fs::exists function returning a Result; you should check existence with if !gnupghome.exists() { ... } (no ? needed).
        if !fs::exists(&gnupghome)? {

build.rs:57

  • Cargo build-script directives use a single colon (cargo:...), not double; change "cargo::rerun-if-env-changed=..." to "cargo:rerun-if-env-changed=...".
    println!("cargo::rerun-if-env-changed=DEP_NGINX_BUILD_DIR");

tests/nginx.conf:19

  • [nitpick] Commenting out include mime.types alters the test NGINX configuration; ensure tests don’t rely on MIME definitions or explicitly provide what’s needed.
    # include       mime.types;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant