File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+
4+ # Find the path to swift binary
5+ SWIFT_PATH=$( which swift)
6+ echo " Swift binary found at: $SWIFT_PATH "
7+
8+ # Extract the toolchain path from swift binary path
9+ # Remove /usr/bin/swift from the path to get the toolchain root
10+ TOOLCHAIN_ROOT=$( dirname $( dirname " $SWIFT_PATH " ) )
11+ echo " Toolchain root: $TOOLCHAIN_ROOT "
12+
13+ # Construct the path to CFBase.h
14+ CFBASE_PATH=" $TOOLCHAIN_ROOT /lib/swift/CoreFoundation/CFBase.h"
15+ echo " Looking for CFBase.h at: $CFBASE_PATH "
16+
17+ # Check if the file exists
18+ if [ -f " $CFBASE_PATH " ]; then
19+ echo " Found CFBase.h, applying patch..."
20+
21+ # Create a backup of the original file
22+ cp " $CFBASE_PATH " " $CFBASE_PATH .bak"
23+
24+ # Replace the include line
25+ sed -i ' s/#include <ptrauth.h>/\/\/ #include <ptrauth.h>/g' " $CFBASE_PATH "
26+
27+ echo " Patch applied successfully."
28+ echo " Original file backed up at $CFBASE_PATH .bak"
29+ else
30+ echo " ERROR: Could not find CFBase.h in expected location."
31+ echo " Toolchain structure may be different than expected."
32+ exit 1
33+ fi
Original file line number Diff line number Diff line change 2424 - name : Swift version
2525 run : |
2626 which swift && swift --version
27+ - name : Toolchain fix patch
28+ run : |
29+ # Fix swift-corelibs-foundation#5211
30+ .github/scripts/fix-toolchain.sh
2731 - name : Building and running tests in debug mode with coverage
2832 run : |
2933 swift test \
You can’t perform that action at this time.
0 commit comments