Skip to content

feat: add macOS development environment support - #1

Closed
moonming wants to merge 2 commits into
masterfrom
feat/mac-dev-env-support
Closed

moonming wants to merge 2 commits into
masterfrom
feat/mac-dev-env-support

Conversation

@moonming

Copy link
Copy Markdown
Owner

Summary

This PR adds comprehensive support for setting up the APISIX development and testing environment on macOS using Homebrew and standard OpenResty.

Changes

  1. Makefile:

    • Added conditional logic to detect darwin (macOS).
    • Updated ENV_OPENSSL_PREFIX and ENV_LIBYAML_INSTALL_PREFIX to use brew --prefix.
    • Added LUAROCKS_LUA_FLAG to point LuaRocks to the OpenResty LuaJIT installation managed by Homebrew.
    • Prevented sudo usage for OpenResty symlinking on macOS (not needed/recommended for Homebrew).
  2. apisix-master-0.rockspec:

    • Added "macosx" to the supported_platforms list.
  3. t/APISIX.pm (Test Runner):

    • Fix Plugin Loading: Modified the Nginx configuration generation to unconditionally include lua_shared_dict definitions (like prometheus-cache) in the http {} block. This fixes crashes when running tests with standard OpenResty (which lacks the apisix-nginx-module signature).
    • HTTP/3 Compatibility: Added a check for http_v3_module before enabling http3 on and reuseport directives, preventing failures on Nginx builds without HTTP/3 support.
    • Event Module: Switched the default event module to lua-resty-worker-events to match standard OpenResty capabilities better.
  4. utils/install-dependencies.sh:

    • Added a install_dependencies_with_brew function to automate installing OpenResty, LuaRocks, OpenSSL, and LibYAML via Homebrew on macOS.

Verification

  • Environment setup verified on macOS.
  • Passed core tests (e.g., t/core/json.t) which previously failed due to missing shared dictionaries.

This change modifies the eureka discovery module to iterate through the configured list of Eureka servers when fetching the registry. If a server is unreachable or returns an error, it proceeds to the next one, ensuring high availability of the discovery mechanism. A new test case is added to verify this failover behavior.
* Update Makefile to handle macos paths and dependencies
* Update rockspec to support macosx platform
* Patch t/APISIX.pm to fix test runner on standard OpenResty
* Update install-dependencies.sh to support Homebrew installation
@moonming moonming closed this Jan 16, 2026
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