-
Notifications
You must be signed in to change notification settings - Fork 194
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
fix: Allow compilation with code coverage enabled for XCode/SPM projects #398
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lalunamel
changed the title
Compile with code coverage enabled
fix: Allow compilation with code coverage enabled for XCode/SPM projects
Apr 25, 2022
When building Amplitude as a Swift Package Manager dependency for an XCode project with code coverage enabled (https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/testing_with_xcode/chapters/07-code_coverage.html), the build fails. It fails with an error ``` Undefined symbols for architecture x86_64: "___llvm_profile_runtime", referenced from: ___llvm_profile_runtime_user in Amplitude.o ``` You can resolve this error by passing the `-fprofile-instr-generate` flag to clang (https://clang.llvm.org/docs/SourceBasedCodeCoverage.html). Unfortunately, this flag must be passed to the Amplitude dependency directly (rather than being applied to the project that relies on Amplitude, e.g.) That is what this commit does.
qingzhuozhen
approved these changes
Apr 26, 2022
justin-fiedler
approved these changes
Apr 28, 2022
🎉 This PR is included in version 8.10.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
liuyang1520
added a commit
that referenced
this pull request
Jun 21, 2022
This reverts commit 55ee555.
1 task
liuyang1520
added a commit
that referenced
this pull request
Jun 21, 2022
junjie
added a commit
to junjie/Amplitude-iOS
that referenced
this pull request
Sep 6, 2022
…entify-object * commit 'f07749967fb8e628f9f2c743fab2ba6600574d85': chore(release): 8.12.0 [skip ci] feat: expose more function signature for logEvent (amplitude#409) chore: use the reusable workflow to create jira issue (amplitude#408) chore(release): 8.11.1 [skip ci] fix: turn requiringSecureCoding on, adjust the available version (amplitude#407) chore(release): 8.11.0 [skip ci] fix: deprecation fix (amplitude#404) feat: add EU SSL pinning cert, extent it to support multiple domains (amplitude#403) chore(release): 8.10.2 [skip ci] Revert "Compile with code coverage enabled (amplitude#398)" (amplitude#402) chore(release): 8.10.1 [skip ci] fix: wrong carrier info with deprecated method (amplitude#400) Compile with code coverage enabled (amplitude#398) chore(release): 8.10.0 [skip ci] feat: Add versionId to tracking plan data (amplitude#392) chore(release): 8.9.0 [skip ci] fix: fix release action Update Podfile.lock feat: Add support on Swift Package Manager for WatchOS (amplitude#381) docs: add Ampli SDK reference (amplitude#385) # Conflicts: # Sources/Amplitude/AMPURLSession.m
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
When building Amplitude as a Swift Package Manager dependency
for an XCode project with code coverage enabled
(https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/testing_with_xcode/chapters/07-code_coverage.html),
the build fails.
It fails with an error
You can resolve this error by passing the
-fprofile-instr-generate
flagto clang (https://clang.llvm.org/docs/SourceBasedCodeCoverage.html).
Unfortunately, this flag must be passed to the Amplitude dependency directly
(rather than being applied to the project that relies on Amplitude, e.g.)
That is what this PR does.
Checklist