-
Notifications
You must be signed in to change notification settings - Fork 160
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
Remove usage of __has_include #561
base: main
Are you sure you want to change the base?
Conversation
…d to have a (possibly-empty) config.h
Unsurprisingly, this breaks windows where indeed, our CI does not generate a config.h (it should!). |
I'd suggest removing the CI. There's no point in trying to keep this broken build system around. |
I think there is still some benefit to this, namely that we check that the C code generated by krml is syntactically correct for MSVC, so I'd like to keep this if we can. It's better than nothing, until we have more comprehensive Windows CI. |
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.
Thanks!
It appears to work fine on Windows as well: https://github.com/cryspen/hacl-packages/actions/runs/2581290156
Thanks, I needed a couple more tweaks, hopefully this time is the right time. |
So now The CI scripts have been updated to reflect this. |
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.
lgtm, but some changes in gcc-compatible look unrelated?
Yeah that's because the nightly job for refreshing dist/ isn't running yet. So this PR contains a refresh of dist/ as well. Currently blocked on a review, then I'll merge this. |
If you don't mind, I will first check that the modification does not break anything in our code :) |
Thanks, if this looks good for you on Monday, please go ahead and merge (I'll be off on vacation). |
as promised, I am back. It seems that everything works, but I would like to take more time to look at it. |
@Frosne can you confirm this looks good for you? I think we've pretty much committed to always having config.h now (even if it's hand-written), so __has_include can go I think. |
IIUC, we (dist/mozilla) also should have a config.h file? Could we have it empty? |
I would prefer not to have any predefined values there, because we do it in our build system. |
Ok. Until now there was a config.h under version control for you guys, in dist/mozilla. Are you saying you're ok to remove dist/mozilla/config.h? |
We do not use it, so yes, I think it is ok :) |
@franziskuskiefer reported that our usage of
__has_include
was yet one more oddity that made support across compiler versions difficult.I believe this used to be a an issue but with a recent change from Natalia, there is now a preprocessor guard that doesn't trigger __has_include unless we know we have it.
But simplifying this logic is good, and so I would like to remove our usage of __has_include. (There is one left for debugging purposes in libintvector.h that I believe is innocuous.)
There would need to be further changes, for instance:
Therefore, I'm leaving this as a draft PR for further discussion.