Skip to content

Commit

Permalink
doc(build): add readme for cross deps
Browse files Browse the repository at this point in the history
  • Loading branch information
fffonion authored and ADD-SP committed Jul 12, 2024
1 parent 6aaee6f commit f908184
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
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.
1 change: 1 addition & 0 deletions build/cross_deps/libxcrypt/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def libxcrypt_repositories():
# 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/v4.4.27/libxcrypt-4.4.27.tar.xz",
Expand Down
1 change: 1 addition & 0 deletions build/cross_deps/libyaml/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def libyaml_repositories():
"""Defines the libyaml repository"""

# 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-0.2.5.tar.gz",
Expand Down
1 change: 1 addition & 0 deletions build/cross_deps/zlib/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def zlib_repositories():
"""Defines the zlib repository"""

# NOTE: do not bump the following version, see build/cross_deps/README.md for detail.
http_archive(
name = "cross_deps_zlib",
urls = [
Expand Down

1 comment on commit f908184

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:f908184e11a23ac452a6d4aab361dcac520ac2a1
Artifacts available https://github.com/Kong/kong/actions/runs/9903796066

Please sign in to comment.