Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Water-Melon committed Sep 6, 2024
1 parent 705ad58 commit a0cb3f1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 63 deletions.
53 changes: 0 additions & 53 deletions .github/matrix-commitly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,13 @@ build-packages:
# package-type: the nfpm packaging target, //:kong_{package} target; only used when package is rpm
# bazel-args: additional bazel build flags
# check-manifest-suite: the check manifest suite as defined in scripts/explain_manifest/config.py

# Ubuntu
- label: ubuntu-20.04
image: ubuntu:20.04
package: deb
check-manifest-suite: ubuntu-20.04-amd64
- label: ubuntu-22.04
image: ubuntu:22.04
package: deb
check-manifest-suite: ubuntu-22.04-amd64
- label: ubuntu-22.04-arm64
image: ubuntu:22.04
package: deb
bazel-args: --platforms=//:generic-crossbuild-aarch64
check-manifest-suite: ubuntu-22.04-arm64

# Debian
- label: debian-11
image: debian:11
package: deb
check-manifest-suite: debian-11-amd64
- label: debian-12
image: debian:12
package: deb
check-manifest-suite: debian-12-amd64

# RHEL
- label: rhel-8
image: rockylinux:8
package: rpm
package-type: el8
check-manifest-suite: el8-amd64
- label: rhel-9
image: rockylinux:9
package: rpm
package-type: el9
check-manifest-suite: el9-amd64
- label: rhel-9-arm64
package: rpm
package-type: el9
bazel-args: --platforms=//:rhel9-crossbuild-aarch64 --//:brotli=False
check-manifest-suite: el9-arm64

# Amazon Linux
- label: amazonlinux-2
package: rpm
package-type: aws2
check-manifest-suite: amazonlinux-2-amd64
# ada and simdjson don't compile on gcc7.3.1 (needs 7.4)
bazel-args: --platforms=//:aws2-crossbuild-x86_64 --//:simdjson=False --//:ada=False
- label: amazonlinux-2023
image: amazonlinux:2023
package: rpm
package-type: aws2023
check-manifest-suite: amazonlinux-2023-amd64
- label: amazonlinux-2023-arm64
package: rpm
package-type: aws2023
bazel-args: --platforms=//:aws2023-crossbuild-aarch64 --//:brotli=False
check-manifest-suite: amazonlinux-2023-arm64

build-images:
# Only build images for the latest version of each major release.
Expand Down
19 changes: 11 additions & 8 deletions build/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,30 @@ exports_files([

# C libraries

get_clib_deps(
name = "deps_list",
ada_flag = select({
":ada_flag": True,
"//conditions:default": False,
}),
output_file = "deps.txt",
)

[
kong_install(
name = "install-%s" % get_workspace_name(k),
src = k,
prefix = "kong/lib" if k in ("@passwdqc", "@snappy", "@ada") else "kong",
strip_path = "snappy" if k == "@snappy" else "ada" if k == "@ada" else "",
)
for k in get_clib_deps(select({
"@kong//:ada_flag": True,
"//conditions:default": False,
}))
for k in ctx.file("deps.txt").read().splitlines()
]

kong_rules_group(
name = "install-clibs",
propagates = [
":install-%s" % get_workspace_name(k)
for k in get_clib_deps(select({
"@kong//:ada_flag": True,
"//conditions:default": False,
}))
for k in ctx.file("deps.txt").read().splitlines()
],
visibility = ["//visibility:public"],
)
Expand Down
15 changes: 13 additions & 2 deletions build/build_system.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,23 @@ kong_install = rule(
def get_workspace_name(label):
return label.replace("@", "").split("/")[0]

def get_clib_deps(ada_flag):
def _get_clib_deps_impl(ctx):
ada_flag = ctx.attr.ada_flag
base_deps = [
"@openssl",
"@libexpat",
"@snappy",
]
if ada_flag:
print("!!!!!!!!!!!!! " + str(ada_flag))
base_deps.append("@ada")
return base_deps

ctx.attr.output_file.write('\n'.join(base_deps))

get_clib_deps = rule(
implementation = _get_clib_deps_impl,
attrs = {
"ada_flag": attr.bool(),
"output_file": attr.output(),
},
)

0 comments on commit a0cb3f1

Please sign in to comment.