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 CFLAGS if set as-is, match CXXFLAGS behavior #322

Merged
merged 2 commits into from
Dec 27, 2024
Merged

Conversation

thesamesam
Copy link
Contributor

Since 2c93711, CXXFLAGS is used as-is if set in the envionment rather than clobbered by whatever CPython happened to be built with.

Do the same for CFLAGS: use it as-is if set in the environment, don't prepend CPython's saved flags.

Fixes: #299

Since 2c93711, CXXFLAGS is used
as-is if set in the envionment rather than clobbered by whatever
CPython happened to be built with.

Do the same for CFLAGS: use it as-is if set in the environment, don't
prepend CPython's saved flags.

Fixes: pypa#299
@jaraco
Copy link
Member

jaraco commented Dec 27, 2024

That's weird - I'm using the "new merge experience", and it wasn't running the checks for the PR, even after force-pushing the changes after rebasing to main (I didn't want the other commit in there) and pushing a nitpicky linter fix. I had to go to the actions and manually approve the PR there. I guess the new merge experience still needs some work.

Edit: I see now it's a known issue.

@jaraco jaraco merged commit c97a3db into pypa:main Dec 27, 2024
20 checks passed
@thesamesam
Copy link
Contributor Author

Thanks @jaraco! (I haven't yet used the new merge experience, sounds like it's a good thing I've left it...)

@thesamesam thesamesam deleted the cflags branch December 27, 2024 03:07
Comment on lines +343 to 344
cflags = os.environ.get('CFLAGS', cflags)
cflags = _add_flags(cflags, 'C')
Copy link

Choose a reason for hiding this comment

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

Hi, I am a bit confused why you are keeping the _add_flags(cflags, 'C') line, CXX doesn't have it (should it?), and it seems redundant (probably duplicates those flags, although I didn't test)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, you're right, I'd left it in because I tried something else, and forgot to clean it up. I'll do that in a followup after testing it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, submitted #325. Sorry for the oversight.

thesamesam added a commit to thesamesam/distutils that referenced this pull request Dec 28, 2024
Followup to af7fcbb. I accidentally
left that in when trying two approaches.

Reported at pypa#322 (comment).
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.

CXXFLAGS overrides default flags, CFLAGS doesn't
3 participants