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

cmake/common: Add language map entry for nasm #13864

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

res2k
Copy link
Contributor

@res2k res2k commented Nov 4, 2024

When determining the CMake compilers state, a CMakeLists.txt with these languages would be written:
project(CompInfo C NASM CXX)
Unfortunately, NASM isn't a CMake language. But ASM_NASM is - so map to that.

@res2k res2k requested a review from mensinda as a code owner November 4, 2024 11:29
@res2k
Copy link
Contributor Author

res2k commented Nov 7, 2024

@mensinda, you have been assigned as a reviewer, so I hope you don't mind a question 😅

So first, the symptom this change wants to address is the warning "CMake Toolchain: Failed to determine CMake compilers state" being emitted, in certain circumstances where a subproject uses nasm sources.

Now I'd like to add a test that triggers the circumstances of the warning.
But what I'm struggling with: how to check for a warning being not emitted?
My first instinct would be using --fatal-meson-warnings, so the warning results in a failure; however, this only seems to be set for "warning" tests... and those generally seem to check for presence of some warning, not the absence.

So... do you happen to have any advice on how to approach this?

@dcbaker
Copy link
Member

dcbaker commented Nov 7, 2024

@res2k I don't know if mensinda will answer, they haven't been around for a while.

What you likely want to do is use a test.json, which has a field for looking for specific output from the meson setup command.

@dcbaker dcbaker added the module:cmake Issues related to the cmake module, including cmake.subproject label Nov 7, 2024
@res2k
Copy link
Contributor Author

res2k commented Nov 7, 2024

@dcbaker, thanks for chipping in.

I noticed you could check for the presence of some specific line in the output -
But I actually the opposite, check for absence.

Ie, fail case - the specific warning is emitted; success case - the specific warning is not emitted.

So I wonder if there's a way to do that with the current system ...

@dcbaker
Copy link
Member

dcbaker commented Nov 7, 2024

There is a way to search for a regex, I bet there's a way in python re to invert the condition?

@res2k
Copy link
Contributor Author

res2k commented Nov 7, 2024

There is a way to search for a regex, I bet there's a way in python re to invert the condition?

Actually, I noticed that there's apparently a way to check some output line occurs zero times, which seems to be what I want :)
Will give it a try.

@res2k
Copy link
Contributor Author

res2k commented Nov 9, 2024

@dcbaker, I managed to cobble together a test case that does what I want: produces "Failed to determine CMake compilers state" (and fails due to that) without the language map changes, but works warning-less with the latter change.
If you find some time to look at it, let me know what you think!

Copy link
Member

@dcbaker dcbaker left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for adding this and the test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:cmake Issues related to the cmake module, including cmake.subproject
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants