Skip to content

Commit affc009

Browse files
committed
new(ci): use zig compiler instead of relying on centos7.
Signed-off-by: Federico Di Pierro <[email protected]>
1 parent 262aa9a commit affc009

File tree

4 files changed

+12
-42
lines changed

4 files changed

+12
-42
lines changed

.github/workflows/reusable_build_packages.yaml

+5-36
Original file line numberDiff line numberDiff line change
@@ -52,59 +52,30 @@ jobs:
5252
retention-days: 1
5353

5454
build-packages:
55-
env:
56-
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
5755
# See https://github.com/actions/runner/issues/409#issuecomment-1158849936
5856
runs-on: ${{ (inputs.arch == 'aarch64' && 'actuated-arm64-8cpu-16gb') || 'ubuntu-latest' }}
5957
needs: [build-modern-bpf-skeleton]
60-
container: centos:7
6158
steps:
6259
# Always install deps before invoking checkout action, to properly perform a full clone.
63-
- name: Fix mirrors to use vault.centos.org
64-
run: |
65-
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
66-
sed -i s/^#.*baseurl=http/baseurl=https/g /etc/yum.repos.d/*.repo
67-
sed -i s/^mirrorlist=http/#mirrorlist=https/g /etc/yum.repos.d/*.repo
68-
69-
- name: Install scl repos
70-
run: |
71-
yum -y install centos-release-scl
72-
73-
- name: Fix new mirrors to use vault.centos.org
74-
run: |
75-
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
76-
sed -i s/^#.*baseurl=http/baseurl=https/g /etc/yum.repos.d/*.repo
77-
sed -i s/^mirrorlist=http/#mirrorlist=https/g /etc/yum.repos.d/*.repo
78-
79-
- name: Fix arm64 scl repos to use correct mirror
80-
if: inputs.arch == 'aarch64'
81-
run: |
82-
sed -i 's/vault.centos.org\/centos/vault.centos.org\/altarch/g' /etc/yum.repos.d/CentOS-SCLo-scl*.repo
83-
8460
- name: Install build deps
8561
run: |
86-
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++
87-
source /opt/rh/devtoolset-9/enable
88-
yum install -y wget git make m4 rpm-build elfutils-libelf-devel perl-IPC-Cmd devtoolset-9-libasan-devel devtoolset-9-libubsan-devel
62+
sudo apt update && sudo apt install -y --no-install-recommends ca-certificates cmake curl wget build-essential git pkg-config autoconf automake libtool libelf-dev m4 rpm
8963
9064
- name: Checkout
91-
# It is not possible to upgrade the checkout action to versions >= v4.0.0 because of incompatibilities with centos 7's libc.
92-
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
65+
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
9366

9467
- name: Download skeleton
9568
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
9669
with:
9770
name: bpf_probe_${{ inputs.arch }}.skel.h
9871
path: /tmp
9972

100-
- name: Install updated cmake
101-
run: |
102-
curl -L https://github.com/Kitware/CMake/releases/download/v3.22.5/cmake-3.22.5-linux-$(uname -m).tar.gz \
103-
| tar --directory=/usr --strip-components=1 -xzp
73+
- name: Install zig
74+
if: inputs.sanitizers == false
75+
uses: falcosecurity/libs/.github/actions/install-zig@master
10476

10577
- name: Prepare project
10678
run: |
107-
source /opt/rh/devtoolset-9/enable
10879
cmake -B build -S . \
10980
-DCMAKE_BUILD_TYPE=${{ inputs.build_type }} \
11081
-DUSE_BUNDLED_DEPS=On \
@@ -117,12 +88,10 @@ jobs:
11788
11889
- name: Build project
11990
run: |
120-
source /opt/rh/devtoolset-9/enable
12191
cmake --build build --target falco -j6
12292
12393
- name: Build packages
12494
run: |
125-
source /opt/rh/devtoolset-9/enable
12695
cmake --build build --target package
12796
12897
- name: Upload Falco tar.gz package

cmake/modules/driver.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ else()
3535
# FALCOSECURITY_LIBS_VERSION. In case you want to test against another driver version (or
3636
# branch, or commit) just pass the variable - ie., `cmake -DDRIVER_VERSION=dev ..`
3737
if(NOT DRIVER_VERSION)
38-
set(DRIVER_VERSION "7.3.0+driver")
38+
set(DRIVER_VERSION "8baec4b102662200b3a382722f01276748125e0f")
3939
set(DRIVER_CHECKSUM
40-
"SHA256=8f572d9a83feda635a3fa53b859d61e37af127c241e35068aadee3bc50d212c0"
40+
"SHA256=e2750d337f7e28780bd7b4d2efa6ea7a99f43aed2815fd0f7529bfac1a10f429"
4141
)
4242
endif()
4343

cmake/modules/falcosecurity-libs.cmake

+2-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ else()
4242
# version (or branch, or commit) just pass the variable - ie., `cmake
4343
# -DFALCOSECURITY_LIBS_VERSION=dev ..`
4444
if(NOT FALCOSECURITY_LIBS_VERSION)
45-
set(FALCOSECURITY_LIBS_VERSION "0.18.1")
45+
set(FALCOSECURITY_LIBS_VERSION "8baec4b102662200b3a382722f01276748125e0f")
4646
set(FALCOSECURITY_LIBS_CHECKSUM
47-
"SHA256=1812e8236c4cb51d3fe5dd066d71be99f25da7ed22d8feeeebeed09bdc26325f"
47+
"SHA256=e2750d337f7e28780bd7b4d2efa6ea7a99f43aed2815fd0f7529bfac1a10f429"
4848
)
4949
endif()
5050

@@ -73,7 +73,6 @@ set(LIBS_PACKAGE_NAME "falcosecurity")
7373

7474
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
7575
add_definitions(-D_GNU_SOURCE)
76-
add_definitions(-DHAS_CAPTURE)
7776
endif()
7877

7978
if(MUSL_OPTIMIZED_BUILD)

userspace/falco/stats_writer.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,9 @@ void stats_writer::collector::get_metrics_output_fields_wrapper(
360360
output_fields["evt.hostname"] =
361361
machine_info->hostname; /* Explicitly add hostname to log msg in case hostname rule
362362
output field is disabled. */
363-
output_fields["falco.host_boot_ts"] = machine_info->boot_ts_epoch;
363+
// This line generates a SIGTRAP in zig debug builds if the casting is removed.
364+
// It seems caused by the pragma pack for the scap_machine_info structure.
365+
output_fields["falco.host_boot_ts"] = (uint64_t)machine_info->boot_ts_epoch;
364366
output_fields["falco.host_num_cpus"] = machine_info->num_cpus;
365367
}
366368
output_fields["falco.outputs_queue_num_drops"] =

0 commit comments

Comments
 (0)