Skip to content

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.
header = f'{directory}/{header}'
inc = f'#include <{header}>\n__attribute__((weak)) int foo;\n'
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