GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-96398: Improve accuracy of compiler checks in configure.ac by erlend-aasland · Pull Request #117815 · python/cpython

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented Apr 12, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Some checks require a GCC compatible compiler; use $ac_cv_gcc_compat for these.
Some checks require checking the compiler basename; use $CC_BASENAME for these.
For the rest, use $ac_cv_cc_name.

  • Issue: configure.ac: using $CC to check compiler names may result in erroneous judgements #96398

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@erlend-aasland
pythongh-96398: Consistently use $ac_cv_cc_name for compiler checks i…
4a55006
…n configure
@erlend-aasland
erlend-aasland requested a review from corona10 as a code owner April 12, 2024 12:21
@erlend-aasland erlend-aasland added the skip news label Apr 12, 2024
@bedevere-app bedevere-app Bot added the awaiting core review label Apr 12, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Apr 12, 2024
configure.ac: using $CC to check compiler names may result in erroneous judgements #96398
Closed
@erlend-aasland

erlend-aasland commented Apr 12, 2024

Copy link
Copy Markdown
Contributor Author

cc. @ronaldoussoren and @ned-deily

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland
erlend-aasland commented Apr 12, 2024
View reviewed changes
Comment thread configure.ac Resolved

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland added 2 commits April 12, 2024 15:09
@erlend-aasland
Bring back the mpicc
3e03fe4
@erlend-aasland
Detect emcc
2305a7b
@erlend-aasland

This comment was marked as outdated.

Sign in to view
@erlend-aasland
Pull in main
444b92d
@erlend-aasland
erlend-aasland marked this pull request as draft April 12, 2024 15:48
@bedevere-app bedevere-app Bot removed the awaiting core review label Apr 12, 2024
@erlend-aasland

erlend-aasland commented Apr 12, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

In order to solve the WASI error, I propose to introduce a "GCC compatible" check, and use that as a gate to the compiler flag checks.

UPDATE: proposed in #117825

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland erlend-aasland mentioned this pull request Apr 12, 2024
gh-96398: Detect GCC compatible compilers in configure #117825
Merged
erlend-aasland added 3 commits April 12, 2024 22:10
@erlend-aasland
pythongh-96398: Detect GCC compatible compilers in configure
1077ec3
Introduce a cached variable $ac_cv_gcc_compat and set it to 'yes' if
the C preprocessor defines the __GNUC__ macro.
@erlend-aasland
Use ac_cv_gcc_compat where possible
aeed46f
@erlend-aasland
Pull in main
cc3731f
@erlend-aasland erlend-aasland changed the title gh-96398: Consistently use $ac_cv_cc_name for compiler checks in configure gh-96398: Use $ac_cv_cc_name and $ac_cv_gcc_compat in configure compiler checks Apr 12, 2024
erlend-aasland added 3 commits April 12, 2024 22:30
@erlend-aasland
syntax
a614de5
@erlend-aasland
;;
c55d838
@erlend-aasland
regen ac
b249323
igalic

This comment was marked as resolved.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland

erlend-aasland commented Apr 13, 2024

Copy link
Copy Markdown
Contributor Author

I'm really happy you're taking this on! One inline question:

@igalic: I did not spot the question; did it get lost when you posted the comment?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland
Merge branch 'main' into autoconf/cc
00cb06c
@erlend-aasland

This comment was marked as outdated.

Sign in to view
corona10
corona10 reviewed Apr 13, 2024
View reviewed changes
Comment thread configure.ac Resolved

Uh oh!

There was an error while loading. Please reload this page.

@corona10

This comment was marked as resolved.

Sign in to view
@erlend-aasland
Merge branch 'main' into autoconf/cc
474d5f9
@igalic

igalic commented Apr 13, 2024

Copy link
Copy Markdown
Contributor

I'm really happy you're taking this on! One inline question:

@igalic: I did not spot the question; did it get lost when you posted the comment?

a less bleary eyed review reveals that I was reading the LTO code wrong. not sure why my question didn't post at all, tho

erlend-aasland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland
erlend-aasland marked this pull request as ready for review April 13, 2024 21:33
@bedevere-app bedevere-app Bot added the awaiting core review label Apr 13, 2024
@erlend-aasland erlend-aasland changed the title gh-96398: Use $ac_cv_cc_name and $ac_cv_gcc_compat in configure compiler checks gh-96398: More accurate compiler checks in configure.ac Apr 14, 2024
@erlend-aasland erlend-aasland changed the title gh-96398: More accurate compiler checks in configure.ac gh-96398: Improve accuracy of compiler checks in configure.ac Apr 14, 2024
@erlend-aasland
erlend-aasland requested a review from mhsmith April 15, 2024 21:22
mhsmith
mhsmith reviewed Apr 17, 2024
View reviewed changes
Comment thread configure.ac Outdated
Comment on lines +1046 to +1050
case "$CC_BASENAME" in
gcc) AC_PATH_TOOL([CXX], [g++], [g++], [notfound]) ;;
cc) AC_PATH_TOOL([CXX], [c++], [c++], [notfound]) ;;
clang|*/clang) AC_PATH_TOOL([CXX], [clang++], [clang++], [notfound]) ;;
icc|*/icc) AC_PATH_TOOL([CXX], [icpc], [icpc], [notfound]) ;;
clang) AC_PATH_TOOL([CXX], [clang++], [clang++], [notfound]) ;;
icc) AC_PATH_TOOL([CXX], [icpc], [icpc], [notfound]) ;;

@mhsmith mhsmith Apr 17, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This doesn't seem to correspond to the definition of AC_PATH_TOOL:

AC_PATH_TOOL (variable, prog-to-check-for, [value-if-not-found], [path = ‘$PATH’])

  • variable = CXX
  • prog-to-check-for = g++
  • value-if-not-found = g++ (?)
  • path = notfound (??)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mhsmith mhsmith Apr 17, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Also, CC_BASENAME may contain a platform triplet, so shouldn't this use ac_cv_cc_name instead?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@erlend-aasland erlend-aasland Oct 28, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Also, CC_BASENAME may contain a platform triplet, so shouldn't this use ac_cv_cc_name instead?

Yes, this should use ac_cv_cc_name, not CC_BASENAME.

This doesn't seem to correspond to the definition of AC_PATH_TOOL:

Indeed; I suggest we look at this in a separate PR.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@erlend-aasland erlend-aasland Oct 28, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Also, CC_BASENAME may contain a platform triplet, so shouldn't this use ac_cv_cc_name instead?

Addressed with 9900633.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mhsmith reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@freakboy3742

freakboy3742 commented Apr 18, 2024

Copy link
Copy Markdown
Contributor

FWIW: @mhsmith pinged me on this PR, because of the potential for clash with the iOS compiler shims (around L400 of configure.ac). I've confirmed that iOS builds still work with these changes.

erlend-aasland reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland
Pull in main
0df909e
@erlend-aasland erlend-aasland added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 14, 2024
@bedevere-bot

This comment was marked as outdated.

Sign in to view
@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 14, 2024
@erlend-aasland

erlend-aasland commented Oct 15, 2024

Copy link
Copy Markdown
Contributor Author

It seems there are refleaks on main. I'll wait for them to be resolved and do another buildbot run, just to make sure.

In the mean time, feel free to take another look, if needed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland
Merge branch 'main' into autoconf/cc
d309996
@erlend-aasland erlend-aasland added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 28, 2024
@bedevere-bot

bedevere-bot commented Oct 28, 2024

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit d309996 🤖

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 28, 2024
erlend-aasland added 2 commits October 28, 2024 23:06
@erlend-aasland
Pull in main
c6fa062
@erlend-aasland
Address Malcom's review
9900633
@erlend-aasland erlend-aasland added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 29, 2024
@bedevere-bot

bedevere-bot commented Oct 29, 2024

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit 9900633 🤖

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 29, 2024
@erlend-aasland

erlend-aasland commented Nov 5, 2024

Copy link
Copy Markdown
Contributor Author

Heads-up: I plan to merge this within a few days.

freakboy3742 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland erlend-aasland mentioned this pull request Nov 5, 2024
Upgrade to GNU Autoconf 2.72 #115765
Closed
2 tasks done
@erlend-aasland
erlend-aasland merged commit a5b94d0 into python:main Nov 7, 2024
@erlend-aasland
erlend-aasland deleted the autoconf/cc branch November 7, 2024 09:50
@bedevere-app bedevere-app Bot removed the awaiting core review label Nov 7, 2024
@erlend-aasland

erlend-aasland commented Nov 7, 2024

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing, everyone!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

picnixz pushed a commit to picnixz/cpython that referenced this pull request Dec 8, 2024
@erlend-aasland @picnixz
pythongh-96398: Improve accuracy of compiler checks in configure.ac (p…
205fe56
…ython#117815)

The following variables are now used in compiler checks:
- $ac_cv_gcc_compat is set to 'yes' for GCC compatible compilers
  (the C preprocessor defines the __GNUC__ macro)
- for compiler basename checks, use $CC_BASENAME
  (may contain platform triplets)
- for the rest, use $ac_cv_cc_name
  (does not contain platform triplets)
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
@erlend-aasland @ebonnal
pythongh-96398: Improve accuracy of compiler checks in configure.ac (p…
dbc3143
…ython#117815)

The following variables are now used in compiler checks:
- $ac_cv_gcc_compat is set to 'yes' for GCC compatible compilers
  (the C preprocessor defines the __GNUC__ macro)
- for compiler basename checks, use $CC_BASENAME
  (may contain platform triplets)
- for the rest, use $ac_cv_cc_name
  (does not contain platform triplets)
@encukou encukou mentioned this pull request Oct 15, 2026
Flaky detection of compiler vendor #83142
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mhsmith mhsmith mhsmith left review comments
@corona10 corona10 corona10 left review comments
@ned-deily ned-deily ned-deily left review comments
+1 more reviewer
@igalic igalic igalic left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@erlend-aasland @corona10 @igalic @freakboy3742 @bedevere-bot @mhsmith @ned-deily
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.