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

Use more standard form of release flag in MESON_ARGS #98

Closed
wants to merge 3 commits into from

Conversation

h-vetinari
Copy link
Member

There are two different ways to set up a release flag to meson, --buildtype release, and -Dbuildtype=release. Apparently the latter is more common; at least it's the recommended way in the docs.

Since meson-python will by default add -Dbuildtype=release, the fact that the compiler-activation does the other kind leads to a duplicate specification and forces us to strip it out again as follows (e.g. in scipy, but affects all feedstocks using meson-python).

# 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')"

To avoid this, use the more common form of the flag.

PS. Stumbled over this old PR, where this was discussed with @rgommers
PPS. Sister PR of conda-forge/clang-compiler-activation-feedstock#112

@conda-forge-webservices
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@isuruf
Copy link
Member

isuruf commented Sep 28, 2023

This might break packages that does the opposite. So, it's not clear which one is better.

@h-vetinari
Copy link
Member Author

h-vetinari commented Sep 28, 2023

This might break packages that does the opposite.

That's clear, though I think it'd be good to decide on one and try to be consistent.

So, it's not clear which one is better.

Given that meson-python uses -Dbuildtype (not only the conda-forge version, but built-in upstream), and that the meson docs use this variant too, I think the balance tilts towards that.

@rgommers
Copy link

Given that meson-python uses -Dbuildtype (not only the conda-forge version, but built-in upstream), and that the meson docs use this variant too, I think the balance tilts towards that.

I agree. This change is known to avoid a bunch of argparsing complexity. It is right for all Python packages. In case there are non-Python packages that have an explicit --buildtype=release in their build.sh script in conda-forge, you'll get a clear error:

ERROR: Got argument buildtype as both -Dbuildtype and --buildtype. Pick one.

You'll fix that once, which is a simple 1-line diff, and does not require argument parsing.

meson-python isn't only relevant here because it's getting more popular, but because it's an intermediate layer that adds the incompatible flag. Such a layer does not exist for other languages, so there isn't the opposite problem if we make the switch here to using -Dbuildtype.

@h-vetinari
Copy link
Member Author

I'm adapting the changes discussed on the clang side into #121

@h-vetinari h-vetinari mentioned this pull request Jul 11, 2024
@isuruf isuruf closed this in #121 Jul 16, 2024
@h-vetinari h-vetinari deleted the meson branch July 16, 2024 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants