Skip to content

Commit e145775

Browse files
vineetgarctheihor
authored andcommitted
build-bpf-gcc: add gcc-version input to select the GCC major version
The GCC major version was hardcoded to 15 in latest-snapshots.sh. Add a 'gcc-version' action input (default "15", so existing callers are unchanged) that is passed through as $GCC_VERSION and used to pick the LATEST-<version> snapshot directory and tarball. This lets callers (e.g. theihor/gcc-bpf) build GCC 16 for BPF CI toolchain experiments without forking the action.
1 parent fc66eac commit e145775

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

build-bpf-gcc/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ inputs:
44
install-dir:
55
description: "Path to the GCC installation directory"
66
required: true
7+
gcc-version:
8+
description: "Major GCC version to build (e.g. 15, 16)"
9+
required: false
10+
default: "15"
711

812
runs:
913
using: "composite"
@@ -12,6 +16,8 @@ runs:
1216
- name: Determine latest snapshots
1317
id: latest-snapshots
1418
shell: bash
19+
env:
20+
GCC_VERSION: ${{ inputs.gcc-version }}
1521
run: ${GITHUB_ACTION_PATH}/latest-snapshots.sh
1622

1723
- uses: actions/cache@v4

build-bpf-gcc/latest-snapshots.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
#!/bin/bash
22
set -euo pipefail
33

4+
# Major GCC version to build; defaults to 15 for backward compatibility.
5+
GCC_VERSION="${GCC_VERSION:-15}"
6+
47
BINUTILS_TARBALL=$(wget https://snapshots.sourceware.org/binutils/trunk/latest/src/sha512.sum -O - -o /dev/null | awk '{print $2}')
5-
GCC_TARBALL=$(wget https://gcc.gnu.org/pub/gcc/snapshots/LATEST-15 -O - -o /dev/null | grep -E 'gcc-15-[0-9]+.tar.xz' | sed -e 's/.*\(gcc-15-[^<]*\).*/\1/')
8+
GCC_TARBALL=$(wget https://gcc.gnu.org/pub/gcc/snapshots/LATEST-${GCC_VERSION} -O - -o /dev/null | grep -E "gcc-${GCC_VERSION}-[0-9]+.tar.xz" | sed -e "s/.*\(gcc-${GCC_VERSION}-[^<]*\).*/\1/")
69

710
BINUTILS_URL="https://snapshots.sourceware.org/binutils/trunk/latest/src/$BINUTILS_TARBALL"
8-
GCC_URL="https://gcc.gnu.org/pub/gcc/snapshots/LATEST-15/$GCC_TARBALL"
11+
GCC_URL="https://gcc.gnu.org/pub/gcc/snapshots/LATEST-${GCC_VERSION}/$GCC_TARBALL"
912

1013
BINUTILS_BASENAME=$(basename $BINUTILS_TARBALL .tar.xz)
1114
GCC_BASENAME=$(basename $GCC_TARBALL .tar.xz)

0 commit comments

Comments
 (0)