Skip to content

Conversation

@mkoeppe
Copy link
Contributor

@mkoeppe mkoeppe commented Mar 11, 2023

When ARCHFLAGS is set to the empty string, meson-python breaks; see sagemath/sage#35082 (comment)

mkoeppe added a commit to mkoeppe/sage that referenced this pull request Mar 11, 2023
@dnicolodi
Copy link
Member

We don't really validate the content of $ARCHFLAGS before trying to interpret it. There are probably many ways in which the environmental variable can be set to break meson-python. I'm not sure we should try too hard to handle setting the environmental variable to arbitrary values, especially considering that this is a legacy interface. I'm tempted to say that if setting $ARCHFLAGS to an empty string breaks meson-python, well, don't do that. I don't see any reason why having this environmental variable set to the empty string makes much sense. However, the fix is simple enough that we can just apply it.

@FFY00
Copy link
Member

FFY00 commented Mar 11, 2023

I think the main argument for this is that in most shells you can't easily unset an environment variable for a command, so it's common practice to interpret empty variables the same way as the variable being unset.

@dnicolodi dnicolodi merged commit 7e37525 into mesonbuild:main Mar 11, 2023
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 11, 2023

I don't see any reason why having this environmental variable set to the empty string makes much sense.

We are using this particular setting, for example, to work around some problems with Perl packages. https://github.com/sagemath/sage/blob/develop/build/pkgs/perl_term_readline_gnu/spkg-install.in#L10

@mkoeppe mkoeppe deleted the ARCHFLAGS_empty branch March 11, 2023 20:31
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