D97015 didn't correctly update generate_feature_test_macro_components.py.
Details
- Reviewers
ldionne EricWF • Quuxplusone Mordante - Group Reviewers
Restricted Project - Commits
- rG580416d573b6: [libcxx] updates the feature-test macro generator
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Assuming you've verified that (after this patch) running utils/generate_feature_test_macro_components.py produces no git diffs, where (before this patch) it used to produce diffs, I'd assume this patch is good to go. Maybe one of the other newly minted libc++ approvers can give it the libc++ stamp of approval. :)
PTAL again.
Maybe one of the other newly minted libc++ approvers can give it the libc++ stamp of approval. :)
Yes please! I didn't see @ldionne's email till after I put this up.
libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp | ||
---|---|---|
4116 | This (and elsewhere) feels wrong to me. |
Maybe one of the other newly minted libc++ approvers can give it the libc++ stamp of approval. :)
Yes please! I didn't see @ldionne's email till after I put this up.
I can :-) LGTM.
libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp | ||
---|---|---|
4116 | It looks odd, but it's correct. It has been added in D82171 since the it broke some build bots. The header contains the __floating_point concept. (the std:: added in that patch is no longer there.) |
libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp | ||
---|---|---|
4116 | I guess you mean the phrasing of the error message itself, right? Yes but I wouldn't worry about it. :) As for the fact that <numbers> depends on <concepts> in the first place, wow, yeah, that is unfortunate; but I've checked that it is physically accurate: <numbers> does start with the line #if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) which does literally mean that if the compiler doesn't support concepts then you can't use std::pi. |
Waaaait a minute. @cjdb I think you wrote !defined in the script when you meant defined. Could you check that, please, and fix, and regenerate, before pushing? But I don't think you need to repost and re-wait for review; let's just get main back in a consistent state already.
[EDIT: Wait x2, now I think I was wrong and !defined is correct, because it's asking if No Concepts is not defined. Anyway, I stand by my last sentence above: let's ship it already, as long as it gets the headers/tests back in sync with the generator.]
I would also love to see us adding a test that re-generating the feature test macros (and the headers tests too while we're at it) produces no output. That would allow catching these mistakes earlier in the future.
libcxx/utils/generate_feature_test_macro_components.py | ||
---|---|---|
425–426 | Here, I think you mean: "depends": "defined(__cpp_concepts) && __cpp_concepts >= 201907L", "internal_depends": "!defined(_LIBCPP_HAS_NO_CONCEPTS)", The way I understand it, internal_depends is for macro dependencies for libc++ itself, and depends is for macro dependencies of the test suite. |
libcxx/utils/generate_feature_test_macro_components.py | ||
---|---|---|
425–426 | I agree with your understanding; my source-diving suggested to me that these fields should really be named depends->libcxx_test_depends and internal_depends->version_header_depends respectively. I'd be willing to submit that mechanical patch, after this one lands in some form. No opinion on whether <version> should be testing _LIBCPP_HAS_NO_CONCEPTS or __cpp_lib_concepts directly. |
So are we addressing issues pre-merge or post-merge? A bit confused on this one, sorry.
So are we addressing issues pre-merge or post-merge? A bit confused on this one, sorry.
For me personally the priority is to get the generated content back in sync with the generator script one way or another. I am almost at the point of just running the generator script myself and pushing that diff without review, but I feel like that would be antisocial. ;P But be aware that anyone who pushes any other change to libcxx (e.g. implementing some other feature macro) will probably re-run the script and push the diff without noticing that they're doing so. So it's gonna get back in sync somehow, with or without this PR.
It sounds like @ldionne wants to get to the bottom of the "depends/internal_depends" stuff badly enough to mark this "request changes," plus it's @ldionne, so obviously I'll defer to him.
"Request changes", to me, strongly implies "please address this issue pre-merge." (If Louis didn't mean that, he should say so.)
libcxx/utils/generate_feature_test_macro_components.py | ||
---|---|---|
425–426 | I had a quick look at it and I think @ldionne's proposal is better. I think it would be good to have a look at this script and improve the naming and also improve the documentation at https://libcxx.llvm.org/docs/DesignDocs/FeatureTestMacros.html. I also noticed a lit_markup in the script, this seems quite useful to disable all tests using concepts when the compiler doesn't support it. I'll have a closer look later. |
My ask was to change to
"depends": "defined(__cpp_concepts) && __cpp_concepts >= 201907L", "internal_depends": "!defined(_LIBCPP_HAS_NO_CONCEPTS)",
since that's what we really mean. The other feedback about the depends + internal_depends naming is something we can (and should) address separately. Ship it once you've applied the changes explained just above.
Sorry about the lack of clarity in my review yesterday. I tried reviewing a lot of stuff before going OOO for an extended period of time and I think I went a little bit too fast. I should have explained better.
This (and elsewhere) feels wrong to me.