Skip to content

Commit

Permalink
Misc fixes
Browse files Browse the repository at this point in the history
* Use environment var flags in tar-artifacts.sh
* Pass additional LLVM arguments in build-scx-selftests/build.sh
* Do not copy selftests/bpf directory at the end of build_selftests.sh
  • Loading branch information
theihor committed Oct 18, 2024
1 parent cfac65a commit 5182e30
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
12 changes: 6 additions & 6 deletions .github/scripts/tar-artifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ fi

arch="${1}"
toolchain="${2}"
archive_make_helpers="${3:-0}"

# Convert a platform (as returned by uname -m) to the kernel
# arch (as expected by ARCH= env).
Expand Down Expand Up @@ -74,7 +73,7 @@ for file in "${kbuild_output_file_list[@]}"; do
done

additional_file_list=()
if [ $archive_make_helpers -ne 0 ]; then
if [[ -n "${ARCHIVE_MAKE_HELPERS}" ]]; then
# Package up a bunch of additional infrastructure to support running
# 'make kernelrelease' and bpf tool checks later on.
mapfile -t additional_file_list < <(find . -iname Makefile)
Expand All @@ -86,9 +85,11 @@ if [ $archive_make_helpers -ne 0 ]; then
)
fi

# Make sure sched_ext tests are included in the tarball
mkdir -p selftests
mv tools/testing/selftests/sched_ext selftests
cp -r tools/testing/selftests/bpf selftests
if [[ -n "${BUILD_SCHED_EXT_SELFTESTS}" ]]; then
cp -r tools/testing/selftests/sched_ext selftests
fi

tar -cf - \
kbuild-output \
Expand All @@ -97,8 +98,7 @@ tar -cf - \
--exclude '*.d' \
--exclude '*.h' \
--exclude '*.output' \
selftests/bpf/ \
selftests/sched_ext/ \
selftests/ \
| zstd -T0 -19 -o "vmlinux-${arch}-${toolchain}.tar.zst"

# Cleanup and restore the original KBUILD_OUTPUT
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/kernel-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
runs-on: ${{ fromJSON(inputs.runs_on) }}
timeout-minutes: 100
env:
ARCHIVE_MAKE_HELPERS: ${{ github.repository != 'kernel-patches/bpf' && '1' || '0' }}
ARCHIVE_MAKE_HELPERS: ${{ github.repository != 'kernel-patches/bpf' && 'true' || '' }}
KERNEL: ${{ inputs.kernel }}
REPO_ROOT: ${{ github.workspace }}
REPO_PATH: ""
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
- name: Tar artifacts
working-directory: ${{ env.REPO_ROOT }}
run: |
bash .github/scripts/tar-artifact.sh ${{ inputs.arch }} ${{ inputs.toolchain_full }} ${{ env.ARCHIVE_MAKE_HELPERS }}
bash .github/scripts/tar-artifact.sh ${{ inputs.arch }} ${{ inputs.toolchain_full }}
- if: ${{ github.event_name != 'push' }}
name: Remove KBUILD_OUTPUT content
shell: bash
Expand Down
2 changes: 2 additions & 0 deletions build-scx-selftests/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ MAKE_OPTS=$(cat <<EOF
ARCH=${ARCH}
CROSS_COMPILE=${CROSS_COMPILE}
CLANG=clang-${LLVM_VERSION}
LLC=llc-${LLVM_VERSION}
LLVM_STRIP=llvm-strip-${LLVM_VERSION}
VMLINUX_BTF=${KBUILD_OUTPUT}/vmlinux
EOF
)
Expand Down
8 changes: 0 additions & 8 deletions build-selftests/build_selftests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ fi

foldable start build_selftests "Building selftests with $TOOLCHAIN"

LIBBPF_PATH="${REPO_ROOT}"

PREPARE_SELFTESTS_SCRIPT=${THISDIR}/prepare_selftests-${KERNEL}.sh
if [ -f "${PREPARE_SELFTESTS_SCRIPT}" ]; then
(cd "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf" && ${PREPARE_SELFTESTS_SCRIPT})
Expand Down Expand Up @@ -59,10 +57,4 @@ make ${MAKE_OPTS} headers
make ${MAKE_OPTS} ${SELF_OPTS} clean
make ${MAKE_OPTS} ${SELF_OPTS} -j $(kernel_build_make_jobs)

cd -
mkdir "${LIBBPF_PATH}"/selftests
cp -R "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf" \
"${LIBBPF_PATH}"/selftests
cd "${LIBBPF_PATH}"

foldable end build_selftests

0 comments on commit 5182e30

Please sign in to comment.