kernel-patches / vmtest

3 stars 32 forks source link

ci: Change selftest cross compile patch #265

Closed chantra closed 9 months ago

chantra commented 9 months ago

The original patch caused a race condition where 2 rules tried to write to the same files (host-tools and (target) tools directory) causing errors similar to the ones below.

Instead of changing what the scratch dir is, this new patch sets BPFTOOL to default to TRUNNER_BPFTOOL instead of DEFAUlT_BPFTOOL.

2024-02-14T19:49:54.6430105Z   MKDIR
2024-02-14T19:49:54.6547753Z   GEN     /tmp/work/bpf/bpf/tools/testing/selftests/bpf/bpf-helpers.rst
2024-02-14T19:49:54.6552447Z   GEN     /tmp/work/bpf/bpf/tools/testing/selftests/bpf/bpf-syscall.rst
2024-02-14T19:49:54.6698129Z   GEN     /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/host/libbpf/bpf_helper_defs.h
2024-02-14T19:49:54.6699474Z   GEN     /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/libbpf/bpf_helper_defs.h
2024-02-14T19:49:54.6700946Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/bpf.h
2024-02-14T19:49:54.6702035Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf.h
2024-02-14T19:49:54.6703060Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/libbpf.h
2024-02-14T19:49:54.6705068Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf.h
2024-02-14T19:49:54.6706136Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/btf.h
2024-02-14T19:49:54.6707103Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/btf.h
2024-02-14T19:49:54.6708613Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/libbpf_common.h
2024-02-14T19:49:54.6709705Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/libbpf_legacy.h
2024-02-14T19:49:54.6710767Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf_common.h
2024-02-14T19:49:54.6711833Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf_legacy.h
2024-02-14T19:49:54.6712886Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/bpf_helpers.h
2024-02-14T19:49:54.6713934Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/bpf_tracing.h
2024-02-14T19:49:54.6715873Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h
2024-02-14T19:49:54.6717899Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/bpf_endian.h
2024-02-14T19:49:54.6719951Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_tracing.h
2024-02-14T19:49:54.6722146Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/bpf_core_read.h
2024-02-14T19:49:54.6724480Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/skel_internal.h
2024-02-14T19:49:54.6726350Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_endian.h
2024-02-14T19:49:54.6728299Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/libbpf_version.h
2024-02-14T19:49:54.6730306Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/usdt.bpf.h
2024-02-14T19:49:54.6732346Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_core_read.h
2024-02-14T19:49:54.6733964Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/skel_internal.h
2024-02-14T19:49:54.6735555Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf_version.h
2024-02-14T19:49:54.6746662Z install: cannot change permissions of '/tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf.h': No such file or directory
2024-02-14T19:49:54.6749334Z make[1]: *** [Makefile:250: /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf.h] Error 1
2024-02-14T19:49:54.6750682Z make[1]: *** Deleting file '/tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf.h'
2024-02-14T19:49:54.6751477Z make[1]: *** Waiting for unfinished jobs....
2024-02-14T19:49:54.6752760Z install: cannot create regular file '/tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf_common.h': File exists
2024-02-14T19:49:54.6754094Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/usdt.bpf.h
2024-02-14T19:49:54.6755332Z make[1]: *** [Makefile:250: /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf_common.h] Error 1
2024-02-14T19:49:54.6756783Z make[1]: *** Deleting file '/tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf_common.h'
2024-02-14T19:49:54.6823593Z   HOSTCC  /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/host/libbpf/fixdep.o
2024-02-14T19:49:54.6824781Z   HOSTCC  /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/libbpf/fixdep.o
chantra commented 9 months ago

Before (when successful):

