diff --git a/.requirements b/.requirements index 0d23df5e71d..cb1e6e4b6f9 100644 --- a/.requirements +++ b/.requirements @@ -8,15 +8,8 @@ OPENSSL=3.2.1 OPENSSL_SHA256=83c7329fe52c850677d75e5d0b0ca245309b97e8ecbcfdc1dfdc4ab9fac35b39 PCRE=10.43 PCRE_SHA256=889d16be5abb8d05400b33c25e151638b8d4bac0e2d9c76e9d6923118ae8a34e - -LIBZLIB=1.3.1 -LIBZLIB_SHA256=9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23 LIBEXPAT=2.6.2 LIBEXPAT_SHA256=d4cf38d26e21a56654ffe4acd9cd5481164619626802328506a2869afab29ab3 -LIBYAML=0.2.5 -LIBYAML_SHA256=c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4 -LIBXCRYPT=4.4.36 -LIBXCRYPT_SHA256=e5e1f4caee0a01de2aee26e3138807d6d3ca2b8e67287966d1fefd65e1fd8943 # Note: git repositories can be loaded from local path if path is set as value diff --git a/build/cross_deps/README.md b/build/cross_deps/README.md new file mode 100644 index 00000000000..e2d52bf33b2 --- /dev/null +++ b/build/cross_deps/README.md @@ -0,0 +1,25 @@ +# Dependencies for cross build + +When cross building Kong (the target architecture is different from the host), +we need to build some extra dependencies to produce headers and dynamic libraries +to let compiler and linker work properly. + +Following are the dependencies: +- libxcrypt +- libyaml +- zlib + +Note that the artifacts of those dependencies are only used during build time, +they are not shipped together with our binary artifact (.deb, .rpm or docker image etc). + +We currently do cross compile on following platforms: +- Amazonlinux 2 +- Amazonlinux 2023 +- Ubuntu 18.04 (Version 3.4.x.x only) +- Ubuntu 22.04 +- RHEL 9 +- Debian 12 + +As we do not use different versions in different distros just for simplicity, the version +of those dependencies should remain the lowest among all distros originally shipped, to +allow the produced artifacts has lowest ABI/API to be compatible across all distros. \ No newline at end of file diff --git a/build/cross_deps/libxcrypt/repositories.bzl b/build/cross_deps/libxcrypt/repositories.bzl index ebca076b209..ec6d450ba46 100644 --- a/build/cross_deps/libxcrypt/repositories.bzl +++ b/build/cross_deps/libxcrypt/repositories.bzl @@ -1,21 +1,19 @@ """A module defining the third party dependency OpenResty""" load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@kong_bindings//:variables.bzl", "KONG_VAR") def libxcrypt_repositories(): """Defines the libcrypt repository""" - version = KONG_VAR["LIBXCRYPT"] - # many distros starts replace glibc/libcrypt with libxcrypt # thus crypt.h and libcrypt.so.1 are missing from cross tool chain # ubuntu2004: 4.4.10 # ubuntu2204: 4.4.27 + # NOTE: do not bump the following version, see build/cross_deps/README.md for detail. http_archive( name = "cross_deps_libxcrypt", - url = "https://github.com/besser82/libxcrypt/releases/download/v" + version + "/libxcrypt-" + version + ".tar.xz", - sha256 = KONG_VAR["LIBXCRYPT_SHA256"], - strip_prefix = "libxcrypt-" + version, + url = "https://github.com/besser82/libxcrypt/releases/download/v4.4.27/libxcrypt-4.4.27.tar.xz", + sha256 = "500898e80dc0d027ddaadb5637fa2bf1baffb9ccd73cd3ab51d92ef5b8a1f420", + strip_prefix = "libxcrypt-4.4.27", build_file = "//build/cross_deps/libxcrypt:BUILD.libxcrypt.bazel", ) diff --git a/build/cross_deps/libyaml/repositories.bzl b/build/cross_deps/libyaml/repositories.bzl index bf92e27d716..dffd0798cde 100644 --- a/build/cross_deps/libyaml/repositories.bzl +++ b/build/cross_deps/libyaml/repositories.bzl @@ -2,17 +2,15 @@ load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@kong_bindings//:variables.bzl", "KONG_VAR") def libyaml_repositories(): """Defines the libyaml repository""" - version = KONG_VAR["LIBYAML"] - + # NOTE: do not bump the following version, see build/cross_deps/README.md for detail. http_archive( name = "cross_deps_libyaml", - url = "https://pyyaml.org/download/libyaml/yaml-" + version + ".tar.gz", - sha256 = KONG_VAR["LIBYAML_SHA256"], - strip_prefix = "yaml-" + version, + url = "https://pyyaml.org/download/libyaml/yaml-0.2.5.tar.gz", + sha256 = "c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4", + strip_prefix = "yaml-0.2.5", build_file = "//build/cross_deps/libyaml:BUILD.libyaml.bazel", ) diff --git a/build/cross_deps/zlib/repositories.bzl b/build/cross_deps/zlib/repositories.bzl index fb9d28642cd..325c23a5ac3 100644 --- a/build/cross_deps/zlib/repositories.bzl +++ b/build/cross_deps/zlib/repositories.bzl @@ -2,20 +2,18 @@ load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@kong_bindings//:variables.bzl", "KONG_VAR") def zlib_repositories(): """Defines the zlib repository""" - version = KONG_VAR["LIBZLIB"] - + # NOTE: do not bump the following version, see build/cross_deps/README.md for detail. http_archive( name = "cross_deps_zlib", urls = [ - "https://zlib.net/zlib-" + version + ".tar.gz", - "https://zlib.net/fossils/zlib-" + version + ".tar.gz", + "https://zlib.net/zlib-1.2.13.tar.gz", + "https://zlib.net/fossils/zlib-1.2.13.tar.gz", ], - sha256 = KONG_VAR["LIBZLIB_SHA256"], - strip_prefix = "zlib-" + version, + sha256 = "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30", + strip_prefix = "zlib-1.2.13", build_file = "//build/cross_deps/zlib:BUILD.zlib.bazel", ) diff --git a/changelog/unreleased/kong/bump-libxcrypt.yml b/changelog/unreleased/kong/bump-libxcrypt.yml deleted file mode 100644 index 9327b40487d..00000000000 --- a/changelog/unreleased/kong/bump-libxcrypt.yml +++ /dev/null @@ -1,3 +0,0 @@ -message: "Bumped libxcrypt to 4.4.36" -type: dependency -scope: Core diff --git a/changelog/unreleased/kong/bump-zlib.yml b/changelog/unreleased/kong/bump-zlib.yml deleted file mode 100644 index a37e27b45f6..00000000000 --- a/changelog/unreleased/kong/bump-zlib.yml +++ /dev/null @@ -1,3 +0,0 @@ -message: "Bumped zlib to 1.3.1" -type: dependency -scope: Core