From 16268123a2cf763e87dc0227b4c62fb9a17a6782 Mon Sep 17 00:00:00 2001 From: ordo-ci Date: Tue, 11 Jun 2024 14:05:12 +0300 Subject: [PATCH 1/2] =?UTF-8?q?ci:=20=F0=9F=94=84=20synced=20local=20'.git?= =?UTF-8?q?hub/workflows/'=20with=20remote=20'workflows/swift'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/semantic-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml index 8bcfe5d9..60504159 100644 --- a/.github/workflows/semantic-release.yml +++ b/.github/workflows/semantic-release.yml @@ -58,7 +58,7 @@ jobs: - name: Install semantic-release run: | - npm install semantic-release conventional-changelog-conventionalcommits@v7 -D + npm install semantic-release@v24 conventional-changelog-conventionalcommits@v8 -D npm list - name: Release env: From 6889229e21c6d9d0421a050e9e11c8f5eb5bc279 Mon Sep 17 00:00:00 2001 From: Axel Andersson Date: Thu, 13 Jun 2024 07:43:07 +0200 Subject: [PATCH 2/2] chore(patch): [sc-10781] No procinfo on mobile platforms - stub out + disable jemalloc (#257) ## Description `proc_taskinfo()` and friends are not available on iOS. ## How Has This Been Tested? Please describe the tests that you ran to verify your changes. ## Minimal checklist: - [x] I have performed a self-review of my own code - [ ] I have added `DocC` code-level documentation for any public interfaces exported by the package - [ ] I have added unit and/or integration tests that prove my fix is effective or that my feature works --- Package.swift | 2 +- .../OperatingSystemStatsProducer+Darwin.swift | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Package.swift b/Package.swift index fbc83e4b..9103a2f1 100644 --- a/Package.swift +++ b/Package.swift @@ -144,7 +144,7 @@ if macOSSPIBuild == false { // jemalloc always disable for macOSSPIBuild print("Jemalloc disabled through environment variable.") } else { package.dependencies += [.package(url: "https://github.com/ordo-one/package-jemalloc", .upToNextMajor(from: "1.0.0"))] - dependencies += [.product(name: "jemalloc", package: "package-jemalloc")] + dependencies += [.product(name: "jemalloc", package: "package-jemalloc", condition: .when(platforms: [.macOS, .linux]))] } } diff --git a/Sources/Benchmark/OperatingSystemStats/OperatingSystemStatsProducer+Darwin.swift b/Sources/Benchmark/OperatingSystemStats/OperatingSystemStatsProducer+Darwin.swift index 6c66bda5..f29ac8e9 100644 --- a/Sources/Benchmark/OperatingSystemStats/OperatingSystemStatsProducer+Darwin.swift +++ b/Sources/Benchmark/OperatingSystemStats/OperatingSystemStatsProducer+Darwin.swift @@ -56,7 +56,7 @@ nsPerSchedulerTick = 1_000_000_000 / schedulerTicksPerSecond } - #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) + #if os(macOS) fileprivate func getProcInfo() -> proc_taskinfo { var procTaskInfo = proc_taskinfo() @@ -93,7 +93,7 @@ #endif func startSampling(_: Int = 10_000) { // sample rate in microseconds - #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) + #if os(macOS) let sampleSemaphore = DispatchSemaphore(value: 0) DispatchQueue.global(qos: .userInitiated).async { @@ -155,7 +155,7 @@ } func stopSampling() { - #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) + #if os(macOS) lock.withLock { runState = .shuttingDown } @@ -168,7 +168,7 @@ } func makeOperatingSystemStats() -> OperatingSystemStats { // swiftlint:disable:this function_body_length - #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) + #if os(macOS) guard let metrics else { return .init() } @@ -255,8 +255,12 @@ } func makePerformanceCounters() -> PerformanceCounters { + #if os(macOS) let performanceCounters = getRusage() return .init(instructions: performanceCounters.ri_instructions) + #else + return .init() + #endif } }