Skip to content

Remove URL workaround for Linux crash once SCL-F is rebuilt #1252

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

Merged
merged 1 commit into from
Apr 23, 2025
Merged
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
12 changes: 0 additions & 12 deletions Sources/FoundationEssentials/URL/URL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -690,18 +690,6 @@ public struct URL: Equatable, Sendable, Hashable {
///
/// Returns `nil` if a `URL` cannot be formed with the string (for example, if the string contains characters that are illegal in a URL, or is an empty string).
public init?(string: __shared String, relativeTo url: __shared URL?) {
#if os(Linux)
// Workaround for a Linux-only crash where swift-corelibs-foundation's
// NSURL.baseURL.getter returns a value of 0x1 when bridging to URL.
// Crash doesn't occur when swift-corelibs-foundation is rebuilt with
// the new swift-foundation URL code, so this is temporary to get
// swift-foundation CI to pass.
if unsafeBitCast(url, to: (UnsafeRawPointer, UnsafeRawPointer).self) == (UnsafeRawPointer(bitPattern: 0x1), UnsafeRawPointer(bitPattern: 0x0)) {
guard let inner = URL._type.init(string: string, relativeTo: nil) else { return nil }
_url = inner.convertingFileReference()
return
}
#endif
guard let inner = URL._type.init(string: string, relativeTo: url) else { return nil }
_url = inner.convertingFileReference()
}
Expand Down