Skip to content

Conversation

fanquake
Copy link
Member

@fanquake fanquake commented Apr 3, 2023

Follow up to #27311 (comment), as IWYU now has a clang_16 branch.

This also removes some workarounds for (now fixed) clang-tidy issues, and simplifies the IWYU install steps.

@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 3, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK hebasto, MarcoFalke, josibake

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #27340 (ci: Use Cirrus CI dockerfile env by MarcoFalke)
  • #25797 (build: Add CMake-based build system by hebasto)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@DrahtBot DrahtBot added the Tests label Apr 3, 2023
@fanquake fanquake force-pushed the clang_16_tidy_task branch from 17ffddf to f2915fe Compare April 3, 2023 11:11
@hebasto
Copy link
Member

hebasto commented Apr 3, 2023

Concept ACK.

@fanquake
Copy link
Member Author

fanquake commented Apr 3, 2023

Note that even though the CI here is "green", the tidy task has failed:

In file included from common/url.cpp:5:
In file included from ./common/url.h:8:
In file included from /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/string:40:
In file included from /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/char_traits.h:39:
In file included from /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/postypes.h:40:
In file included from /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/cwchar:44:
/usr/include/wchar.h:35:10: fatal error: 'stddef.h' file not found
#include <stddef.h>
         ^~~~~~~~~~

@hebasto
Copy link
Member

hebasto commented Apr 4, 2023

FWIW, on a local Ubuntu 23.04 installation, I have no issues with running the IWYU tool manually.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

/usr/include/wchar.h:35:10: fatal error: 'stddef.h' file not found
#include <stddef.h>
         ^~~~~~~~~~

This error can be fixed with the following diff:

--- a/ci/test/00_setup_env_native_tidy.sh
+++ b/ci/test/00_setup_env_native_tidy.sh
@@ -15,5 +15,5 @@ export RUN_FUNCTIONAL_TESTS=false
 export RUN_FUZZ_TESTS=false
 export RUN_TIDY=true
 export GOAL="install"
-export BITCOIN_CONFIG="CC=clang-16 CXX=clang++-16 --with-incompatible-bdb --disable-hardening CFLAGS='-O0 -g0' CXXFLAGS='-O0 -g0'"
+export BITCOIN_CONFIG="CC=clang-16 CXX=clang++-16 --with-incompatible-bdb --disable-hardening CFLAGS='-O0 -g0' CXXFLAGS='-O0 -g0 -I/usr/lib/llvm-16/lib/clang/16/include'"
 export CCACHE_SIZE=200M

See: https://cirrus-ci.com/task/5852229609979904

Some related discussion see in include-what-you-use/include-what-you-use#679.


Note that even though the CI here is "green", the tidy task has failed

#26763 is somewhat related.

@maflcko
Copy link
Member

maflcko commented Apr 4, 2023

This error can be fixed with the following diff:

I wonder if another workaround would be to use libc++, but I haven't checked if the iwyu output is better or worse with libc++.

@maflcko
Copy link
Member

maflcko commented Apr 5, 2023

Also #25466 (comment)

@fanquake fanquake force-pushed the clang_16_tidy_task branch from c85da4c to a56c965 Compare April 5, 2023 10:48
@fanquake
Copy link
Member Author

fanquake commented Apr 5, 2023

-I/usr/lib/llvm-16/lib/clang/16/include

Included this. I think we could merge this as-is, but should also figure out why it's needed. It feels like there is another issue here.

Also #25466 (comment)

Removed the related suppressions.

@fanquake fanquake marked this pull request as ready for review April 5, 2023 10:49
Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

ACK a56c965

@maflcko
Copy link
Member

maflcko commented Apr 5, 2023

lgtm ACK a56c965

@josibake
Copy link
Member

josibake commented Apr 5, 2023

ACK a56c965

Included this. I think we could merge this as-is, but should also figure out why it's needed. It feels like there is another issue here.

did a little digging and found this: include-what-you-use/include-what-you-use#679 (comment) , which seems to still be an issue based on the discussion in the linked solution. fwiw, the fix you have here seems to be one of the preferred ways of dealing with this

@fanquake fanquake merged commit 0459548 into bitcoin:master Apr 5, 2023
@fanquake fanquake deleted the clang_16_tidy_task branch April 5, 2023 13:04
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Apr 5, 2023
@bitcoin bitcoin locked and limited conversation to collaborators Apr 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants