fix: use repo-root-relative paths in Swift podspec#737
Conversation
source_files and license file paths in a podspec are resolved relative to the repo root (defined by s.source), not relative to the podspec file location. The existing paths only worked for local pod references and broke on `pod trunk push`. - source_files: Sources/**/*.swift -> mParticle-Apple-SDK-Swift/Sources/**/*.swift - license file: ../LICENSE -> LICENSE
PR SummaryMedium Risk Overview Updates CI/release workflows and docs to reference the Swift podspec at the repo root (removing the Reviewed by Cursor Bugbot for commit 865a856. Bugbot is set up for automated code reviews on this repo. Configure here. |
📦 SDK Size Impact ReportMeasures how much the SDK adds to an app's size (with-SDK minus without-SDK).
➡️ SDK size impact change is minimal. Raw measurementsTarget branch (main): {"baseline_app_size_kb":84,"baseline_executable_size_bytes":75464,"with_sdk_app_size_kb":1880,"with_sdk_executable_size_bytes":76312,"sdk_impact_kb":1796,"sdk_executable_impact_bytes":848,"xcframework_size_kb":6532}This PR: {"baseline_app_size_kb":84,"baseline_executable_size_bytes":75464,"with_sdk_app_size_kb":1876,"with_sdk_executable_size_bytes":76312,"sdk_impact_kb":1792,"sdk_executable_impact_bytes":848,"xcframework_size_kb":6528} |
pod lib lint resolves paths relative to the podspec file's directory, while pod trunk push resolves relative to the repo root. With the podspec in a subdirectory, these two tools are incompatible. Moving the podspec to the repo root makes both commands resolve paths the same way. Update all workflow, doc, and CI references accordingly.
Summary
pod trunk pushfailure formParticle-Apple-SDK-Swiftby moving the podspec frommParticle-Apple-SDK-Swift/subdirectory to the repo root (alongside the other two podspecs).source_fileschanged fromSources/**/*.swifttomParticle-Apple-SDK-Swift/Sources/**/*.swiftlicensefile changed from../LICENSEtoLICENSEContext
CocoaPods resolves paths in a podspec relative to the repo root (defined by
s.source) duringpod trunk push, but relative to the podspec file's directory duringpod lib lint. With the podspec in a subdirectory, these two tools are fundamentally incompatible -- any path that works for one breaks the other.Moving the podspec to the repo root eliminates this mismatch. Both
pod lib lintandpod trunk pushnow resolve paths from the same location.This was the first
pod trunk pushfor this pod (CI step added in #723), so the bug was latent since the podspec was created.Failed run: https://github.com/mParticle/mparticle-apple-sdk/actions/runs/24206575157/job/70669365797
Test plan
pod lib lint mParticle-Apple-SDK-Swift.podspec --allow-warningspasses locallybuild-and-lint / pod-lintCI job passes