Skip to content

Commit 5c7f64b

Browse files
authored
Set CMAKE_OSX_SYSROOT when building lldb (#4274)
CMake 4 no longer sets the CMAKE_OSX_SYSROOT variable by default, causing the lldb build to fail after all GitHub-hosted runners have been upgraded to CMake 4. As a workaround, the variable is set using CMake command line options. There is a PR to fix this issue in the llvm-project: llvm/llvm-project#138020. We might want to remove this workaround after that PR has been merged.
1 parent 065cc72 commit 5c7f64b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/build_wamr_lldb.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,20 @@ jobs:
172172
python3 ci/validate_lldb.py --port 1239 --lldb core/deps/wamr-lldb/bin/lldb --wamr wamr-debug/iwasm --verbose
173173
working-directory: .
174174

175+
# Define CMAKE_OSX_SYSROOT to avoid the error:
176+
# no such file or directory: 'llvm-project/build/tools/lldb/tools/debugserver/source/mach_excServer.c'
177+
# no such file or directory: 'llvm-project/build/tools/lldb/tools/debugserver/source/mach_excUser.c'
178+
#
179+
# This workaround should be removed when the issue is fixed in llvm-project:
180+
# - https://github.com/llvm/llvm-project/pull/138020/
175181
- name: build lldb macos
176182
if: steps.lldb_build_cache.outputs.cache-hit != 'true' && contains(inputs.runner, 'macos')
177183
run: |
178184
echo "start to build lldb..."
179185
mkdir -p wamr-lldb
180186
cmake -S ./llvm -B build \
181187
-G Ninja \
188+
-DCMAKE_OSX_SYSROOT=$(xcrun --show-sdk-path) \
182189
-DCMAKE_INSTALL_PREFIX=../wamr-lldb \
183190
-DCMAKE_BUILD_TYPE:STRING="Release" \
184191
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \

0 commit comments

Comments
 (0)