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

Fix CI with stricter meson-python #232

Merged
merged 3 commits into from
Apr 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 16 additions & 7 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@ set -ex

mkdir builddir

# need to run meson first for cross-compilation case
$PYTHON $(which meson) setup ${MESON_ARGS} \
-Dblas=blas \
-Dlapack=lapack \
-Duse-g77-abi=true \
builddir || (cat builddir/meson-logs/meson-log.txt && exit 1)
# HACK: extend $CONDA_PREFIX/meson_cross_file that's created in
# https://github.com/conda-forge/ctng-compiler-activation-feedstock/blob/main/recipe/activate-gcc.sh
# https://github.com/conda-forge/clang-compiler-activation-feedstock/blob/main/recipe/activate-clang.sh
# to use host python; requires that [binaries] section is last in meson_cross_file
echo "python = '${PREFIX}/bin/python'" >> ${CONDA_PREFIX}/meson_cross_file.txt

# meson-python already sets up a -Dbuildtype=release argument to meson, so
# we need to strip --buildtype out of MESON_ARGS or fail due to redundancy
MESON_ARGS_REDUCED="$(echo $MESON_ARGS | sed 's/--buildtype release //g')"
Copy link
Contributor

Choose a reason for hiding this comment

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

@h-vetinari do you think we could change MESON_ARGS to use -Dbuildtype instead? It is always documented like that (see https://mesonbuild.com/Builtin-options.html#details-for-buildtype) and is used a lot more than --buildtype if you look at the Meson issue tracker (in fact, it's hard to find --buildtype usage at all).

Copy link
Member Author

Choose a reason for hiding this comment

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

We are using -Dbuildtype; the line you commented on is stripping out the alternative formulation --buildtype.

Copy link
Member Author

Choose a reason for hiding this comment

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

But admittedly, that's the one coming from meson-python. We could change the spelling on the activation feedstock(s), that'd be fine by me.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that spelling change is what I meant. That will avoid having to use this hack in all feedstocks that use meson-python.


# -wnx flags mean: --wheel --no-isolation --skip-dependency-check
$PYTHON -m build -w -n -x -Cbuilddir=builddir
$PYTHON -m build -w -n -x \
-Cbuilddir=builddir \
-Csetup-args=-Dblas=blas \
-Csetup-args=-Dlapack=lapack \
-Csetup-args=-Duse-g77-abi=true \
-Csetup-args=${MESON_ARGS_REDUCED// / -Csetup-args=} \
|| (cat builddir/meson-logs/meson-log.txt && exit 1)
pip install dist/scipy*.whl