Skip to content
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

Missing Include in SamplingProfiler #2678

Closed
thekief opened this issue Feb 2, 2023 · 2 comments · Fixed by #2683
Closed

Missing Include in SamplingProfiler #2678

thekief opened this issue Feb 2, 2023 · 2 comments · Fixed by #2683

Comments

@thekief
Copy link

thekief commented Feb 2, 2023

Platform

iOS

Installed

Swift Package Manager

Version

7.31.3

Steps to Reproduce

  1. use a self-built nightly toolchain of swift
  2. have a project that includes sentry-cocoa
  3. build the project

Expected Result

The project builds without any problems.

Actual Result

The project does not properly build and following error is printed:

/Users/builder/Library/Developer/Xcode/DerivedData/test_app-gqrwiwirbosixfekearlrdjcqwng/SourcePackages/checkouts/sentry-cocoa/Sources/Sentry/include/SentrySamplingProfiler.hpp:67:14: error:
      missing '#include "/Library/Developer/Toolchains/swift-LOCAL-2023-02-01-a.xctoolchain/usr/bin/../include/c++/v1/atomic"';
      'atomic_uint64_t' must be declared before it is used
        std::atomic_uint64_t numSamples_;
             ^
In module 'std' imported from /Users/builder/Library/Developer/Xcode/DerivedData/test_app-gqrwiwirbosixfekearlrdjcqwng/SourcePackages/checkouts/sentry-cocoa/Sources/Sentry/include/SentrySamplingProfiler.hpp:7:
/Library/Developer/Toolchains/swift-LOCAL-2023-02-01-a.xctoolchain/usr/bin/../include/c++/v1/atomic:2651:26: note:
      declaration here is not visible
typedef atomic<uint64_t> atomic_uint64_t;
                         ^
1 error generated.

Are you willing to submit a PR?

Yes

@philipphofmann
Copy link
Member

@armcknight, could you please have a look at this one ⬆️ ?

@thekief
Copy link
Author

thekief commented Feb 5, 2023

I just re-tested it with the release/5.8 branch of Swift (commit bc62e307899) and the associated sub-projects and it seems to be fine now. The problem stemmed from including the include folder of the snapshot version to search for headers instead of using the default one.

Either way, I am not sure if this issue should be closed. I think it still be good that an explicit #include <atomic> is added rather than relying on the standard library to hopefully include it somewhere else.

philipphofmann added a commit that referenced this issue Feb 7, 2023
Add missing atomic import for SentryProfilingConditionals as for some
nightly Swift versions the project didn't compile.

Fixes GH-2678
@philipphofmann philipphofmann self-assigned this Feb 7, 2023
philipphofmann added a commit that referenced this issue Feb 8, 2023
Add missing atomic import for SentryProfilingConditionals as for some
nightly Swift versions the project didn't compile.

Fixes GH-2678
@github-project-automation github-project-automation bot moved this from Needs Review to Done in Mobile & Cross Platform SDK Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants