From 35feeb91e60f77d58e53328402aaadc186d7dee8 Mon Sep 17 00:00:00 2001 From: Powei Feng Date: Thu, 7 Dec 2023 17:21:25 -0800 Subject: [PATCH] spirv-headers: fix failed headers check (#7416) Due to a cmake misconfiguration, we are installing spirv as part of the release, public headers. It's now corrected. --- third_party/spirv-headers/CMakeLists.txt | 8 +++--- .../filament-specific-changes.patch | 27 +++++++++++++++++++ .../spirv-tools/.github/workflows/wasm.yml | 14 ---------- third_party/spirv-tools/.gitignore | 2 ++ third_party/spirv-tools/filament-update.sh | 5 ++-- 5 files changed, 35 insertions(+), 21 deletions(-) create mode 100644 third_party/spirv-headers/filament-specific-changes.patch delete mode 100644 third_party/spirv-tools/.github/workflows/wasm.yml diff --git a/third_party/spirv-headers/CMakeLists.txt b/third_party/spirv-headers/CMakeLists.txt index 9cfba73af290..2b8bb5e59591 100644 --- a/third_party/spirv-headers/CMakeLists.txt +++ b/third_party/spirv-headers/CMakeLists.txt @@ -28,7 +28,7 @@ # The SPIR-V headers from the SPIR-V Registry # https://www.khronos.org/registry/spir-v/ # -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.19) project(SPIRV-Headers VERSION 1.5.5) # There are two ways to use this project. @@ -44,11 +44,9 @@ project(SPIRV-Headers VERSION 1.5.5) # 2. cmake .. # 3. cmake --build . --target install -option(SPIRV_HEADERS_SKIP_EXAMPLES "Skip building examples" - ${SPIRV_HEADERS_SKIP_EXAMPLES}) +option(SPIRV_HEADERS_SKIP_EXAMPLES "Skip building examples" ON) -option(SPIRV_HEADERS_SKIP_INSTALL "Skip install" - ${SPIRV_HEADERS_SKIP_INSTALL}) +option(SPIRV_HEADERS_SKIP_INSTALL "Skip install" ON) if(NOT ${SPIRV_HEADERS_SKIP_EXAMPLES}) set(SPIRV_HEADERS_ENABLE_EXAMPLES ON) diff --git a/third_party/spirv-headers/filament-specific-changes.patch b/third_party/spirv-headers/filament-specific-changes.patch new file mode 100644 index 000000000000..b9ddb551ae49 --- /dev/null +++ b/third_party/spirv-headers/filament-specific-changes.patch @@ -0,0 +1,27 @@ +diff --git a/third_party/spirv-headers/CMakeLists.txt b/third_party/spirv-headers/CMakeLists.txt +index 9cfba73af..2b8bb5e59 100644 +--- a/third_party/spirv-headers/CMakeLists.txt ++++ b/third_party/spirv-headers/CMakeLists.txt +@@ -28,7 +28,7 @@ + # The SPIR-V headers from the SPIR-V Registry + # https://www.khronos.org/registry/spir-v/ + # +-cmake_minimum_required(VERSION 3.0) ++cmake_minimum_required(VERSION 3.19) + project(SPIRV-Headers VERSION 1.5.5) + + # There are two ways to use this project. +@@ -44,11 +44,9 @@ project(SPIRV-Headers VERSION 1.5.5) + # 2. cmake .. + # 3. cmake --build . --target install + +-option(SPIRV_HEADERS_SKIP_EXAMPLES "Skip building examples" +- ${SPIRV_HEADERS_SKIP_EXAMPLES}) ++option(SPIRV_HEADERS_SKIP_EXAMPLES "Skip building examples" ON) + +-option(SPIRV_HEADERS_SKIP_INSTALL "Skip install" +- ${SPIRV_HEADERS_SKIP_INSTALL}) ++option(SPIRV_HEADERS_SKIP_INSTALL "Skip install" ON) + + if(NOT ${SPIRV_HEADERS_SKIP_EXAMPLES}) + set(SPIRV_HEADERS_ENABLE_EXAMPLES ON) diff --git a/third_party/spirv-tools/.github/workflows/wasm.yml b/third_party/spirv-tools/.github/workflows/wasm.yml deleted file mode 100644 index d9a9c5cb7c17..000000000000 --- a/third_party/spirv-tools/.github/workflows/wasm.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Wasm Build - -on: [ push, pull_request ] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Build web - run: docker-compose up - - name: Run tests - run: node test/wasm/test.js diff --git a/third_party/spirv-tools/.gitignore b/third_party/spirv-tools/.gitignore index a87496a7d972..ec709ba79dfd 100644 --- a/third_party/spirv-tools/.gitignore +++ b/third_party/spirv-tools/.gitignore @@ -5,6 +5,8 @@ compile_commands.json /build*/ /buildtools/ /external/googletest +/external/SPIRV-Headers +/external/spirv-headers /external/effcee /external/re2 /external/protobuf diff --git a/third_party/spirv-tools/filament-update.sh b/third_party/spirv-tools/filament-update.sh index 5e52c24d215d..95149ccd4429 100644 --- a/third_party/spirv-tools/filament-update.sh +++ b/third_party/spirv-tools/filament-update.sh @@ -39,7 +39,7 @@ rm -rf .git .github git checkout filament-specific-changes.patch FILAMENT_README.md filament-update.sh git apply filament-specific-changes.patch -HEADERS_HASH=`grep "spirv_headers_revision\':" DEPS | awk '{ print $2 }' | sed "s/[\'\,\\n]//g"` +HEADERS_HASH=`grep "spirv_headers_revision':" DEPS | awk '{ print $2 }' | sed "s/[\'\,\\n]//g"` # Next we update SPIRV-Headers to the right hash (dependency as given by SPIRV-Tools) sync_khronos_repo SPIRV-Headers ${HEADERS_HASH} @@ -49,5 +49,6 @@ cd ../spirv-headers rsync -r /tmp/SPIRV-Headers/ ./ --delete rm -rf .git .github # Recover the filament specific files lost in the above rsync -git checkout FILAMENT_README.md +git checkout filament-specific-changes.patch FILAMENT_README.md +git apply filament-specific-changes.patch popd