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

BUG: Fix test_ccompiler_opt when path contains dots #18686

Merged
merged 1 commit into from
Mar 29, 2021

Conversation

mgorny
Copy link
Contributor

@mgorny mgorny commented Mar 28, 2021

Fix test_ccompiler_opt not to be confused by dots occurring on the path
to the temporary directory, by using only the source file's basename
when grabbing options. Otherwise, the test can fail with mismatches
such as:

E           AssertionError: 'sources_status' returns different targets than the compiled targets
E           ['AVX512F', 'AVX2'] != ['(20 2/TEMP/TMPB0YHSCAI/TEST_TARGETS AVX512F)', '(20 2/TEMP/TMPB0YHSCAI/TEST_TARGETS AVX2)']

This is because our TMPDIR value includes numpy version, i.e. 1.20.2.
The splitting happens on the first dot that is part of the directory
path rather than test filename.

Fix test_ccompiler_opt not to be confused by dots occurring on the path
to the temporary directory, by using only the source file's basename
when grabbing options.  Otherwise, the test can fail with mismatches
such as:

    E           AssertionError: 'sources_status' returns different targets than the compiled targets
    E           ['AVX512F', 'AVX2'] != ['(20 2/TEMP/TMPB0YHSCAI/TEST_TARGETS AVX512F)', '(20 2/TEMP/TMPB0YHSCAI/TEST_TARGETS AVX2)']

This is because our TMPDIR value includes numpy version, i.e. 1.20.2.
The splitting happens on the first dot that is part of the directory
path rather than test filename.
@mattip
Copy link
Member

mattip commented Mar 29, 2021

@seiko2plus thoughts?

Is there a better way to get the gtar feature than to fetch it from the file name?

@seiko2plus
Copy link
Member

@mattip,

Is there a better way to get the gtar feature than to fetch it from the file name?

No, the other way would be parsing the generated C header config of the dispatch-able source to get the generated targets.

Copy link
Member

@seiko2plus seiko2plus left a comment

Choose a reason for hiding this comment

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

Well done, Thank you!

@mattip mattip merged commit b6a1677 into numpy:main Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants