File tree Expand file tree Collapse file tree
actions/verify-glibc-baseline Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 description : Shared library filename to verify
1010 required : false
1111 default : liblance_c.so
12+ workflow_type :
13+ description : Workflow type
14+ required : false
15+ default : dev
1216runs :
1317 using : composite
1418 steps :
@@ -28,15 +32,25 @@ runs:
2832 echo "Verifying file: $target_so"
2933
3034 objdump_output=$(objdump -p "$target_so")
31- printf '%s\n' "$objdump_output" | grep -A 10 "Version References:" || true
35+ printf '%s\n' "$objdump_output" | grep -A 10 "Version References: (truncated to first 10) " || true
3236
3337 version_gt() {
34- [ "$(printf '%s\n%s\n' "$2" "$1" | sort -V | tail -n1)" = "$1" ] && [ "$1" != "$2" ]
38+ [ "$1" = "$2" ] && return 1
39+ [ "$(printf '%s\n%s\n' "$1" "$2" | sort -V | tail -n1)" = "$1" ]
3540 }
3641
3742 while IFS= read -r version; do
3843 if version_gt "$version" "$baseline"; then
39- echo "::error::GLIBC Leak Detected! The binary contains symbols newer than GLIBC ${baseline}."
44+ {
45+ echo "## GLIBC baseline violation"
46+ echo "One or more symbols in \`$SEARCH_ROOT\` exceed the **$GLIBC_BASELINE** floor."
47+ echo "Run \`objdump -T <binary> | grep GLIBC_\` to identify the offending symbols."
48+
49+ if [ "${{ inputs.workflow_type }}" = "release" ]; then
50+ echo "To override in an emergency, re-dispatch with \`skip_glibc_check=true\`."
51+ fi
52+ } >> "$GITHUB_STEP_SUMMARY"
53+ echo "::error title=GLIBC baseline violated::See job summary for details."
4054 exit 1
4155 fi
4256 done < <(printf '%s\n' "$objdump_output" | grep -oE 'GLIBC_[0-9]+(\.[0-9]+)+' | sed 's/^GLIBC_//' | sort -Vu)
Original file line number Diff line number Diff line change 88 version :
99 description : " Version to build (without leading 'v')"
1010 required : true
11+ skip_glibc_check :
12+ description : " Emergency override: skip GLIBC baseline check (set to 'true' only if intentional)"
13+ required : false
14+ default : ' false'
1115
1216permissions :
1317 contents : write # needed for softprops/action-gh-release
@@ -87,10 +91,17 @@ jobs:
8791 - name : Install to staging prefix
8892 run : cmake --install build --prefix stage
8993 - name : Verify GLIBC Baseline
90- if : matrix.os_label == 'linux'
94+ if : matrix.os_label == 'linux' && inputs.skip_glibc_check != 'true'
9195 uses : ./.github/actions/verify-glibc-baseline
9296 with :
9397 search_root : ${{ github.workspace }}/stage
98+ workflow_type : release
99+ - name : Annotate skipped GLIBC check
100+ if : matrix.os_label == 'linux' && inputs.skip_glibc_check == 'true'
101+ run : |
102+ echo "::warning title=GLIBC check skipped::skip_glibc_check=true was set — this release may exceed the GLIBC_BASELINE (${{ env.GLIBC_BASELINE }}) floor. Audit the artifact before distributing."
103+ echo "## ⚠️ GLIBC baseline check was skipped" >> "$GITHUB_STEP_SUMMARY"
104+ echo "skip_glibc_check=true was set on this run. The artifact may link symbols above **${{ env.GLIBC_BASELINE }}**." >> "$GITHUB_STEP_SUMMARY"
94105 - name : Tar
95106 id : pack
96107 run : |
Original file line number Diff line number Diff line change @@ -21,11 +21,18 @@ project(LanceC
2121 LANGUAGES C CXX
2222)
2323
24+ if (NOT DEFINED CMAKE_C_STANDARD OR CMAKE_C_STANDARD LESS 11)
25+ set (CMAKE_C_STANDARD 11)
26+ endif ()
27+ set (CMAKE_C_STANDARD_REQUIRED ON )
28+ set (CMAKE_C_EXTENSIONS OFF )
29+
2430if (NOT DEFINED CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD LESS 20)
2531 set (CMAKE_CXX_STANDARD 20)
2632endif ()
2733set (CMAKE_CXX_STANDARD_REQUIRED ON )
2834set (CMAKE_CXX_EXTENSIONS OFF )
35+
2936set (CMAKE_C_VISIBILITY_PRESET hidden)
3037set (CMAKE_CXX_VISIBILITY_PRESET hidden)
3138set (CMAKE_VISIBILITY_INLINES_HIDDEN ON )
You can’t perform that action at this time.
0 commit comments