Skip to content

Commit 1b64619

Browse files
committed
ci: Some minor llvm dependency improvements
While debugging some CI failures on Windows, I went down some wrong roads that turned out not to be related to the actual problem... but nevertheless are improvements I wish to keep. Here they are: * Attempt to use the install-llvm-action from Windows wasn't able to work (among other reasons) because we weren't passing along the llvm_action_ver variable. * For reasons I never quite understood, the llvm install action works a lot better on Windows if done before the "build setup" step. So I just moved that action earlier in the sequence. * Some status messages about how we are installing LLVM. * A correction in how we detect and print the pkg_ROOT environment variable in the log generated by handle_package_notfound. * Allow LLVM_PATH (set by that action) to be a proper hint for FindLLVM.cmake. Signed-off-by: Larry Gritz <lg@larrygritz.com>
1 parent 259ba8c commit 1b64619

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

.github/workflows/build-steps.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ jobs:
125125
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
126126
with:
127127
fetch-depth: '0'
128+
- name: Install LLVM and Clang
129+
if: inputs.llvm_action_ver != ''
130+
uses: KyleMayes/install-llvm-action@ebc0426251bc40c7cd31162802432c68818ab8f0 # v2.0.9
131+
with:
132+
version: ${{ inputs.llvm_action_ver }}
128133
- name: Build setup
129134
shell: bash
130135
run: |
@@ -142,11 +147,6 @@ jobs:
142147
# path: ./ccache
143148
key: ${{inputs.nametag}}-${{steps.ccache_cache_keys.outputs.date}}
144149
restore-keys: ${{inputs.nametag}}
145-
- name: Install LLVM and Clang
146-
if: inputs.llvm_action_ver != ''
147-
uses: KyleMayes/install-llvm-action@ebc0426251bc40c7cd31162802432c68818ab8f0 # v2.0.9
148-
with:
149-
version: ${{ inputs.llvm_action_ver }}
150150
- name: Dependencies
151151
shell: bash
152152
run: |

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ jobs:
580580
depcmds: ${{ matrix.depcmds }}
581581
extra_artifacts: ${{ matrix.extra_artifacts }}
582582
fmt_ver: ${{ matrix.fmt_ver }}
583+
llvm_action_ver: ${{ matrix.llvm_action_ver }}
583584
opencolorio_ver: ${{ matrix.opencolorio_ver }}
584585
openexr_ver: ${{ matrix.openexr_ver }}
585586
openimageio_ver: ${{ matrix.openimageio_ver }}

src/build-scripts/gh-win-installdeps.bash

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ echo "DEP_DIR $DEP_DIR :"
121121
ls -R -l "$DEP_DIR"
122122

123123
if [[ "$LLVM_VERSION" != "" ]] ; then
124+
echo "Running llvm_build.bash"
124125
source src/build-scripts/build_llvm.bash
125126
elif [[ "$LLVM_GOOGLE_DRIVE_ID" != "" ]] then
127+
echo "Installing LLVM from google drive"
126128
mkdir -p $HOME/llvm
127129
pushd $HOME/llvm
128130
#LLVM_GOOGLE_DRIVE_ID="1uy7PNVlTQ-H56unXGOS6siRWtNcdS1J7"
@@ -131,6 +133,8 @@ elif [[ "$LLVM_GOOGLE_DRIVE_ID" != "" ]] then
131133
unzip $LLVM_ZIP_FILENAME > /dev/null
132134
export LLVM_ROOT=$PWD/llvm-build
133135
popd
136+
else
137+
export LLVM_ROOT=$LLVM_PATH
134138
fi
135139
echo "LLVM_ROOT = $LLVM_ROOT"
136140

src/cmake/dependency_utils.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ function (handle_package_notfound pkgname required)
133133
message (STATUS "${ColorRed}${pkgname} library not found ${ColorReset}")
134134
if (${pkgname}_ROOT)
135135
message (STATUS " ${pkgname}_ROOT was: ${${pkgname}_ROOT}")
136-
elseif ($ENV{${pkgname}_ROOT})
137-
message (STATUS " ENV ${pkgname}_ROOT was: ${${pkgname}_ROOT}")
136+
elseif (DEFINED ENV{${pkgname}_ROOT})
137+
message (STATUS " ENV ${pkgname}_ROOT was: $ENV{${pkgname}_ROOT}")
138138
else ()
139139
message (STATUS " Try setting ${pkgname}_ROOT ?")
140140
endif ()

src/cmake/modules/FindLLVM.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
if (LLVM_DIRECTORY)
2626
list (APPEND LLVM_CONFIG_PATH_HINTS "${LLVM_DIRECTORY}/bin")
2727
endif ()
28+
if (LLVM_PATH)
29+
list (APPEND LLVM_CONFIG_PATH_HINTS "${LLVM_PATH}/bin")
30+
endif ()
2831
if (LLVM_ROOT)
2932
list (APPEND LLVM_CONFIG_PATH_HINTS "${LLVM_ROOT}/bin")
3033
endif ()

0 commit comments

Comments
 (0)