Skip to content

Conversation

luke-jr
Copy link
Member

@luke-jr luke-jr commented Mar 21, 2022

The regex includes [/ ] which is supposed to match either a forward slash or a space, but m4 treats the brackets as special characters and effectively strips them out, leading to -isystem /usr/include paths except for in the typical scenario where it is the final parameter in the flag string.

…rackets

The regex includes [/ ] which is supposed to match either a forward slash or a
space, but m4 treats the brackets as special characters and effectively strips
them out, leading to -isystem /usr/include paths except for in the typical
scenario where it is the final parameter in the flag string.
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.

Tested this PR rebased on master on Ubuntu 22.04:

$ ./configure --quiet --with-incompatible-bdb --enable-suppress-external-warnings CC=clang CXX=clang++
$ make
... massive Qt warnings

@hebasto
Copy link
Member

hebasto commented Mar 22, 2022

cc @vasild

@hebasto
Copy link
Member

hebasto commented Mar 22, 2022

Tested 556ee6f. Still not working for me.

Actually, my idea was to substitute paths like /usr/include/some-path but not /usr/include.

Btw, is there a decent reason why the base commit is so old?

@luke-jr
Copy link
Member Author

luke-jr commented Mar 22, 2022

Tested 556ee6f. Still #24633 (review) for me.

That's the original version... test the new one? (5a157eb)

Actually, my idea was to substitute paths like /usr/include/some-path but not /usr/include.

The current PR code should do that (allowing for trailing slash(es) on the end).

@luke-jr luke-jr requested a review from hebasto March 22, 2022 17:57
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 5a157eb, tested on Ubuntu 22.04 with clang 14.0.

@fanquake fanquake requested a review from vasild March 23, 2022 14:05
@vasild
Copy link
Contributor

vasild commented Mar 28, 2022

I merged this (5a157eb) on latest master (0a14a16) and it does not break anything: warnings from QT appear without --enable-suppress-external-warnings and are silenced when that option is used (FreeBSD, clang 14). All good.

How to reproduce the problem this PR aims to solve?

Why is the commit Bugfix: configure: Only avoid -isystem for exact /usr/include path necessary? Do we have a case where -I/usr/include/foo is used and it is not replaced by -isystem /usr/include/foo and warnings popped up from there?

I am not sure whether the CI failure is related to this PR or not.

@luke-jr
Copy link
Member Author

luke-jr commented Mar 29, 2022

How to reproduce the problem this PR aims to solve?

I encountered it trying to test #24558 with --enable-suppress-external-warnings

Why is the commit Bugfix: configure: Only avoid -isystem for exact /usr/include path necessary?

Otherwise we get warnings from Qt includes I guess. #24633 (review)

Copy link
Contributor

@vasild vasild left a comment

Choose a reason for hiding this comment

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

ACK 5a157eb

I checked that, without this PR, the generated ./configure ends up with ...include(/ |$) instead of the intended ...include([/ ]|$). To reproduce, I used BDB_CFLAGS="-I/usr/include -I/foo" in the ./configure environment and it was changed to -isystem /usr/include -isystem /foo (wrong). This PR fixes that.

Subdirectories of /usr/include should be with -isystem since e.g. Qt may be installed in /usr/include/qt5. Having -isystem /usr/include/whatever is fine with gcc's #include_next.

Thank you!

@fanquake fanquake merged commit 7c72eab into bitcoin:master Mar 29, 2022
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Apr 3, 2022
…ciently to preserve brackets

5a157eb Bugfix: configure: Only avoid -isystem for exact /usr/include path (Luke Dashjr)
556ee6f Bugfix: configure: Quote SUPPRESS_WARNINGS sufficiently to preserve brackets (Luke Dashjr)

Pull request description:

  The regex includes `[/ ]` which is supposed to match either a forward slash or a space, but m4 treats the brackets as special characters and effectively strips them out, leading to -isystem /usr/include paths except for in the typical scenario where it is the final parameter in the flag string.

ACKs for top commit:
  hebasto:
    ACK 5a157eb, tested on Ubuntu 22.04 with clang 14.0.
  vasild:
    ACK 5a157eb

Tree-SHA512: 5c8c282b647b7853b8fad1b5b473703c4a0635073d2685a8ac984151046e2c6a859e6972465419d27356dd29a47f21a2a3a6ad402ec434fe1f9882e5a35f0749
@bitcoin bitcoin locked and limited conversation to collaborators Mar 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants