Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/main_using_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ jobs:
enable_freebsd_checks: true
freebsd_swift_versions: '["nightly-main"]'
freebsd_os_versions: '["14.3"]'
enable_android_sdk_build: true
android_sdk_versions: '["nightly-main"]'
android_ndk_versions: '["r28c", "r29"]'
android_sdk_triples: '["aarch64-unknown-linux-android33", "x86_64-unknown-linux-android28"]'
4 changes: 4 additions & 0 deletions .github/workflows/main_using_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
macos_xcode_versions: '["swift_6.3"]'
enable_wasm_sdk_build: true
wasm_sdk_versions: '["nightly-6.3"]'
enable_android_sdk_build: true
android_sdk_versions: '["6.3", "nightly-6.3"]'
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you like me to update all the others to "6.3" also, as the 6.3 snapshots won't be tagged much going forward?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do that in a separate PR.

android_ndk_versions: '["r28c", "r29"]'
android_sdk_triples: '["aarch64-unknown-linux-android33", "x86_64-unknown-linux-android28"]'
# enable_freebsd_checks: true
# freebsd_swift_versions: '["nightly-6.3"]'
# freebsd_os_versions: '["14.3"]'
2 changes: 2 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
enable_wasm_sdk_build: true
wasm_sdk_versions: '["nightly-main", "nightly-6.3"]'
enable_android_sdk_build: true
android_ndk_versions: '["r28c", "r29"]'
android_sdk_triples: '["aarch64-unknown-linux-android33", "x86_64-unknown-linux-android28"]'
enable_freebsd_checks: true
freebsd_swift_versions: '["nightly-main"]'
freebsd_os_versions: '["14.3"]'
Expand Down
18 changes: 4 additions & 14 deletions Sources/Testing/SourceAttribution/Backtrace.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ public struct Backtrace: Sendable {
self.addresses = addresses.map { Address(UInt(bitPattern: $0)) }
}

#if os(Android) && !SWT_NO_DYNAMIC_LINKING
/// The `backtrace()` function.
///
/// This function was added to Android with API level 33, which is higher than
/// our minimum deployment target, so we look it up dynamically at runtime.
private static let _backtrace = symbol(named: "backtrace").map {
castCFunction(at: $0, to: (@convention(c) (UnsafeMutablePointer<UnsafeMutableRawPointer?>, CInt) -> CInt).self)
}
#endif

/// Get the current backtrace.
///
/// - Parameters:
Expand All @@ -76,11 +66,11 @@ public struct Backtrace: Sendable {
#if SWT_TARGET_OS_APPLE
initializedCount = backtrace_async(addresses.baseAddress!, addresses.count, nil)
#elseif os(Android)
#if !SWT_NO_DYNAMIC_LINKING
if let _backtrace {
initializedCount = .init(clamping: _backtrace(addresses.baseAddress!, .init(clamping: addresses.count)))
if #available(Android 33, *) {
initializedCount = addresses.withMemoryRebound(to: UnsafeMutableRawPointer.self) { addresses in
.init(clamping: backtrace(addresses.baseAddress!, .init(clamping: addresses.count)))
}
}
#endif
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD)
initializedCount = .init(clamping: backtrace(addresses.baseAddress!, .init(clamping: addresses.count)))
#elseif os(Windows)
Expand Down
Loading