diff --git a/.github/scripts/matrix.py b/.github/scripts/matrix.py index c3390215..b81a3b39 100644 --- a/.github/scripts/matrix.py +++ b/.github/scripts/matrix.py @@ -39,7 +39,8 @@ class Compiler(str, Enum): class Toolchain: compiler: Compiler # This is relevant ONLY for LLVM and should not be required for GCC - version: int + version: int = 0 + extra_name: str = "" @property def short_name(self) -> str: @@ -48,9 +49,15 @@ def short_name(self) -> str: @property def full_name(self) -> str: if self.compiler == Compiler.GCC: - return self.short_name + if self.extra_name != '': + return f"{self.short_name}-{self.extra_name}" + else: + return f"{self.short_name}" - return f"{self.short_name}-{self.version}" + if self.extra_name != '': + return f"{self.short_name}-{self.version}-{self.extra_name}" + else: + return f"{self.short_name}-{self.version}" def to_dict(self) -> Dict[str, Union[str, int]]: return { @@ -64,6 +71,7 @@ def to_dict(self) -> Dict[str, Union[str, int]]: class BuildConfig: arch: Arch toolchain: Toolchain + bpf_toolchain: Toolchain = dataclasses.field(default_factory=lambda: Toolchain(compiler=Compiler.LLVM, version=DEFAULT_LLVM_VERSION)) kernel: str = "LATEST" run_veristat: bool = False parallel_tests: bool = False @@ -100,6 +108,9 @@ def tests(self) -> Dict[str, Any]: if self.toolchain.version >= 18: tests_list.append("test_progs_cpuv4") + if self.bpf_toolchain == "gcc": + tests_list = [ "test_progs-bpf_gcc" ] + if not self.parallel_tests: tests_list = [test for test in tests_list if not test.endswith("parallel")] @@ -109,6 +120,7 @@ def to_dict(self) -> Dict[str, Any]: return { "arch": self.arch.value, "toolchain": self.toolchain.to_dict(), + "bpf_toolchain": self.bpf_toolchain.to_dict(), "kernel": self.kernel, "run_veristat": self.run_veristat, "parallel_tests": self.parallel_tests, @@ -185,6 +197,11 @@ def generate_test_config(test: str) -> Dict[str, Union[str, int]]: arch=Arch.S390X, toolchain=Toolchain(compiler=Compiler.GCC, version=DEFAULT_LLVM_VERSION), ), + BuildConfig( + arch=Arch.X86_64, + toolchain=Toolchain(compiler=Compiler.GCC, version=DEFAULT_LLVM_VERSION, extra_name="bpfgcc"), + bpf_toolchain=Toolchain(compiler=Compiler.GCC), + ), ] # Outside of those repositories we only run on x86_64 diff --git a/.github/workflows/kernel-build-test.yml b/.github/workflows/kernel-build-test.yml index 6296b36b..66881e40 100644 --- a/.github/workflows/kernel-build-test.yml +++ b/.github/workflows/kernel-build-test.yml @@ -15,6 +15,10 @@ on: required: true type: string description: The toolchain, e.g gcc, llvm + bpf-toolchain: + required: true + type: string + description: The toolchain, e.g gcc, llvm runs_on: required: true type: string @@ -65,6 +69,7 @@ jobs: arch: ${{ inputs.arch }} toolchain_full: ${{ inputs.toolchain_full }} toolchain: ${{ inputs.toolchain }} + bpf-toolchain: ${{ inputs.bpf-toolchain }} runs_on: ${{ inputs.build_runs_on }} llvm-version: ${{ inputs.llvm-version }} kernel: ${{ inputs.kernel }} @@ -76,6 +81,7 @@ jobs: arch: ${{ inputs.arch }} toolchain_full: ${{ inputs.toolchain_full }} toolchain: ${{ inputs.toolchain }} + bpf-toolchain: ${{ inputs.bpf-toolchain }} runs_on: ${{ inputs.runs_on }} llvm-version: ${{ inputs.llvm-version }} kernel: ${{ inputs.kernel }} diff --git a/.github/workflows/kernel-build.yml b/.github/workflows/kernel-build.yml index cf378dd9..e91ca9a6 100644 --- a/.github/workflows/kernel-build.yml +++ b/.github/workflows/kernel-build.yml @@ -16,6 +16,10 @@ on: required: true type: string description: The toolchain, e.g gcc, llvm + bpf-toolchain: + required: true + type: string + description: The toolchain, e.g gcc, llvm runs_on: required: true type: string @@ -94,6 +98,7 @@ jobs: arch: ${{ inputs.arch }} llvm-version: ${{ inputs.llvm-version }} pahole: c2f89dab3f2b0ebb53bab3ed8be32f41cb743c37 + bpf-toolchain: ${{ inputs.bpf-toolchain }} - name: Build kernel image uses: libbpf/ci/build-linux@main with: @@ -107,6 +112,7 @@ jobs: with: arch: ${{ inputs.arch }} toolchain: ${{ inputs.toolchain }} + bpf-toolchain: ${{ inputs.bpf-toolchain }} kbuild-output: ${{ env.KBUILD_OUTPUT }} max-make-jobs: 32 llvm-version: ${{ inputs.llvm-version }} @@ -115,7 +121,7 @@ jobs: # RELEASE=0 adds -O0 make flag # RELEASE=1 adds -O2 make flag RELEASE: ${{ inputs.release && '1' || '' }} - - if: ${{ github.event_name != 'push' }} + - if: ${{ inputs.bpf-toolchain != 'gcc' && github.event_name != 'push' }} name: Build samples uses: libbpf/ci/build-samples@main with: @@ -127,7 +133,7 @@ jobs: - name: Tar artifacts run: | bash .github/scripts/tar-artifact.sh ${{ inputs.arch }} ${{ inputs.toolchain_full }} - - if: ${{ github.event_name != 'push' }} + - if: ${{ inputs.bpf-toolchain != 'gcc' && github.event_name != 'push' }} name: Remove KBUILD_OUTPUT content shell: bash run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3c81e02b..3d4f07f9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,6 +43,7 @@ jobs: arch: ${{ matrix.arch }} toolchain_full: ${{ matrix.toolchain.fullname }} toolchain: ${{ matrix.toolchain.name }} + bpf-toolchain: ${{ matrix.bpf_toolchain.name }} runs_on: ${{ toJSON(matrix.runs_on) }} build_runs_on: ${{ toJSON(matrix.build_runs_on) }} llvm-version: ${{ matrix.toolchain.version }} @@ -50,7 +51,7 @@ jobs: tests: ${{ toJSON(matrix.tests) }} run_veristat: ${{ matrix.run_veristat }} # We only run tests on pull requests. - run_tests: ${{ github.event_name != 'push' }} + run_tests: ${{ matrix.bpf_toolchain.name != 'gcc' && github.event_name != 'push' }} # Download sources download_sources: ${{ github.repository == 'kernel-patches/vmtest' }} build_release: ${{ matrix.build_release }}