Skip to content
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

ci: Update build.yaml to include Ubuntu 24.04 #179

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
os: [ubuntu-22.04, ubuntu-24.04]
runs-on: ${{ matrix.os }}
env:
FEATURES: .llvm and .skeletons
Expand All @@ -32,17 +32,13 @@ jobs:
with:
submodules: true

- name: Use clang-12 and not clang-11 for older Ubuntu
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get remove -y clang-11 llvm-11
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 50

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libbfd-dev libcap-dev libelf-dev libiberty-dev python3-docutils
# Install libsframe1 on Ubuntu 24.04+
sudo apt install -y libsframe1 || true
# clang/LLVM are already installed, but we're missing some aliases.
CLANG_VERSION="$(echo '__clang_major__' | clang -E - | tail -n 1)"
sudo update-alternatives \
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
jobs:
build:
name: Build static bpftool binary
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
env:
TARGETARCH: ${{ matrix.arch }}
FILE_STRING_ARCH_amd64: x86-64
Expand All @@ -33,7 +33,7 @@ jobs:
if: matrix.arch == 'amd64'
run: |
sudo apt-get update
sudo apt-get install -y libelf-dev libcap-dev
sudo apt-get install -y libelf-dev libcap-dev libsframe1

- name: Download and extract compiled LLVM release
env:
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:

draft-release:
name: Create a draft release
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ concurrency:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
env:
LLVM_URL_PREFIX: https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.0
LLVM_PATH: clang+llvm-15.0.0-x86_64-linux-gnu-rhel-8.4
Expand All @@ -26,7 +26,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libelf-dev
sudo apt-get install -y libelf-dev libsframe1

- name: Download and extract compiled LLVM release
run: |
Expand Down
3 changes: 3 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ else
ifeq ($(feature-disassembler-init-styled), 1)
CFLAGS += -DDISASM_INIT_STYLED
endif
ifeq ($(feature-libelf-zstd),1)
LIBS += -lsframe
endif
endif
endif
ifeq ($(filter -DHAVE_LLVM_SUPPORT -DHAVE_LIBBFD_SUPPORT,$(CFLAGS)),)
Expand Down
38 changes: 35 additions & 3 deletions src/Makefile.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,41 @@ feature-clang-bpf-co-re := \
$(findstring 1,$(call detect,$(CLANG_BPF_CO_RE_PROBE_CMD)))
endif # clang-bpf-co-re

### feature-libelf-zstd

# Define these unconditionally so we can also use the probe for feature-libbfd
LIBELF_ZSTD_PROBE := '$(pound)include <libelf.h>\n'
LIBELF_ZSTD_PROBE += 'int main(void) {'
LIBELF_ZSTD_PROBE += ' elf_compress(0, ELFCOMPRESS_ZSTD, 0);'
LIBELF_ZSTD_PROBE += ' return 0;'
LIBELF_ZSTD_PROBE += '}'

LIBELF_ZSTD_PROBE_CMD = printf '%b\n' $(LIBELF_ZSTD_PROBE) | \
$(CC) $(CFLAGS) -Wall -Werror -x c - -lelf -lz -lzstd -o - >/dev/null

define libelf_zstd_build
$(call detect,$(LIBELF_ZSTD_PROBE_CMD))
endef

ifneq ($(findstring libelf-zstd,$(FEATURE_TESTS)),)
$(call LOG,Probing: feature-libelf-zstd)
feature-libelf-zstd := $(findstring 1, $(call libelf_zstd_build))
endif # libelf-zstd

### feature-libbfd

ifneq ($(findstring libbfd,$(FEATURE_TESTS)),)

# Check whether feature-libbfd probe needs libzstd
ifneq ($(findstring libelf-zstd,$(FEATURE_TESTS)),)
need_libzstd := $(feature-libelf-zstd)
else
need_libzstd := $(findstring 1, $(call libelf_zstd_build))
endif
ifeq ($(need_libzstd),1)
LIBZSTD_FLAG := -lzstd -lsframe
endif

LIBBFD_PROBE := '$(pound)include <bfd.h>\n'
LIBBFD_PROBE += 'int main(void) {'
LIBBFD_PROBE += ' bfd_demangle(0, 0, 0);'
Expand All @@ -51,15 +83,15 @@ endef

$(call LOG,Probing: feature-libbfd)
feature-libbfd := \
$(findstring 1,$(call libbfd_build,-lbfd -ldl))
$(findstring 1,$(call libbfd_build,-lbfd $(LIBZSTD_FLAG) -ldl))
ifneq ($(feature-libbfd),1)
$(call LOG,Probing: feature-libbfd-liberty)
feature-libbfd-liberty := \
$(findstring 1,$(call libbfd_build,-lbfd -ldl -liberty))
$(findstring 1,$(call libbfd_build,-lbfd $(LIBZSTD_FLAG) -ldl -liberty))
ifneq ($(feature-libbfd-liberty),1)
$(call LOG,Probing: feature-libbfd-liberty-z)
feature-libbfd-liberty-z := \
$(findstring 1,$(call libbfd_build,-lbfd -ldl -liberty -lz))
$(findstring 1,$(call libbfd_build,-lbfd $(LIBZSTD_FLAG) -ldl -liberty -lz))
endif
endif
HAS_LIBBFD := $(findstring 1, \
Expand Down
Loading