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

RUMM-655 Add lyft/Kronos dependency for NTP time sync #318

Conversation

ncreated
Copy link
Member

What and why?

📦 We want to use NTP to compute the real time of writing events (logs, spans, rum). In this PR I'm adding the lyft/Kronos dependency which does the NTP sync. It is not yet used in SDK code, as I wanted to separate project configuration from the actual work in SDK. This PR is not targeting the master branch yet.

How?

Cocoapods :

# Datadog.podspec + Datadog.podspec.src
s.dependency 'Kronos', '~> 4.1'

SPM:

// Package.swift
.package(url: "https://github.com/lyft/Kronos.git", .upToNextMinor(from: "4.1.0"))

Carthage required few changes to the project (and the update in dependency-manager-tests/carthage/CTProject). As it was quite strenuous, I'm leaving the note on what was changed (it's also written in commit messages):

Things change fast in Carthage (their guides are outdated), but this is how it worked in Xcode 12.0 (12A7209), target by target:

  • Datadog:
    • Add Kronos.framework to Datadog > Build Phases > Link Binary With Libraries.
    • Add Datadog > Build Settings > Frameworks Search Path: $(SRCROOT)/../Carthage/Build/iOS
  • Example:
    • Add Kronos.framework to Example > Frameworks, Libraries and Embedded Content.
    • Add Example > Build Settings > Frameworks Search Path: $(SRCROOT)/../Carthage/Build/iOS
  • DatadogIntegrationTests:
    • Add 'Copy Files' build phase, coping Kronos.framework into Frameworks folder
  • DatadogTests, DatadogBenchmarkTests:
    • no changes

Also, I had to exclude the arm64 architecture for iOS Simulator builds (done through .xcconfig) due to getting:

error: module 'Kronos' was created for incompatible target arm64-apple-ios8.0

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference

Datadog:
1/ Add `Kronos.framework` to Datadog > Build Phases > Link Binary With Libraries.
2/ Add Datadog > Build Settings > Frameworks Search Path: `$(SRCROOT)/../Carthage/Build/iOS`

Example:
1/ Add `Kronos.framework` to Example > Frameworks, Libraries and Embedded Content.
2/ Add Example > Build Settings > Frameworks Search Path: `$(SRCROOT)/../Carthage/Build/iOS`

DatadogIntegrationTests:
1/ Add 'Copy Files' build phase, coping `Kronos.framework` into `Frameworks` folder

Also, for all targets:
- Exclude arm64 architecture for iOS Simulator builds (through `Base.xcconfig`)
@ncreated ncreated requested a review from a team as a code owner November 24, 2020 13:23
@ncreated ncreated self-assigned this Nov 24, 2020
@ncreated ncreated merged commit a2b0d06 into ncreated/RUMM-655-ntp-time-sync Nov 26, 2020
@ncreated ncreated deleted the ncreated/RUMM-655-sync-time-with-ntp-server branch November 26, 2020 15:46
@ncreated ncreated mentioned this pull request Dec 1, 2020
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants