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 the -E flag (preprocess only) in test_standalone_system_headers #22815

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dschuff
Copy link
Member

@dschuff dschuff commented Oct 30, 2024

This test only checks header inclusion, so it doesn't need to link or even compile. This change makes this (still slow) test 5x faster.

This test only checks header inclusion, so it doesn't need to link
or even compile. This change makes this (still slow) test 5x faster.
@@ -9365,12 +9365,12 @@ def test_standalone_system_headers(self):
if cxx_only:
create_file('a.cxx', inc)
Copy link
Member Author

Choose a reason for hiding this comment

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

why does this test do the inclusion twice in 2 different files?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess so that we know the headers don't define global symbols (that would then cause link failures when two objects contain the same symbol). This change would obviously break that check, but I'm not sure how valuable it actually is.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah right. In that case we can make the test even faster by including each file only once. Or just close this PR and keep the test as it is. I just noticed that the test was taking more than 300s and wondered why it was so slow.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it might be reasonable to skip the double compilation + linking.

It looks like this was originally added in c3c9b6e, but it does seems like maybe overkill.

@dschuff dschuff requested a review from sbc100 October 30, 2024 18:07
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.

2 participants