Skip to content

Commit

Permalink
Fix CI build break on Mac with LLVM 10.0.1 (#1245)
Browse files Browse the repository at this point in the history
There's a bug in the current Homebrew llvm 10.0.1 where
it fails to link because of missing libxml2.tbd. It's fixed
upstream in LLVM, but not yet fixed in Homebrew. Hopefully
a subsequent 10.0.x or 11.x will fix it, but for now, just
fall back to llvm@9.

Also issue a warning in the build scripts if this condition
is detected, so if a user encounters it on their system, they
have a hint about how to address it.

Signed-off-by: Larry Gritz <[email protected]>
  • Loading branch information
lgritz committed Aug 26, 2020
1 parent c5b2afa commit 1afa2ca
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,20 @@ jobs:
CMAKE_CXX_STANDARD: 14
PYTHON_VERSION: 3.8
LLVM_BC_GENERATOR: /usr/bin/clang++
LLVMBREWVER: "@9"
# ^^ There's a bug in the current Homebrew llvm 10.0.1 where
# it fails to link because of missing libxml2.tbd. It's fixed
# upstream in LLVM, but not yet fixed in Homebrew. Hopefully
# a subsequent 10.0.x or 11.x will fix it, but for now, just
# fall back to llvm@9.
MY_CMAKE_FLAGS: -DLLVM_BC_GENERATOR=/usr/bin/clang++
# ^^ Force bitcode compiles to use the system clang compiler by
# preemptively telling it the LLVM_BC_GENERATOR, to avoid some
# library mismatches we tend to see on GH CI's Mac images.
run: |
source src/build-scripts/ci-startup.bash
source src/build-scripts/install_homebrew_deps.bash
brew uninstall llvm
OPENIMAGEIO_CMAKE_FLAGS="-DOIIO_BUILD_TESTS=0 -DUSE_OPENGL=0"
source src/build-scripts/build_openimageio.bash
source src/build-scripts/ci-build-and-test.bash
Expand Down
4 changes: 3 additions & 1 deletion src/build-scripts/install_homebrew_deps.bash
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,6 @@ fi
export PATH=/usr/local/opt/qt5/bin:$PATH
export PATH=/usr/local/opt/python/libexec/bin:$PATH
export PYTHONPATH=/usr/local/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
export PATH=/usr/local/opt/llvm/bin:$PATH
export PATH=/usr/local/opt/llvm${LLVMBREWVER}/bin:$PATH
export LLVM_DIRECTORY=/usr/local/opt/llvm${LLVMBREWVER}
export LLVM_ROOT=/usr/local/opt/llvm${LLVMBREWVER}
11 changes: 11 additions & 0 deletions src/cmake/externalpackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,17 @@ if (LLVM_VERSION VERSION_GREATER_EQUAL 10.0.0 AND
"icc >= 7, MSVS >= 2017. "
"If you must use C++11, you need to build against LLVM 9 or earlier.")
endif ()
if (APPLE AND LLVM_VERSION VERSION_EQUAL 10.0.1 AND EXISTS "/usr/local/Cellar/llvm")
message (WARNING
"${ColorYellow}If you are using LLVM 10.0.1 installed by Homebrew, "
"please note that a known bug in LLVM may produce a link error where "
"it says it can't find libxml2.tbd. If you encounter this, please "
"try downgrading to LLVM 9: \n"
" brew uninstall llvm \n"
" brew install llvm@9 \n"
" export LLVM_DIRECTORY=/usr/local/opt/llvm@9 "
"${ColorReset}\n")
endif ()

checked_find_package (partio)

Expand Down

0 comments on commit 1afa2ca

Please sign in to comment.