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 950bfc3 commit f177a84
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
18 changes: 7 additions & 11 deletions build/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@kong_bindings//:variables.bzl", "KONG_VAR")
load("@bazel_skylib//lib:selects.bzl", "selects")
load("//build:build_system.bzl", "get_workspace_name", "kong_genrule", "kong_install", "kong_rules_group", "kong_template_file")
load("//build:build_system.bzl", "get_clib_deps", "get_workspace_name", "kong_genrule", "kong_install", "kong_rules_group", "kong_template_file")
load("@kong//build/openresty/wasmx/filters:variables.bzl", "WASM_FILTERS_TARGETS")

exports_files([
Expand All @@ -9,28 +9,24 @@ exports_files([

# C libraries

clib_deps = [
"@openssl",
"@libexpat",
"@snappy",
"@ada",
]

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

kong_rules_group(
name = "install-clibs",
propagates = [
":install-%s" % get_workspace_name(k)
for k in clib_deps
for k in get_clib_deps()
],
visibility = ["//visibility:public"],
)
Expand Down
10 changes: 10 additions & 0 deletions build/build_system.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -355,3 +355,13 @@ kong_install = rule(

def get_workspace_name(label):
return label.replace("@", "").split("/")[0]

def get_clib_deps(ada_flag):
base_deps = [
"@openssl",
"@libexpat",
"@snappy",
]
if ada_flag:
base_deps.append("@ada")
return base_deps

0 comments on commit f177a84

Please sign in to comment.