2024-02-14T20:18:36.5014403Z   MKDIR    
2024-02-14T20:18:36.5125442Z   GEN     /tmp/work/bpf/bpf/tools/testing/selftests/bpf/bpf-helpers.rst
2024-02-14T20:18:36.5126313Z   GEN     /tmp/work/bpf/bpf/tools/testing/selftests/bpf/bpf-syscall.rst
2024-02-14T20:18:36.5272146Z   GEN     /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/libbpf/bpf_helper_defs.h
2024-02-14T20:18:36.5273274Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf.h
2024-02-14T20:18:36.5274241Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf.h
2024-02-14T20:18:36.5276494Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/btf.h
2024-02-14T20:18:36.5277587Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf_common.h
2024-02-14T20:18:36.5280971Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf_legacy.h
2024-02-14T20:18:36.5282307Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h
2024-02-14T20:18:36.5286481Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_tracing.h
2024-02-14T20:18:36.5287670Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_endian.h
2024-02-14T20:18:36.5288717Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_core_read.h
2024-02-14T20:18:36.5289979Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/skel_internal.h
2024-02-14T20:18:36.5293835Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf_version.h
2024-02-14T20:18:36.5295213Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/usdt.bpf.h
2024-02-14T20:18:36.5301913Z   GEN     /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/host/libbpf/bpf_helper_defs.h
2024-02-14T20:18:36.5304659Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/bpf.h
2024-02-14T20:18:36.5305769Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/libbpf.h
2024-02-14T20:18:36.5307378Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/btf.h
2024-02-14T20:18:36.5310291Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/libbpf_common.h
2024-02-14T20:18:36.5312210Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/libbpf_legacy.h
2024-02-14T20:18:36.5314052Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/bpf_helpers.h
2024-02-14T20:18:36.5317107Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/bpf_tracing.h
2024-02-14T20:18:36.5318622Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/usdt.bpf.h
2024-02-14T20:18:36.5372331Z   HOSTCC  /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/libbpf/fixdep.o
2024-02-14T20:18:36.5403349Z   HOSTCC  /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/host/libbpf/fixdep.o
2024-02-14T20:18:36.5525930Z   BINARY   urandom_read
2024-02-14T20:18:36.5614515Z   GEN     /tmp/work/bpf/bpf/tools/testing/selftests/bpf/bpf-syscall.2
2024-02-14T20:18:36.5694761Z   HOSTLD  /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/libbpf/fixdep-in.o
2024-02-14T20:18:36.5720514Z   HOSTLD  /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/host/libbpf/fixdep-in.o
2024-02-14T20:18:36.5725784Z   LINK    /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/libbpf/fixdep
2024-02-14T20:18:36.5752634Z   LINK    /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/host/libbpf/fixdep
2024-02-14T20:18:36.5818053Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_helper_defs.h
2024-02-14T20:18:36.5839965Z   INSTALL libbpf_headers
2024-02-14T20:18:36.5841276Z   INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools//include/bpf/bpf_helper_defs.h
2024-02-14T20:18:36.5862004Z   INSTALL libbpf_headers
2024-02-14T20:18:36.6140528Z   GEN     /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/libbpf/libbpf.pc
2024-02-14T20:18:36.6155052Z   MKDIR   /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/libbpf/staticobjs/
2024-02-14T20:18:36.6158902Z   GEN     /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/host/libbpf/libbpf.pc
2024-02-14T20:18:36.6159946Z   MKDIR   /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/build/libbpf/staticobjs/

After:

