Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

_has_include() breaks TBB compilation when other software have <version> files in include search path #1518

Open
per-mathisen-arm opened this issue Sep 20, 2024 · 1 comment
Assignees
Labels

Comments

@per-mathisen-arm
Copy link

Summary

Recently TBB added a conditional include of the file <version> at https://github.com/oneapi-src/oneTBB/blob/master/include/oneapi/tbb/detail/_config.h#L31 from commit 4cc1cca

This means that if any app that uses TBB itself has a file called <version> in its include path, or one of its other dependencies has this, then it will include this other file and most likely break compilation - or worse, succeed but include the wrong code.

I encountered this issue compiling an app that uses jsoncpp with tbb, and jsoncpp happens to have its own <version> file in its include path which breaks tbb compilation.

Version

Bundled version in Ubuntu 24.04.1 and also OneAPI git master branch.

Environment

N/A

Observed Behavior

Broken compilation

Expected Behavior

Successful compilation

Steps To Reproduce

You could try to compile https://github.com/arm-software/lavatube on Ubuntu 24.04.1

Recommended action: Add additional search paths to _has_include to prevent accidental includes of other <version> files.

@kboyarinov kboyarinov self-assigned this Sep 20, 2024
@kboyarinov
Copy link
Contributor

@per-mathisen-arm, thanks for submitting this issue.

Since <version> is a C++ Standard Library header, having another <version> in the users include path results in undefined behavior. It can also break the C++ Standard Library itself in the same manner as it breaks TBB. We can still do something on the TBB side to improve user experience in that regard. By the way, which sources of jsoncpp did you use? I have checked this repo and there is no <version> header there, only the version.h which should be included as <json/version.h> and adding jsoncpp/include into the include path.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants