-
Notifications
You must be signed in to change notification settings - Fork 133
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
[Innovation week] Enable compilation for macOS #1711
Conversation
8371e78
to
9b0151a
Compare
5c55eff
to
5d959ad
Compare
Datadog ReportBranch report: ✅ 0 Failed, 2954 Passed, 0 Skipped, 30m 37.02s Wall Time 🔻 Code Coverage Decreases vs Default Branch (12)
|
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.
With adding so many #if <os>
directives we need at least smoke tests that will verify build compatibility for macOS
.
5d3252b
to
d160960
Compare
Datadog ReportBranch report: ✅ 0 Failed, 3053 Passed, 0 Skipped, 30m 53.18s Wall Time 🔻 Code Coverage Decreases vs Default Branch (3) |
58ac3ec
to
090d4a8
Compare
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.
- I think we can limit the impact of this PR if targeting a higher macOS version (more might come with official support). I left a question on this.
- Also, let's change the title of this PR to be more descriptive. Otherwise future selves won't find it.
💪 Other than this is it looks fine - great work on adding a smoke test 🚬 🏅 🚭.
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.
Looks great, very nice effort! I think we should update the core context provider enablement, especially the LowPowerModePublisher
which could be enabled for macOS 12 and above.
Updated the PR. Supporting macOS 12+ seems quite painless comparing to 10.15 and 11. PTAL 🙌 |
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.
Compiling for macOS 11, but module 'DatadogCore' has a minimum deployment target of macOS 12.0
I tried to compile the SPM dependency manager test app with Xcode 15 and couldn't build. There seems some version mismatch.
@@ -20,7 +20,7 @@ import Network | |||
/// We found the pulling model to not be thread-safe: accessing `currentPath` properties lead to occasional crashes. | |||
/// The `ThreadSafeNWPathMonitor` listens to path updates and synchonizes the values on `.current` property. | |||
/// This adds the necessary thread-safety and keeps the convenience of pulling. | |||
@available(iOS 12, tvOS 12, *) | |||
@available(iOS 12, tvOS 12, macOS 10.15, *) |
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.
❓
why do we have different macOS support versions here as 10.15 but 10.14 somewhere down?
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.
Removed it. We agreed to support 12+
guard let flags = flags, flags.contains(.isWWAN) else { | ||
return nil | ||
} | ||
self = .cellular | ||
#else | ||
self = .other |
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.
There are no mac with cellular connection, this must nil for macOS.
let build = (try? Sysctl.osVersion()) ?? "" | ||
let model = (try? Sysctl.model()) ?? "" |
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.
can they just be nil?
Also, are there high level APIs for such information?
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.
They're required by schema
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.
I see, instead empty string some other string would be helpful in querying like <unknown>
or <unrecognized>
SUPPORTED-VERSIONS.md
Outdated
@@ -5,13 +5,18 @@ | |||
| **iOS** | ✅ | `11+` | | |||
| **tvOS** | ✅ | `11+` | | |||
| **iPadOS** | ✅ | `11+` | | |||
| **VisionOS** | ⚠️ | `1.1+` | | |||
| **visionOS** | ⚠️ | `1.0+` | | |||
| **macOS** | ⚠️ | `10.15+` | |
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.
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.
I made some adjustment based on previous comment. Now we only support 12+
Now target destination is a pandora box.
I'd like to discuss during the SDK meeting.
I think we can simplify and have only one target with all the destinations, instead of current iOS/tvOS split
SUPPORTED-VERSIONS.md
Outdated
|
||
## MacOS | ||
|
||
MacOS is not officially supported by Datadog SDK. Some features may not be fully functional. Note that `RUM`, which heavily depends on `UIKit` does not build on macOS. |
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.
If we know this is not going to build, we must not add RUM support in project. This will cause unnecessary friction.
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 can only have one Package definition and as far as I know, and we can't do selective destination (Session Replay is iOS only for example)
@@ -360,6 +360,18 @@ workflows: | |||
-project "$BITRISE_SOURCE_DIR/dependency-manager-tests/spm/SPMProject.xcodeproj" \ | |||
-destination "platform=macOS,variant=Mac Catalyst" \ | |||
| xcpretty | |||
- script: | |||
title: Check macOS compatibility (build SPMProject for macOS) |
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.
❓
Only SPM?
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.
It follows what we did for Mac Catalyst. It's minimal effort for the smoke test, as the support is not official
I tried the latest version 7b094e8 but still couldn't get the sample SPM app logs and tracing working yet. I think this is minimum bar that the project not only compiles but have some basic things working. |
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.
Looks good 👍. I changed the PR title to be more descriptive. Great initiative, thanks 🏅
Co-authored-by: Ganesh Jangir <ganesh.jangir@datadoghq.com>
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.
Thanks!
What and why?
These changes enable macOS support for Core, Logs, Trace, Crash Reporting and Web View Tracking as well as add some minor tweaks for VisionOS support.
Review checklist
Custom CI job configuration (optional)
tools/