Skip to content

Commit

Permalink
chore(ci,cmake): bump libs to HEAD of chore/zig_build branch.
Browse files Browse the repository at this point in the history
Improve CI workflow by adding wrapper scripts zig-cc and zig-c++ to be used
as environment vars `CC` and `CXX`, since cmake var `CMAKE_{C,CXX}_COMPILER`
does truncate those variables to their first part (ie: before the first whitespace),
otherwise leading to issues, since only `zig` would be used as compiler by cmake.

Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP committed Aug 29, 2024
1 parent c410963 commit 70e175a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/reusable_build_packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
build-packages:
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
ZIG_VERSION: '0.13.0'
# See https://github.com/actions/runner/issues/409#issuecomment-1158849936
runs-on: ${{ (inputs.arch == 'aarch64' && 'actuated-arm64-8cpu-16gb') || 'ubuntu-latest' }}
needs: [build-modern-bpf-skeleton]
Expand All @@ -62,13 +63,26 @@ jobs:
- name: Install zig
run: |
curl -L -o zig.tar.gz https://ziglang.org/download/0.13.0/zig-linux-$(uname -m)-0.13.0.tar.xz
curl -L -o zig.tar.gz https://ziglang.org/download/0.13.0/zig-linux-${{ inputs.arch }}-${ZIG_VERSION}.tar.xz
tar -xvf zig.tar.gz
cat > zig-linux-${{ inputs.arch }}-${ZIG_VERSION}/zig-cc << EOF
#!/bin/bash
zig cc -target ${{ inputs.arch }}-linux-gnu.2.17 "$@"
EOF
chmod +x zig-linux-${{ inputs.arch }}-${ZIG_VERSION}/zig-cc
cat > zig-linux-${{ inputs.arch }}-${ZIG_VERSION}/zig-c++ << EOF
#!/bin/bash
zig c++ -target ${{ inputs.arch }}-linux-gnu.2.17 "$@"
EOF
chmod +x zig-linux-${{ inputs.arch }}-${ZIG_VERSION}/zig-c++
sudo mkdir -p /usr/local/zig/
sudo cp -R zig-linux-$(uname -m)-0.13.0/* /usr/local/zig/
sudo cp -R zig-linux-${{ inputs.arch }}-${ZIG_VERSION}/* /usr/local/zig/
echo "/usr/local/zig" >> $GITHUB_PATH
echo "CC=zig cc -target $(uname -m)-linux-gnu.2.17" >> $GITHUB_ENV
echo "CXX=zig c++ -target $(uname -m)-linux-gnu.2.17" >> $GITHUB_ENV
echo "CC=zig-cc" >> $GITHUB_ENV
echo "CXX=zig-c++" >> $GITHUB_ENV
echo "AR=zig ar" >> $GITHUB_ENV
echo "RANLIB=zig ranlib" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/falcosecurity-libs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ else()
# In case you want to test against another falcosecurity/libs version (or branch, or commit) just pass the variable -
# ie., `cmake -DFALCOSECURITY_LIBS_VERSION=dev ..`
if(NOT FALCOSECURITY_LIBS_VERSION)
set(FALCOSECURITY_LIBS_VERSION "d8865276b5cac665f318d1a52be945f556d87a41")
set(FALCOSECURITY_LIBS_VERSION "eacdaa9915aa5451ce157247b8cb49f706296d49")
#set(FALCOSECURITY_LIBS_CHECKSUM "SHA256=aedc4120d335ee2ebf7f3c2e6346fc985ca09a49d14ff7c6249a033e47d160bf")
endif()

Expand Down

0 comments on commit 70e175a

Please sign in to comment.