-
Notifications
You must be signed in to change notification settings - Fork 160
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
Created OpenTelemetryApi
and OpenTelemetrySdk
podspecs
#591
Created OpenTelemetryApi
and OpenTelemetrySdk
podspecs
#591
Conversation
I pulled this into a project using this branch and pointing a local path to point to these podspecs Here's the Podfile target 'OtelTestApp' do
use_frameworks!
pod "OpenTelemetryApi", path: "../otel/opentelemetry-swift" # Relative path on local machine
pod "OpenTelemetrySdk", path: "../otel/opentelemetry-swift" # Relative path on local machine
end Works great for me, I think this is a good approach for those vendors who want to distribute via source on Cocoapods. |
@@ -0,0 +1,24 @@ | |||
Pod::Spec.new do |spec| | |||
spec.name = "OpenTelemetryApi" | |||
spec.version = "1.10.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to make sure these versions get bumped when performing releases. Would hope that could be automated in the existing release process.
Also realized another easy way to test is to point the Podfile directly to this branch: target 'OtelTestApp' do
use_frameworks!
pod "OpenTelemetryApi", :git => 'git@github.com:embrace-io/opentelemetry-swift.git', :branch => 'aridemarco/add-specs-for-cocoapods'
pod "OpenTelemetrySdk", :git => 'git@github.com:embrace-io/opentelemetry-swift.git', :branch => 'aridemarco/add-specs-for-cocoapods'
end |
I'm attempting to test these podspecs following your testing procedures, but I'm getting errors when cocoapods lints the spec when calling with error:
|
It seems to be an issue with the environment (failing to find a destination/simulator to run on for the test app that the
Edit: here's a link of an issue on Cocoapods explaining why this tends to happen |
@bryce-b can you confirm your issue is related to what @ArielDemarco mentions? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just waiting for @bryce-b confirmation for merging
Turns out it I was having issues with the simulators. I'm running the GA version of Xcode 16 right now and I'm having issues confirming it works due unsupported changes in the xcodeproj structure. |
Looks good to me! After merging, the next step is to push to cocoapods trunk? |
Exactly! Or automate the process with a worfklow. e.g. any time we tag we generate a cocoapods version associated to that tag. Edit: One thing to take into account is that the trunk must first be registered. This ensures that only authorized maintainers can push updates to the pod. If this hasn't been set up yet, it involves creating an account and getting authentication tokens from CocoaPods. Here's the setup process. I can help with the process if needed |
I'm still trying to sort out why the linux test job isn't passing. |
I merged yesterday a pr which had issues in Linux. I have fixed with a new merge this early morning, I have tried updating this pr with the latest changes from main, I don't know if it will work |
@ArielDemarco Please update with the lastest changes from main and the tests should pass. |
Seems that tests keep failing 🤔 |
This time it was iOS, retrying as we have some flaky tests |
Thanks a lot for your contribution. |
Description
The idea of this PR is to create the podspecs to distribute via
CocoaPods
:OpenTelemetryApi
OpenTelemetrySdk
Many of the decisions made in the podspecs were extracted from
Package@swift-5.9.swift
, for example:5.9
v13.0
v13.0
v6.0
Important
Versioning
Both podspecs should have the same version to work properly. Since
OpenTelemetrySdk
depends onOpenTelemetryApi
and they are closely linked, the version of the dependency in both podspecs must be identical.How to test this
Unfortunately, we cannot use the existing examples in the OTel repository. Ideally, we should test that integration with both Pods is achievable and that there are no compiling issues.
To achieve this, I've pushed those two podspecs to a private repo, created two private pods, and tested them in an app. Below are the steps to replicate this process:
Create the private Pods
Create a private git repository.
Clone the private repository locally
Copy both
OpenTelemetryApi.podspec
andOpenTelemetrySdk.podspec
in the cloned repository.Commit and push both podspecs into your main branch in your private repository.
Publish the Podspecs to your private CocoaPods repo:
We use
--allow-warnings
because the process might fail due to some "harmless" warnings, likeimmutable value 'xyz' was never used; consider replacing with '_' or removing it.
Now you can test the two new Pods in your project. However, keep two things in mind:
Here’s how your
Podfile
should look:Extra
To make
step 6
easier I created a script that sets up a sample project, adds the two pods as dependencies, imports them, and compiles. I've attached a zip file that contains the script. Run./test-opentelemetry-pods.sh -h
or./test-opentelemetry-pods.sh --help
to see how to use it. The script will install some dependencies to properly create an.xcodeproj
and use cocoapods (likebundler
andxcodegen
). It needs bothXcode
andHomebrew
to work correctly.test-opentelemetry-pods.sh.zip