Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: fix macos unbreaking python #13136

Merged
merged 6 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ jobs:
python -m pip install pytest pytest-xdist pytest-subtests fastjsonschema coverage
- run: brew install pkg-config ninja llvm qt@5
- env:
CPPFLAGS: "-I/usr/local/include"
LDFLAGS: "-L/usr/local/lib"
CPPFLAGS: "-I/opt/homebrew/include"
LDFLAGS: "-L/opt/homebrew/lib"
MESON_CI_JOBNAME: unittests-appleclang
MESON_UNIT_TEST_BACKEND: ninja
HOMEBREW_NO_AUTO_UPDATE: 1
# These cannot evaluate anything, so we cannot set PATH or SDKROOT here
run: |
export SDKROOT="$(xcodebuild -version -sdk macosx Path)"
export PATH="$HOME/tools:/usr/local/opt/qt@5/bin:$PATH:$(brew --prefix llvm)/bin"
export PKG_CONFIG_PATH="/usr/local/opt/qt@5/lib/pkgconfig:$PKG_CONFIG_PATH"
export PATH="$HOME/tools:/opt/homebrew/opt/qt@5/bin:/opt/homebrew/opt/llvm/bin:$PATH"
export PKG_CONFIG_PATH="/opt/homebrew/opt/qt@5/lib/pkgconfig:$PKG_CONFIG_PATH"
./tools/run_with_cov.py ./run_unittests.py

- name: Aggregate coverage reports
Expand Down Expand Up @@ -93,25 +93,25 @@ jobs:
# Delete nonsensical PEP 668 breakage. It is the wrong solution to the problem and isn't designed to be
# productive -- only victim blaming -- however it bites particularly badly because this is a container/VM
# See commit 5c479d7a13a518c18ccb4dc3b6bdd7bfc2a9bdb5 for a more thorough analysis.
find /usr/local/Cellar/python* -name EXTERNALLY-MANAGED -print0 | xargs -0 rm -vf
find /opt/homebrew/Cellar/python* -name EXTERNALLY-MANAGED -print0 | xargs -0 rm -vf
# use python3 from homebrew because it is a valid framework, unlike the actions one:
# https://github.com/actions/setup-python/issues/58
- run: brew install pkg-config ninja llvm qt@5 boost ldc hdf5 openmpi lapack scalapack sdl2 boost-python3 gtk-doc
- run: brew install pkg-config ninja llvm qt@5 boost ldc hdf5 openmpi lapack scalapack sdl2 boost-python3 gtk-doc zstd ncurses
- run: |
python3 -m pip install --upgrade setuptools
python3 -m pip install --upgrade pip
python3 -m pip install cython coverage
- env:
CPPFLAGS: "-I/usr/local/include"
LDFLAGS: "-L/usr/local/lib"
CPPFLAGS: "-I/opt/homebrew/include"
LDFLAGS: "-L/opt/homebrew/lib"
MESON_ARGS: --unity=${{ matrix.unity }}
XML_CATALOG_FILES: "/opt/homebrew/etc/xml/catalog"
CI: 1
# These cannot evaluate anything, so we cannot set PATH or SDKROOT here
run: |
export SDKROOT="$(xcodebuild -version -sdk macosx Path)"
export PATH="$HOME/tools:/usr/local/opt/qt@5/bin:$PATH:$(brew --prefix llvm)/bin"
export PKG_CONFIG_PATH="/usr/local/opt/qt@5/lib/pkgconfig:$PKG_CONFIG_PATH"
export XML_CATALOG_FILES="/usr/local/etc/xml/catalog"
export PATH="$HOME/tools:/opt/homebrew/opt/qt@5/bin:/opt/homebrew/opt/llvm/bin:/opt/homebrew/opt/ncurses/bin:$PATH"
export PKG_CONFIG_PATH="/opt/homebrew/opt/qt@5/lib/pkgconfig:/opt/homebrew/opt/lapack/lib/pkgconfig:/opt/homebrew/opt/ncurses/lib/pkgconfig:$PKG_CONFIG_PATH"
./tools/run_with_cov.py ./run_project_tests.py --backend=ninja

- name: Aggregate coverage reports
Expand All @@ -126,7 +126,9 @@ jobs:
verbose: true

Qt4macos:
runs-on: macos-latest
# This job only works on Intel Macs, because OpenSSL 1.0 doesn't build on
# Apple ARM
runs-on: macos-13
env:
HOMEBREW_NO_AUTO_UPDATE: 1
steps:
Expand Down
9 changes: 7 additions & 2 deletions mesonbuild/dependencies/boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,9 @@ def detect_roots(self) -> None:
inc_paths = [x.resolve() for x in inc_paths]
roots += inc_paths

m = self.env.machines[self.for_machine]
# Add system paths
if self.env.machines[self.for_machine].is_windows():
if m.is_windows():
# Where boost built from source actually installs it
c_root = Path('C:/Boost')
if c_root.is_dir():
Expand All @@ -688,8 +689,12 @@ def detect_roots(self) -> None:
tmp: T.List[Path] = []

# Add some default system paths
if m.is_darwin():
tmp.extend([
Path('/opt/homebrew/'), # for Apple Silicon MacOS
Path('/usr/local/opt/boost'), # for Intel Silicon MacOS
])
tmp += [Path('/opt/local')]
tmp += [Path('/usr/local/opt/boost')]
Comment on lines +695 to -692
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This path is specific to Apple? Good to know...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, homebrew on Intel puts its stuff there. I don't think it's a place we should necessary search automatically. I'm a little skeptical of some of the paths in there in general. Handling homebrew seems reasonable as it's pretty much de facto for Apple

tmp += [Path('/usr/local')]
tmp += [Path('/usr')]

Expand Down
5 changes: 4 additions & 1 deletion test cases/common/103 has header symbol/meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright © 2024 Intel Corporation

project(
'has header symbol',
'c', 'cpp',
default_options : ['cpp_std=c++11'],
default_options : ['cpp_std=c++14'],
)

cc = meson.get_compiler('c')
Expand Down
Loading