This is an automated email from the ASF dual-hosted git repository.

nic-6443 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 211f8f6adc build: depend on a rapidjson rock that is not tied to the 
build host CPU (#13824)
211f8f6adc is described below

commit 211f8f6adc4fac1ecd9831e7e4ca83010450b60c
Author: Nic <[email protected]>
AuthorDate: Mon Aug 17 09:29:01 2026 +0800

    build: depend on a rapidjson rock that is not tied to the build host CPU 
(#13824)
---
 Makefile                                   |  1 -
 apisix-master-0.rockspec                   |  2 +-
 ci/install-lua-rapidjson.sh                | 51 ------------------------------
 ci/linux_apisix_current_luarocks_runner.sh |  1 -
 4 files changed, 1 insertion(+), 54 deletions(-)

diff --git a/Makefile b/Makefile
index 667a0774ee..0eb1cd7401 100644
--- a/Makefile
+++ b/Makefile
@@ -137,7 +137,6 @@ deps: install-runtime
                $(ENV_LUAROCKS) config $(ENV_LUAROCKS_FLAG_LOCAL) 
variables.OPENSSL_LIBDIR $(addprefix $(ENV_OPENSSL_PREFIX), /lib); \
                $(ENV_LUAROCKS) config $(ENV_LUAROCKS_FLAG_LOCAL) 
variables.OPENSSL_INCDIR $(addprefix $(ENV_OPENSSL_PREFIX), /include); \
                $(ENV_LUAROCKS) config $(ENV_LUAROCKS_FLAG_LOCAL) 
variables.YAML_DIR $(ENV_LIBYAML_INSTALL_PREFIX); \
-               LUAROCKS=$(ENV_LUAROCKS) ./ci/install-lua-rapidjson.sh deps; \
                $(ENV_LUAROCKS) install apisix-master-0.rockspec --tree deps 
--only-deps $(ENV_LUAROCKS_SERVER_OPT); \
        else \
                $(call func_echo_warn_status, "WARNING: You're not using 
LuaRocks 3.x; please remove the luarocks and reinstall it via 
https://raw.githubusercontent.com/apache/apisix/master/utils/linux-install-luarocks.sh";);
 \
diff --git a/apisix-master-0.rockspec b/apisix-master-0.rockspec
index 1e2f1de345..a9629ca318 100644
--- a/apisix-master-0.rockspec
+++ b/apisix-master-0.rockspec
@@ -87,7 +87,7 @@ dependencies = {
     "api7-lua-resty-aws == 2.0.2-1",
     "multipart = 0.5.11-1",
     "luautf8 = 0.2.0-1",
-    "rapidjson = 0.7.2-1",
+    "api7-lua-rapidjson = 0.7.2-0",
 }
 
 build = {
diff --git a/ci/install-lua-rapidjson.sh b/ci/install-lua-rapidjson.sh
deleted file mode 100755
index 3d723b692a..0000000000
--- a/ci/install-lua-rapidjson.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-set -euo pipefail
-
-RAPIDJSON_VERSION="${RAPIDJSON_VERSION:-0.7.2}"
-ROCKSPEC_VERSION="${ROCKSPEC_VERSION:-0.7.2-1}"
-LUAROCKS_BIN="${LUAROCKS:-luarocks}"
-TREE="${1:-}"
-
-if [ -n "${TREE}" ]; then
-    mkdir -p "${TREE}"
-    TREE="$(cd "${TREE}" && pwd)"
-fi
-
-workdir="$(mktemp -d)"
-trap 'rm -rf "${workdir}"' EXIT
-
-cd "${workdir}"
-"${LUAROCKS_BIN}" unpack rapidjson "${RAPIDJSON_VERSION}"
-cd "rapidjson-${ROCKSPEC_VERSION}/lua-rapidjson"
-
-# lua-rapidjson enables -march=native by default, which can leak the build
-# host's CPU features into the shipped rapidjson.so and crash on older CPUs.
-# Fail loudly if the expected line is gone so a silent native build can't slip 
in.
-if ! grep -q 'add_compile_options(-march=native)' CMakeLists.txt; then
-    echo "error: '-march=native' line not found in CMakeLists.txt; upstream 
may have changed" >&2
-    exit 1
-fi
-sed -i.bak '/add_compile_options(-march=native)/d' CMakeLists.txt && rm -f 
CMakeLists.txt.bak
-
-if [ -n "${TREE}" ]; then
-    "${LUAROCKS_BIN}" make "rapidjson-${ROCKSPEC_VERSION}.rockspec" 
--tree="${TREE}"
-else
-    "${LUAROCKS_BIN}" make "rapidjson-${ROCKSPEC_VERSION}.rockspec"
-fi
diff --git a/ci/linux_apisix_current_luarocks_runner.sh 
b/ci/linux_apisix_current_luarocks_runner.sh
index 742e16926c..849f455fd9 100755
--- a/ci/linux_apisix_current_luarocks_runner.sh
+++ b/ci/linux_apisix_current_luarocks_runner.sh
@@ -44,7 +44,6 @@ script() {
     sudo rm -rf /usr/local/share/lua/5.1/apisix
 
     # install APISIX with local version
-    ./ci/install-lua-rapidjson.sh
     luarocks install apisix-master-0.rockspec --only-deps > build.log 2>&1 || 
(cat build.log && exit 1)
     luarocks make apisix-master-0.rockspec > build.log 2>&1 || (cat build.log 
&& exit 1)
     # ensure all files under apisix is installed

Reply via email to