-
Notifications
You must be signed in to change notification settings - Fork 119
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
Source-file-location fails on macOS, giving 'unknown' #291
Comments
Problem: - On macOS, with both g++9 homebrew and clang-9 MacPorts the UT tests all fail with `unknown`. Solution: - Fix detection of `source location` builtins. Use `__has_builtin` for clang based compilers. Enable it by default for GCC >= 9 (GCC HEAD has support for it). Disable it for MSVC which doesn't support these builtins yet.
Problem: - On macOS, with both g++9 homebrew and clang-9 MacPorts the UT tests all fail with `unknown`. Solution: - Fix detection of `source location` builtins. Use `__has_builtin` for clang based compilers. Enable it by default for GCC >= 9 (GCC HEAD has support for it). Disable it for MSVC which doesn't support these builtins yet.
Thanks, @claremacrae. It should be fixed by #293, would you please be able to check it 🤔 Thanks again 👍 |
Awesome! Thanks very much. Leave it with me... I've updated I'm getting compiler errors in our code - I think possibly because of warnings that ut turns on, though I'm not sure - so it'll take me a little while to fix them so I can check it... |
Hi @kris-jusiak Summary: It's improved, but not quite there yet! It gives filenames with clang now, but not quite yet with gcc. ut git commit id = bd458f1 With this config, my tests pass
With this config, I get filename = 'unknown'
|
hmm, the following should work now, I think 🤔
@claremacrae, can you check |
std::cout << "__GNUC__ " << __GNUC__ << '\n';
#if defined(__has_builtin)
std::cout << "has __has_builtin\n";
#else
std::cout << "NO __has_builtin\n";
#endif Writes out:
|
@kris-jusiak Is that what you meant? Thanks for looking at this... I need to head off now. If it helps, I'd be happy to pair on it, sharing screens... Wednesday, about 7pm UK time? |
Hi @kris-jusiak I'm unexpectedly free to pair for the next little while, if it helps - |
Thanks for looking in to this. I just checked again, and this config is still giving filename
Was this info I posted above any use? I'm happy to work together on it, if it would help - as what was recently a working set-up for me with Boost.UT now no longer works... Until then, I think it would be worth re-opening this ticket, please. |
…291 Problem: - `gcc-9.2.0_2` defines `__has_builtin` however `__has_builtin(__builtin_FILE)` returns 0. Solution: - Set `__has___builtin_FILE` and `__has___builtin_FILE` to 1 in case of GCC-9 although `__has_builtin` is defined.
Hi @claremacrae, sorry for the late response on this one. I believe that gcc 9.2.0_2 has a bug because both: gcc-9 (I guess versions after 9.2.0_2) and gcc-10 seem to work properly 🤔 Anyway, added a wknd for gcc-9 which should fix the issue 🙏 |
Hi @krzysztof-jusiak thanks very much for looking at this again! Really sorry to be the bearer of bad news, but I downloaded the bug-fix, and got this compiler output:
|
…291 Problem: - `gcc-9.2.0_2` defines `__has_builtin` however `__has_builtin(__builtin_FILE)` returns 0. Solution: - Set `__has___builtin_FILE` and `__has___builtin_FILE` to 1 in case of GCC-9 although `__has_builtin` is defined.
In case it helps, this is the revision that worked: 8004290 When I ignore white-space changes, there aren't many differences between that and the latest one... |
Thanks, @claremacrae, it's because APPLE defines
so Created another fix -> #296 🙏 |
Oh no, sorry you are having to chase your tail on this... That fixes gcc 9 - but I'm really very sad to report that it breaks clang 9:
|
(my line numbers are 1 higher than yours, as I add a comment in with the git id of the version I've copied in...) Do I need to just give up on the compiler versions I'm using and update them? It feels like UT is living on the bleeding edge and maybe only those happy with using the very newest shiny things will tend to try it out - as it seems to be only me reporting problems with older compilers! 😢 |
I've gotta go for today - thanks ever so much for your efforts! 😄 |
I'm committed to getting it working with gcc9 and apple. |
Awesome - it works on my gcc 9.2.0 and clang 9.0.1! 🎉 😄 Huge thanks for persisting with this @krzysztof-jusiak 🙏 |
This is the change I tested: 46a4f2e |
Fantastic, thanks, @claremacrae 🙏 |
Expected Behavior
The ApprovalTests.cpp UT integration tests pass with the latest version of this project on macOS.
This combination passes:
Actual Behavior
On macOS, with both g++9 homebrew and clang-9 MacPorts, using 515c080, the UT tests all fail with:
Steps to Reproduce the Problem
ApprovalTests.cpp/third_party/ut/include/boost/ut.hpp
UT_Tests
Specifications
It's failing for me with:
and
Likely cause
There are not many differences between 8004290 and 515c080
I suspect that the cause is this, as in both compiler cases,
__APPLE__
is defined:The text was updated successfully, but these errors were encountered: