Skip to content

Commit f9121bb

Browse files
authored
ci: Some minor llvm dependency improvements (#2090)
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 1627fe3 commit f9121bb

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
@@ -127,6 +127,11 @@ jobs:
127127
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
128128
with:
129129
fetch-depth: '0'
130+
- name: Install LLVM and Clang
131+
if: inputs.llvm_action_ver != ''
132+
uses: KyleMayes/install-llvm-action@ebc0426251bc40c7cd31162802432c68818ab8f0 # v2.0.9
133+
with:
134+
version: ${{ inputs.llvm_action_ver }}
130135
- name: Build setup
131136
shell: bash
132137
run: |
@@ -144,11 +149,6 @@ jobs:
144149
# path: ./ccache
145150
key: ${{inputs.nametag}}-${{steps.ccache_cache_keys.outputs.date}}
146151
restore-keys: ${{inputs.nametag}}
147-
- name: Install LLVM and Clang
148-
if: inputs.llvm_action_ver != ''
149-
uses: KyleMayes/install-llvm-action@ebc0426251bc40c7cd31162802432c68818ab8f0 # v2.0.9
150-
with:
151-
version: ${{ inputs.llvm_action_ver }}
152152
- name: Dependencies
153153
shell: bash
154154
run: |

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,7 @@ jobs:
581581
depcmds: ${{ matrix.depcmds }}
582582
extra_artifacts: ${{ matrix.extra_artifacts }}
583583
fmt_ver: ${{ matrix.fmt_ver }}
584+
llvm_action_ver: ${{ matrix.llvm_action_ver }}
584585
opencolorio_ver: ${{ matrix.opencolorio_ver }}
585586
openexr_ver: ${{ matrix.openexr_ver }}
586587
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)