2024-02-14T21:07:36.5207897Z   BINARY   uprobe_multi
2024-02-14T21:07:36.5215805Z   MKDIR    no_alu32
2024-02-14T21:07:36.5350050Z   MKDIR    bpftool
2024-02-14T21:07:36.5350453Z   MKDIR    
2024-02-14T21:07:36.5467533Z   GEN     /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/bpf-helpers.rst
2024-02-14T21:07:36.5468900Z   GEN     /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/bpf-syscall.rst
2024-02-14T21:07:36.5614839Z   GEN     /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/build/libbpf/bpf_helper_defs.h
2024-02-14T21:07:36.5616030Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/include/bpf/bpf.h
2024-02-14T21:07:36.5617068Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/include/bpf/libbpf.h
2024-02-14T21:07:36.5619405Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/include/bpf/btf.h
2024-02-14T21:07:36.5620506Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/include/bpf/libbpf_common.h
2024-02-14T21:07:36.5624819Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/include/bpf/libbpf_legacy.h
2024-02-14T21:07:36.5626338Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h
2024-02-14T21:07:36.5627507Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/include/bpf/bpf_tracing.h
2024-02-14T21:07:36.5628630Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/include/bpf/bpf_endian.h
2024-02-14T21:07:36.5632585Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/include/bpf/bpf_core_read.h
2024-02-14T21:07:36.5634961Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/include/bpf/skel_internal.h
2024-02-14T21:07:36.5636453Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/include/bpf/libbpf_version.h
2024-02-14T21:07:36.5637721Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/include/bpf/usdt.bpf.h
2024-02-14T21:07:36.5659951Z   GEN     /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/build/host/libbpf/bpf_helper_defs.h
2024-02-14T21:07:36.5663092Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/host-tools//include/bpf/bpf.h
2024-02-14T21:07:36.5665139Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/host-tools//include/bpf/libbpf.h
2024-02-14T21:07:36.5668318Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/host-tools//include/bpf/btf.h
2024-02-14T21:07:36.5669612Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/host-tools//include/bpf/libbpf_common.h
2024-02-14T21:07:36.5671887Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/host-tools//include/bpf/libbpf_legacy.h
2024-02-14T21:07:36.5673189Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/host-tools//include/bpf/bpf_helpers.h
2024-02-14T21:07:36.5674915Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/host-tools//include/bpf/bpf_tracing.h
2024-02-14T21:07:36.5676831Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/host-tools//include/bpf/bpf_endian.h
2024-02-14T21:07:36.5678802Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/host-tools//include/bpf/bpf_core_read.h
2024-02-14T21:07:36.5682829Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/host-tools//include/bpf/skel_internal.h
2024-02-14T21:07:36.5684367Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/host-tools//include/bpf/libbpf_version.h
2024-02-14T21:07:36.5686524Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/host-tools//include/bpf/usdt.bpf.h
2024-02-14T21:07:36.5710667Z   HOSTCC  /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/build/libbpf/fixdep.o
2024-02-14T21:07:36.5746689Z   BINARY   urandom_read
2024-02-14T21:07:36.5765142Z   HOSTCC  /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/build/host/libbpf/fixdep.o
2024-02-14T21:07:36.5962185Z   GEN     /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/bpf-syscall.2
2024-02-14T21:07:36.6041395Z   HOSTLD  /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/build/libbpf/fixdep-in.o
2024-02-14T21:07:36.6069324Z   LINK    /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/build/libbpf/fixdep
2024-02-14T21:07:36.6087013Z   HOSTLD  /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/build/host/libbpf/fixdep-in.o
2024-02-14T21:07:36.6116960Z   LINK    /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/build/host/libbpf/fixdep
2024-02-14T21:07:36.6154131Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/include/bpf/bpf_helper_defs.h
2024-02-14T21:07:36.6173147Z   INSTALL libbpf_headers
2024-02-14T21:07:36.6187597Z   INSTALL /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/host-tools//include/bpf/bpf_helper_defs.h
2024-02-14T21:07:36.6206908Z   INSTALL libbpf_headers
2024-02-14T21:07:36.6207680Z   GEN     /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/bpf-helpers.7
2024-02-14T21:07:36.6468762Z   GEN     /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/build/libbpf/libbpf.pc
2024-02-14T21:07:36.6481834Z   MKDIR   /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/build/libbpf/staticobjs/
2024-02-14T21:07:36.6485181Z   MKDIR   /tmp/work/vmtest/vmtest/tools/testing/selftests/bpf/tools/build/libbpf/staticobjs/