Skip to content

[Loader] Fix heap type syntax checking. (#3395) #138

[Loader] Fix heap type syntax checking. (#3395)

[Loader] Fix heap type syntax checking. (#3395) #138

Workflow file for this run

name: IWYU checker
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
on:
push:
branches:
- master
paths:
- ".github/workflows/IWYU_scan.yml"
- "include/**"
- "lib/**"
- "plugins/**"
- "test/**"
- "thirdparty/**"
- "tools/**"
- "CMakeLists.txt"
pull_request:
branches:
- master
- 'proposal/**'
paths:
- ".github/workflows/IWYU_scan.yml"
- "include/**"
- "lib/**"
- "plugins/**"
- "test/**"
- "thirdparty/**"
- "tools/**"
- "CMakeLists.txt"
jobs:
get_version:
permissions:
contents: read
name: Retrieve version information
runs-on: ubuntu-latest
outputs:
version: ${{ steps.prep.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Ensure git safe directory
run: |
git config --global --add safe.directory $(pwd)
- name: Get version
id: prep
run: |
# Retrieve annotated tags. Details: https://github.com/actions/checkout/issues/290
git fetch --tags --force
git config --global --add safe.directory $(pwd)
echo "version=$(git describe --match '[0-9].[0-9]*' --tag)" >> $GITHUB_OUTPUT
build_fedora:
permissions:
contents: write
name: Fedora latest
needs: get_version
runs-on: ubuntu-latest
container:
image: fedora:latest
steps:
- name: Install requirements
run: |
dnf update -y
dnf install -y cmake ninja-build llvm llvm-devel lld-devel clang git file rpm-build dpkg-dev clang-devel spdlog-devel
curl -L -O https://github.com/include-what-you-use/include-what-you-use/archive/refs/tags/0.22.zip
unzip 0.22.zip
cmake -Bbuild-iwyu -GNinja -DCMAKE_BUILD_TYPE=Release include-what-you-use-0.22
cmake --build build-iwyu --target install
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Ensure git safe directory
run: |
git config --global --add safe.directory $(pwd)
- name: Build and scan WasmEdge with IWYU
run: |
cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Debug -DWASMEDGE_BUILD_TESTS=ON -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=include-what-you-use .
cmake --build build > iwyu_fedora.log
- uses: actions/upload-artifact@v3
with:
name: iwyu_fedora.log
path: iwyu_fedora.log
build_macos:
permissions:
contents: write
name: macOS
runs-on: macos-latest
needs: get_version
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Ensure git safe directory
run: |
git config --global --add safe.directory $(pwd)
- name: Build and scan WasmEdge with IWYU
shell: bash
run: |
# Unlink python@3.11 to fix brew link 2to3 conflict.
brew unlink python@3.11
brew install llvm ninja cmake
export LLVM_DIR="$(brew --prefix)/opt/llvm/lib/cmake"
export Clang_DIR="$(brew --prefix)/opt/llvm/lib/cmake/clang"
export IWYU_PREFIX="$(brew --prefix)/opt/iwyu"
export CC=clang
export CXX=clang++
cd ../../
curl -L -O https://github.com/include-what-you-use/include-what-you-use/archive/refs/tags/0.21.zip
unzip 0.21.zip
patch -p1 -d include-what-you-use-0.21 <<EOF
diff --git a/iwyu.cc b/iwyu.cc
--- a/iwyu.cc
+++ b/iwyu.cc
@@ -3476,6 +3476,12 @@ class InstantiatedTemplateVisitor
if (ReplayClassMemberUsesFromPrecomputedList(type))
return true;
+ // Sometimes, an implicit specialization occurs to be not instantiated.
+ // TODO(bolshakov): don't report them at all as full uses or figure out
+ // how to scan them.
+ if (!class_decl->hasDefinition())
+ return true;
+
// Make sure all the types we report in the recursive TraverseDecl
// calls, below, end up in the cache for class_decl.
EOF
cmake -Bbuild-iwyu -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$IWYU_PREFIX" include-what-you-use-0.21
cmake --build build-iwyu --target install
cd WasmEdge/WasmEdge
cmake -Bbuild -GNinja -DWASMEDGE_BUILD_TESTS=ON -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="xcrun;$IWYU_PREFIX/bin/include-what-you-use" -DWASMEDGE_BUILD_PACKAGE="TGZ" .
cmake --build build > iwyu_macOS.log
- uses: actions/upload-artifact@v3
with:
name: iwyu_macOS.log
path: iwyu_macOS.log