1678884263.252827959: src/main/tools/linux-sandbox-pid1.cc:491: calling fork...
1678884263.253153282: src/main/tools/linux-sandbox-pid1.cc:521: child started with PID 2
+ nice cc -m64 -O2 -g -shared -fPIC -Wl,-soname,libonload_ext.so.1 onload_ext.o -o libonload_ext.so.1.2.0
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
+ nice cc -m64 -O2 -g -lrt -shared -fPIC -Wl,-soname,libciul.so.1 ci_ul_pt_tx.o ci_ul_pt_rx.o ci_ul_vi_init.o ci_ul_ef10_event.o ci_ul_ef10_vi.o ci_ul_ef100_event.o ci_ul_ef100_vi.o ci_ul_efxdp_vi.o ci_ul_efct_vi.o ci_ul_ef10_evtimer.o ci_ul_logging.o ci_ul_checksum.o ci_ul_open.o ci_ul_event_q.o ci_ul_event_q_put.o ci_ul_pt_endpoint.o ci_ul_filter.o ci_ul_vi_set.o ci_ul_memreg.o ci_ul_pd.o ci_ul_ef_app_cluster.o ci_ul_pio.o ci_ul_vi_layout.o ci_ul_vi_stats.o ci_ul_vi_prime.o ci_ul_capabilities.o ci_ul_smartnic_exts.o ci_ul_ctpio.o -o libciul.so.1.1.1
+ nice cc -m64 -O2 -g -nostartfiles -shared -fPIC ci_tp_unix_startup.o ci_tp_unix_log_fn.o ci_tp_unix_sys.o ci_tp_unix_sockcall_intercept.o ci_tp_unix_onload_ext_intercept.o ci_tp_unix_zc_intercept.o ci_tp_unix_zc_hlrx.o ci_tp_unix_tmpl_intercept.o ci_tp_unix_stackname.o ci_tp_unix_stackopt.o ci_tp_unix_fdtable.o ci_tp_unix_protocol_manager.o ci_tp_unix_closed_fd.o ci_tp_unix_tcp_fd.o ci_tp_unix_udp_fd.o ci_tp_unix_pipe_fd.o ci_tp_unix_nonsock.o ci_tp_unix_epoll_fd.o ci_tp_unix_epoll_fd_b.o ci_tp_unix_netif_init.o ci_tp_unix_exec.o ci_tp_unix_environ.o ci_tp_unix_common_fcntl.o ci_tp_unix_wqlock.o ci_tp_unix_poll_select.o ci_tp_unix_passthrough_fd.o ci_tp_unix_utils.o ci_tp_unix_vfork_intercept.o ./../../../lib/transport/common/libcitpcommon0.a ./../../../lib/transport/ip/libciip0.a ./../../../lib/cplane/libcplane0.a ./../../../lib/citools/libcitools1.a ./../../../lib/ciul/libciul1.a -e onload_version_msg -Wl,--version-script=/home/witek/.cache/bazel/_bazel_witek/52ee13dadb77498b9e4fc952a2e4201b/sandbox/linux-sandbox/226/execroot/__main__/external/myonload/src/lib/transport/unix/exports.map -lm -lpthread -lrt -ldl -lanl -o libcitransport0.so
/home/witek/.cache/bazel/_bazel_witek/52ee13dadb77498b9e4fc952a2e4201b/sandbox/linux-sandbox/226/execroot/__main__/external/myonload/src/tools/cplane/server.c:13:10: fatal error: sys/capability.h: No such file or directory
13 | #include <sys/capability.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [/home/witek/.cache/bazel/_bazel_witek/52ee13dadb77498b9e4fc952a2e4201b/sandbox/linux-sandbox/226/execroot/__main__/external/myonload/mk/after.mk:151: server.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/home/witek/.cache/bazel/_bazel_witek/52ee13dadb77498b9e4fc952a2e4201b/sandbox/linux-sandbox/226/execroot/__main__/external/myonload/src/tools/mmake.mk:20: all] Error 2
make: *** [/home/witek/.cache/bazel/_bazel_witek/52ee13dadb77498b9e4fc952a2e4201b/sandbox/linux-sandbox/226/execroot/__main__/external/myonload/src/mmake.mk:25: all] Error 2
onload_build: ERROR: Failed to build 64-bit user-level components.
...
(some other components do compile, but cplane server does not).
Considering that I do not actually need to build tools to compile my project, instead of fixing it, my preference would be to not build tools, only libraries that I need to link against. I have a separate build to build tools and install them system-wide, but the my binaries that require onload, do not need to rebuild these tools. So skipping build of tools (and tests) would help improve build times.
It is possible to pass CC_FLAGS and pass it to the build, still it is rather complicated, so just not building tools and tests is a better option.
I am trying to convert from cmake base build system to bazel.
I was building previously onload as a root and installing it system wide, either on a host or in a docker.
As part of bazel build, I wish to make the build hermetic and isolated. (not use libraries and toolchain from the host).
Already converted all dependencies, with onload / ef_vi being the last one to tackle.
First I added
libcap2
to bazel, as it is a dependency of cplane (unless compiled with NO_CAPS define).Still, I have issue with that.
Here is my setup
WORKSPACE
:extra/libcap/BUILD
:extra/onload/BUILD
:m/BUILD
m/example.cc
Building libcap works:
as does binaries using them:
But onload not:
(some other components do compile, but cplane server does not).
Considering that I do not actually need to build tools to compile my project, instead of fixing it, my preference would be to not build tools, only libraries that I need to link against. I have a separate build to build tools and install them system-wide, but the my binaries that require onload, do not need to rebuild these tools. So skipping build of tools (and tests) would help improve build times.
It is possible to pass CC_FLAGS and pass it to the build, still it is rather complicated, so just not building tools and tests is a better option.