-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Resume building releases with Xcode 13 #7426
Changes from all commits
b3b585e
455d292
63ff509
dcf3d6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,12 +87,12 @@ public final class Decimal128: RLMDecimal128, Decodable { | |
|
||
/// The mininum value for Decimal128 | ||
public static var min: Decimal128 { | ||
__minimumDecimalNumber as! Self | ||
unsafeDowncast(__minimumDecimalNumber, to: Self.self) | ||
} | ||
|
||
/// The maximum value for Decimal128 | ||
public static var max: Decimal128 { | ||
__maximumDecimalNumber as! Self | ||
unsafeDowncast(__maximumDecimalNumber, to: Self.self) | ||
} | ||
} | ||
|
||
|
@@ -201,7 +201,7 @@ extension Decimal128 { | |
|
||
/// The magnitude of this Decimal128. | ||
public var magnitude: Magnitude { | ||
self.__magnitude as! Magnitude | ||
unsafeDowncast(self.__magnitude, to: Magnitude.self) | ||
} | ||
|
||
/// Adds two decimal128 values and produces their sum. | ||
|
@@ -210,7 +210,7 @@ extension Decimal128 { | |
/// - lhs: The first Decimal128 value to add. | ||
/// - rhs: The second Decimal128 value to add. | ||
public static func + (lhs: Decimal128, rhs: Decimal128) -> Decimal128 { | ||
lhs.decimalNumber(byAdding: rhs) as! Decimal128 | ||
unsafeDowncast(lhs.decimalNumber(byAdding: rhs), to: Decimal128.self) | ||
} | ||
|
||
/// Subtracts one Decimal128 value from another and produces their difference. | ||
|
@@ -219,7 +219,7 @@ extension Decimal128 { | |
/// - lhs: A Decimal128 value. | ||
/// - rhs: The Decimal128 value to subtract from `lhs`. | ||
public static func - (lhs: Decimal128, rhs: Decimal128) -> Decimal128 { | ||
lhs.decimalNumber(bySubtracting: rhs) as! Decimal128 | ||
unsafeDowncast(lhs.decimalNumber(bySubtracting: rhs), to: Decimal128.self) | ||
} | ||
|
||
/// Multiplies two Decimal128 values and produces their product. | ||
|
@@ -228,7 +228,7 @@ extension Decimal128 { | |
/// - lhs: The first value to multiply. | ||
/// - rhs: The second value to multiply. | ||
public static func * (lhs: Decimal128, rhs: Decimal128) -> Decimal128 { | ||
lhs.decimalNumberByMultiplying(by: rhs) as! Decimal128 | ||
unsafeDowncast(lhs.decimalNumberByMultiplying(by: rhs), to: Decimal128.self) | ||
} | ||
|
||
/// Returns the quotient of dividing the first Decimal128 value by the second. | ||
|
@@ -237,7 +237,7 @@ extension Decimal128 { | |
/// - lhs: The Decimal128 value to divide. | ||
/// - rhs: The Decimal128 value to divide `lhs` by. `rhs` must not be zero. | ||
public static func / (lhs: Decimal128, rhs: Decimal128) -> Decimal128 { | ||
lhs.decimalNumberByDividing(by: rhs) as! Decimal128 | ||
unsafeDowncast(lhs.decimalNumberByDividing(by: rhs), to: Decimal128.self) | ||
} | ||
} | ||
|
||
|
@@ -250,8 +250,8 @@ extension Decimal128 { | |
/// | ||
/// - Parameter other: The Decimal128 value to calculate the distance to. | ||
/// - Returns: The distance from this value to `other`. | ||
public func distance(to other: Decimal128) -> Stride { | ||
other - self | ||
public func distance(to other: Decimal128) -> Decimal128 { | ||
unsafeDowncast(other.decimalNumber(bySubtracting: self), to: Decimal128.self) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overloaded operators take a really long time to type-check so each of these were taking close to 100ms to build and now are <1ms. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it worth adding some comments to say why you use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But I suppose you could just always trace the git blame There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The difference between |
||
} | ||
|
||
/// Returns a Decimal128 that is offset the specified distance from this value. | ||
|
@@ -263,7 +263,7 @@ extension Decimal128 { | |
/// - Parameter n: The distance to advance this Decimal128. | ||
/// - Returns: A Decimal128 that is offset from this value by `n`. | ||
public func advanced(by n: Decimal128) -> Decimal128 { | ||
self + n | ||
unsafeDowncast(decimalNumber(byAdding: n), to: Decimal128.self) | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,7 +165,7 @@ public extension ObjectiveCSupport { | |
return convertBson(object: value) | ||
} | ||
return .null | ||
}.map { $0 == .null ? nil : $0 }) | ||
}.map { (v: AnyBSON) -> AnyBSON? in v == .null ? nil : v }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly this type hint made this function a lot faster to build. |
||
case .UUID: | ||
guard let val = bson as? NSUUID else { | ||
return nil | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -649,8 +649,7 @@ case "$COMMAND" in | |
export ASAN_OPTIONS='check_initialization_order=true:detect_stack_use_after_return=true' | ||
fi | ||
xcrun swift package resolve | ||
find .build -name views.cpp -delete | ||
xcrun swift test --configuration "$(echo "$CONFIGURATION" | tr "[:upper:]" "[:lower:]")" $SANITIZER | ||
xcrun swift test -Xcc -g0 --configuration "$(echo "$CONFIGURATION" | tr "[:upper:]" "[:lower:]")" $SANITIZER | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The non-SPM pull request jobs were already disabling debug symbols so this brings SPM in line with them. This knocks ~20% off the build time and cuts the total size of all the object files and such in half, which might fix some of the jobs which were timing out. |
||
exit 0 | ||
;; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,7 +106,7 @@ xctest() { | |
) | ||
elif [[ $NAME == SwiftPackageManager* ]]; then | ||
if [ -n "$sha" ]; then | ||
sed -i '' 's@branch = "master"@branch = "'"$sha"'"@' "$DIRECTORY/$NAME.xcodeproj/project.pbxproj" | ||
ex '+%s@branch = "master"@branch = "'"$sha"'"@' -scwq "$DIRECTORY/$NAME.xcodeproj/project.pbxproj" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
fi | ||
elif [[ $LANG == swift* ]]; then | ||
download_zip_if_needed swift | ||
|
@@ -133,7 +133,9 @@ xctest() { | |
local scheme=(-scheme "$NAME") | ||
|
||
# Ensure that dynamic framework tests try to use the correct version of the prebuilt libraries. | ||
sed -i '' 's@/realm-swift-latest@/realm-swift-latest/'"${REALM_XCODE_VERSION}"'@' "$DIRECTORY/$NAME.xcodeproj/project.pbxproj" | ||
if grep '/realm-swift-latest' "$DIRECTORY/$NAME.xcodeproj/project.pbxproj"; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unlike sed, ex reports failure if the expression isn't present in the file so check first. |
||
ex '+%s@/realm-swift-latest@/realm-swift-latest/'"${REALM_XCODE_VERSION}"'@' -scwq "$DIRECTORY/$NAME.xcodeproj/project.pbxproj" | ||
fi | ||
|
||
xcodebuild "${project[@]}" "${scheme[@]}" clean build "${destination[@]}" "${code_signing_flags[@]}" | ||
if [[ $PLATFORM != watchos ]]; then | ||
|
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.
This change made this function compile in 5ms rather than 150ms (as reported by
-debug-time-function-bodies
)