Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "chore(deps): add (and bump) cross deps versions to .requireme… #13345

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .requirements
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
25 changes: 25 additions & 0 deletions build/cross_deps/README.md
Original file line number Diff line number Diff line change
@@ -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.
10 changes: 4 additions & 6 deletions build/cross_deps/libxcrypt/repositories.bzl
Original file line number Diff line number Diff line change
@@ -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",
)
10 changes: 4 additions & 6 deletions build/cross_deps/libyaml/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
12 changes: 5 additions & 7 deletions build/cross_deps/zlib/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
3 changes: 0 additions & 3 deletions changelog/unreleased/kong/bump-libxcrypt.yml

This file was deleted.

3 changes: 0 additions & 3 deletions changelog/unreleased/kong/bump-zlib.yml

This file was deleted.

Loading