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
dlb: upgrade to 8.8 #33834
base: main
Are you sure you want to change the base?
dlb: upgrade to 8.8 #33834
Conversation
CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to |
1ef6a25
to
fed50c0
Compare
Now the latest layout is like:
I want to run I can not use I also tried to copy this header file into libdlb dir, but failed to find a way to do it. @phlax is there a way to do it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/wait
@phlax @adisuissa sorry that I add some local changes here :( |
Signed-off-by: Loong <loong.dai@intel.com>
I try to move files into one dir by Bazel and fail, so I just move the file by patch. |
@@ -16,7 +16,6 @@ envoy_contrib_package() | |||
make( | |||
name = "dlb", | |||
env = {"DLB_DISABLE_DOMAIN_SERVER": "TRUE"}, | |||
includes = [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than patching the whole file in could you do as i suggested offline, add a filegroup for the includes directory, and then add it here - ie @intel_dlb//:libdlb_includes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I tried it but fail:
--- a/bazel/repositories.bzl
+++ b/bazel/repositories.bzl
@@ -1370,6 +1370,12 @@ def _intel_dlb():
external_http_archive(
name = "intel_dlb",
build_file_content = """
+filegroup(
+ name = "libdlb_header",
+ srcs = glob(["**/dlb2_user.h"]),
+ visibility = ["@envoy//contrib/dlb/source:__pkg__"],
+)
+
filegroup(
name = "libdlb",
srcs = glob(["dlb/libdlb/*"]),
diff --git a/contrib/dlb/source/BUILD b/contrib/dlb/source/BUILD
index 46c28a3dad..98c12bf526 100644
--- a/contrib/dlb/source/BUILD
+++ b/contrib/dlb/source/BUILD
@@ -16,6 +16,7 @@ envoy_contrib_package()
make(
name = "dlb",
env = {"DLB_DISABLE_DOMAIN_SERVER": "TRUE"},
+ includes = ["@intel_dlb//:libdlb_header"],
lib_source = "@intel_dlb//:libdlb",
out_static_libs = ["libdlb.a"],
postfix_script = "mv libdlb.a $INSTALLDIR/lib && rm -rf $INSTALLDIR/include && mkdir -p $INSTALLDIR/include && cp -L *.h $INSTALLDIR/include",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error is still not found:
+ /build/.cache/bazel/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/sandbox/processwrapper-sandbox/1/execroot/envoy/bazel-out/k8-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains/make/bin/make libdlb.a PREFIX=/build/.cache/bazel/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/sandbox/processwrapper-sandbox/1/execroot/envoy/bazel-out/k8-fastbuild/bin/contrib/dlb/source/dlb
Compiling build/dlb.o
In file included from dlb.c:25:
dlb_priv.h:15:10: fatal error: dlb2_user.h: No such file or directory
15 | #include "dlb2_user.h"
| ^~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:60: build/dlb.o] Error 1
_____ END BUILD LOGS _____
rules_foreign_cc: Build wrapper script location: bazel-out/k8-fastbuild/bin/contrib/dlb/source/dlb_foreign_cc/wrapper_build_script.sh
rules_foreign_cc: Build script location: bazel-out/k8-fastbuild/bin/contrib/dlb/source/dlb_foreign_cc/build_script.sh
rules_foreign_cc: Build log location: bazel-out/k8-fastbuild/bin/contrib/dlb/source/dlb_foreign_cc/Make.log
Target //contrib/dlb/source:dlb failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.843s, Critical Path: 0.19s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess filegroup
keep the dir layout so that Make cannot find it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably so - wondering what layout is expected
see here for how to mangle file paths in a filegroup https://groups.google.com/g/bazel-discuss/c/x0nyiuQ5Q44/m/r7rGSQTFHAAJ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would raise some error:
ERROR: /build/.cache/bazel/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/intel_dlb/BUILD.bazel:18:9: unclosed string literal
ERROR: /build/.cache/bazel/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/intel_dlb/BUILD.bazel:19:1: unclosed string literal
ERROR: /build/.cache/bazel/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/intel_dlb/BUILD.bazel:19:1: Implicit string concatenation is forbidden, use the + operator
The generated:
genrule(
name = 'copy_the_files',
srcs = files,
outs = [f.replace('the_directory', 'another_place/folder') for f in files],
cmd = '
'.join(["mkdir -p $$(dirname $(location %s)) && cp $(location %s) $(location :%s)" % (f, f, f.replace("the_directory", "another_place/folder")) for f in files]),
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I simplify the copy:
filegroup(
name = "header",
srcs = glob(["**/dlb2_user.h"]),
visibility = ["@envoy//contrib/dlb/source:__pkg__"],
)
genrule(
name = "copy",
srcs = [":header"],
outs = ["dlb/libdlb"],
cmd = "set -x;cp -a $(SRCS) $(OUTS)",
)
But it turns out:
cp -a external/intel_dlb/dlb/driver/dlb2/uapi/linux/dlb2_user.h bazel-out/k8-fastbuild/bin/external/intel_dlb/dlb/libdlb
@phlax as I show it in the slack, the original layout is like:
dlb
├── driver
│ └── dlb2
│ ├── user.h
└── libdlb
what I want is like:
dlb
└── libdlb
└── user.h
The genrule
cannot operate the "external" dir since it is remote for genrule
.
Commit Message: Upgrade libdlb to 8.8
Additional Description:
Risk Level: Low
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]