-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkong-3.3.0.patch
97 lines (91 loc) · 3.84 KB
/
kong-3.3.0.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
diff --git a/Makefile b/Makefile
index 917e0070b..4ce00f90f 100644
--- a/Makefile
+++ b/Makefile
@@ -86,7 +86,6 @@ install-dev-rocks: build-venv
dev: build-venv install-dev-rocks bin/grpcurl
build-release: check-bazel
- $(BAZEL) build clean --expunge
$(BAZEL) build //build:kong --verbose_failures --config release
package/deb: check-bazel build-release
diff --git a/build/nfpm/repositories.bzl b/build/nfpm/repositories.bzl
index cc719072e..c3bbf0eb2 100644
--- a/build/nfpm/repositories.bzl
+++ b/build/nfpm/repositories.bzl
@@ -15,6 +15,8 @@ def _nfpm_release_select_impl(ctx):
os_arch = "arm64"
elif os_arch == "amd64":
os_arch = "x86_64"
+ elif os_arch == "s390x":
+ os_arch = "s390x"
else:
fail("Unsupported arch %s" % os_arch)
@@ -38,13 +40,14 @@ def nfpm_repositories():
npfm_matrix = [
["linux", "x86_64", "4c63031ddbef198e21c8561c438dde4c93c3457ffdc868d7d28fa670e0cc14e5"],
["linux", "arm64", "2af1717cc9d5dcad5a7e42301dabc538acf5d12ce9ee39956c66f30215311069"],
+ ["linux", "s390x", "4c63031ddbef198e21c8561c438dde4c93c3457ffdc868d7d28fa670e0cc14e5"],
["Darwin", "x86_64", "fb3b8ab5595117f621c69cc51db71d481fbe733fa3c35500e1b64319dc8fd5b4"],
["Darwin", "arm64", "9ca3ac6e0c4139a9de214f78040d1d11dd221496471696cc8ab5d357850ccc54"],
]
for name, arch, sha in npfm_matrix:
http_archive(
name = "nfpm_%s_%s" % (name, arch),
- url = "https://github.com/goreleaser/nfpm/releases/download/v2.23.0/nfpm_2.23.0_%s_%s.tar.gz" % (name, arch),
+ url = "https://github.com/goreleaser/nfpm/releases/download/v2.23.0/nfpm_2.23.0_%s_x86_64.tar.gz" % (name),
sha256 = sha,
build_file = "//build/nfpm:BUILD.bazel",
)
diff --git a/build/nfpm/rules.bzl b/build/nfpm/rules.bzl
index d6f5bb94f..14a6ca678 100644
--- a/build/nfpm/rules.bzl
+++ b/build/nfpm/rules.bzl
@@ -11,6 +11,8 @@ def _nfpm_pkg_impl(ctx):
target_cpu = ctx.attr._cc_toolchain[cc_common.CcToolchainInfo].cpu
if target_cpu == "k8" or target_cpu == "x86_64" or target_cpu == "amd64":
target_arch = "amd64"
+ if target_cpu == "s390" or target_cpu == "s390x":
+ target_arch = "s390x"
elif target_cpu == "aarch64" or target_cpu == "arm64":
target_arch = "arm64"
else:
@@ -24,7 +26,7 @@ def _nfpm_pkg_impl(ctx):
if pkg_ext == "apk":
pkg_ext = "apk.tar.gz"
- # create like kong.amd64.deb
+ # create like kong.<target_arch>.deb package
out = ctx.actions.declare_file("%s/%s.%s.%s" % (
ctx.attr.out_dir,
ctx.attr.pkg_name,
@@ -41,7 +43,7 @@ def _nfpm_pkg_impl(ctx):
ctx.actions.run_shell(
inputs = ctx.files._nfpm_bin,
mnemonic = "nFPM",
- command = "ln -sf %s nfpm-prefix; external/nfpm/nfpm $@" % KONG_VAR["BUILD_DESTDIR"],
+ command = "ln -sf %s nfpm-prefix; build/nfpm/nfpm $@" % KONG_VAR["BUILD_DESTDIR"],
arguments = [nfpm_args],
outputs = [out],
env = env,
diff --git a/build/openresty/BUILD.openresty.bazel b/build/openresty/BUILD.openresty.bazel
index 812ddfb9e..4cfaa90e8 100644
--- a/build/openresty/BUILD.openresty.bazel
+++ b/build/openresty/BUILD.openresty.bazel
@@ -84,6 +84,7 @@ make(
"-j" + KONG_VAR["NPROC"],
"install",
],
+ postfix_script = "make clean; ASFLAGS= make all PREFIX=$INSTALLDIR; ASFLAGS= make install PREFIX=$INSTALLDIR",
visibility = ["//visibility:public"],
)
diff --git a/kong/pdk/nginx.lua b/kong/pdk/nginx.lua
index f5715e03e..7d1daa479 100644
--- a/kong/pdk/nginx.lua
+++ b/kong/pdk/nginx.lua
@@ -12,7 +12,7 @@ local arch = ffi.arch
local ngx = ngx
local tonumber = tonumber
-if arch == "x64" or arch == "arm64" then
+if arch == "x64" or arch == "s390x" or arch == "arm64" then
ffi.cdef[[
uint64_t *ngx_stat_active;
uint64_t *ngx_stat_reading;