moonming commented on code in PR #10729:
URL: https://github.com/apache/apisix/pull/10729#discussion_r1439120924
##########
utils/install-dependencies.sh:
##########
@@ -45,31 +45,25 @@ function install_dependencies_with_aur() {
# Install dependencies on centos and fedora
function install_dependencies_with_yum() {
sudo yum install -y yum-utils
-
- local common_dep="curl wget git gcc openresty-openssl111-devel unzip pcre
pcre-devel openldap-devel"
- if [ "${1}" == "centos" ]; then
- # add APISIX source
- local apisix_pkg=apache-apisix-repo-1.0-1.noarch
- rpm -q --quiet ${apisix_pkg} || sudo yum install -y
https://repos.apiseven.com/packages/centos/${apisix_pkg}.rpm
-
- # install apisix-runtime and some compilation tools
- # shellcheck disable=SC2086
- sudo yum install -y apisix-runtime $common_dep
- else
- # add OpenResty source
- sudo yum-config-manager --add-repo
"https://openresty.org/package/${1}/openresty.repo"
-
- # install OpenResty and some compilation tools
- # shellcheck disable=SC2086
- sudo yum install -y openresty $common_dep
+ sudo yum-config-manager --add-repo
"https://openresty.org/package/${1}/openresty.repo"
+ if [[ "${1}" == "centos" ]]; then
+ sudo yum -y install centos-release-scl
+ sudo yum -y install devtoolset-9 patch wget
+ set +eu
+ source scl_source enable devtoolset-9
+ set -eu
Review Comment:
What do these dependencies do? There was no such thing before
##########
docs/zh/latest/building-apisix.md:
##########
@@ -44,23 +44,22 @@ import TabItem from '@theme/TabItem';
## 源码安装 APISIX
-首先,你可以通过以下命令安装依赖项:
+首先,我们需要指定需要安装的版本`APISIX_VERSION`:
```shell
-curl
https://raw.githubusercontent.com/apache/apisix/master/utils/install-dependencies.sh
-sL | bash -
+APISIX_VERSION='3.7.0'
```
-然后,创建一个目录并设置环境变量 `APISIX_VERSION`:
+然后,你可以运行以下命令,从 Github 克隆 APISIX 源码:
```shell
-APISIX_VERSION='3.7.0'
-mkdir apisix-${APISIX_VERSION}
+git clone --depth 1 --branch ${APISIX_VERSION}
https://github.com/apache/apisix.git apisix-${APISIX_VERSION}
```
-现在,你可以运行以下命令,从 Github 克隆 APISIX 源码:
+现在,切换到 APISIX 源码的目录,你可以通过以下命令安装依赖项:
Review Comment:
No dependencies in the command line
##########
utils/install-dependencies.sh:
##########
@@ -45,31 +45,25 @@ function install_dependencies_with_aur() {
# Install dependencies on centos and fedora
function install_dependencies_with_yum() {
sudo yum install -y yum-utils
-
- local common_dep="curl wget git gcc openresty-openssl111-devel unzip pcre
pcre-devel openldap-devel"
- if [ "${1}" == "centos" ]; then
- # add APISIX source
- local apisix_pkg=apache-apisix-repo-1.0-1.noarch
- rpm -q --quiet ${apisix_pkg} || sudo yum install -y
https://repos.apiseven.com/packages/centos/${apisix_pkg}.rpm
-
- # install apisix-runtime and some compilation tools
- # shellcheck disable=SC2086
- sudo yum install -y apisix-runtime $common_dep
- else
- # add OpenResty source
- sudo yum-config-manager --add-repo
"https://openresty.org/package/${1}/openresty.repo"
-
- # install OpenResty and some compilation tools
- # shellcheck disable=SC2086
- sudo yum install -y openresty $common_dep
+ sudo yum-config-manager --add-repo
"https://openresty.org/package/${1}/openresty.repo"
+ if [[ "${1}" == "centos" ]]; then
+ sudo yum -y install centos-release-scl
+ sudo yum -y install devtoolset-9 patch wget
+ set +eu
+ source scl_source enable devtoolset-9
+ set -eu
fi
+ sudo yum install -y \
+ gcc gcc-c++ curl wget unzip xz gnupg perl-ExtUtils-Embed cpanminus
patch \
+ perl perl-devel pcre pcre-devel openldap-devel \
+ openresty-zlib-devel openresty-pcre-devel
Review Comment:
What do these dependencies do? There was no such thing before
##########
utils/install-dependencies.sh:
##########
@@ -45,31 +45,25 @@ function install_dependencies_with_aur() {
# Install dependencies on centos and fedora
function install_dependencies_with_yum() {
sudo yum install -y yum-utils
-
- local common_dep="curl wget git gcc openresty-openssl111-devel unzip pcre
pcre-devel openldap-devel"
- if [ "${1}" == "centos" ]; then
- # add APISIX source
- local apisix_pkg=apache-apisix-repo-1.0-1.noarch
- rpm -q --quiet ${apisix_pkg} || sudo yum install -y
https://repos.apiseven.com/packages/centos/${apisix_pkg}.rpm
-
- # install apisix-runtime and some compilation tools
- # shellcheck disable=SC2086
- sudo yum install -y apisix-runtime $common_dep
- else
- # add OpenResty source
- sudo yum-config-manager --add-repo
"https://openresty.org/package/${1}/openresty.repo"
-
- # install OpenResty and some compilation tools
- # shellcheck disable=SC2086
- sudo yum install -y openresty $common_dep
+ sudo yum-config-manager --add-repo
"https://openresty.org/package/${1}/openresty.repo"
+ if [[ "${1}" == "centos" ]]; then
+ sudo yum -y install centos-release-scl
+ sudo yum -y install devtoolset-9 patch wget
+ set +eu
+ source scl_source enable devtoolset-9
+ set -eu
fi
+ sudo yum install -y \
+ gcc gcc-c++ curl wget unzip xz gnupg perl-ExtUtils-Embed cpanminus
patch \
+ perl perl-devel pcre pcre-devel openldap-devel \
+ openresty-zlib-devel openresty-pcre-devel
}
# Install dependencies on ubuntu and debian
function install_dependencies_with_apt() {
# add OpenResty source
sudo apt-get update
- sudo apt-get -y install software-properties-common wget lsb-release
+ sudo apt-get -y install software-properties-common wget lsb-release gnupg
patch
Review Comment:
ditto
##########
ci/redhat-ci.sh:
##########
@@ -36,12 +36,9 @@ install_dependencies() {
# install apisix-runtime to make apisix's rpm test work
yum install -y yum-utils && yum-config-manager --add-repo
https://openresty.org/package/centos/openresty.repo
- rpm --import https://repos.apiseven.com/KEYS
- yum -y install
https://repos.apiseven.com/packages/centos/apache-apisix-repo-1.0-1.noarch.rpm
-
- export luajit_xcflags="-DLUAJIT_ASSERT -DLUAJIT_NUMMODE=2
-DLUAJIT_ENABLE_LUA52COMPAT -O0"
- export debug_args=--with-debug
+ yum install -y openresty-pcre-devel openresty-zlib-devel
Review Comment:
why add this?
##########
utils/install-dependencies.sh:
##########
@@ -83,8 +77,8 @@ function install_dependencies_with_apt() {
fi
sudo apt-get update
- # install OpenResty and some compilation tools
- sudo apt-get install -y git openresty curl openresty-openssl111-dev make
gcc libpcre3 libpcre3-dev libldap2-dev unzip
+ # install some compilation tools
+ sudo apt-get install -y curl make gcc g++ cpanminus libpcre3 libpcre3-dev
libldap2-dev unzip openresty-zlib-dev openresty-pcre-dev
Review Comment:
ditto
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]