Skip to content
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

Fix backward compatibility in host triple checks #6819

Merged
merged 6 commits into from Sep 20, 2023

Conversation

MaxDesiatov
Copy link
Member

@MaxDesiatov MaxDesiatov commented Aug 16, 2023

When setting host triple in Swift SDKs to arm64-apple-macosx13.0 to allow cross-compiling from an older version of macOS, this triple is not recognized as directly matching arm64-apple-macosx14.0 on a newer version of macOS.

We should support backward compatibility with Swift SDKs that were built for older version of macOS.

Resolves rdar://113967401.

@MaxDesiatov
Copy link
Member Author

@swift-ci smoke test

@MaxDesiatov
Copy link
Member Author

@swift-ci smoke test

@MaxDesiatov
Copy link
Member Author

@swift-ci test windows

return hostTriple.osVersion >= variantTriple.osVersion
} else {
return false
}
Copy link
Member Author

Choose a reason for hiding this comment

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

I've inlined this check just in SwiftSDKBundle.swift and rewrote it so that it doesn't depend on vendored Triple API and can be easily backported to 5.9.

Copy link
Member

Choose a reason for hiding this comment

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

Seems fine for 5.9, but we shouldn't land it like this in main IMO

Copy link
Member Author

Choose a reason for hiding this comment

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

WDYT of the previous isRuntimeCompatible name for a function to refactor this into?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the naming I'm using after all in the latest commit.

@MaxDesiatov
Copy link
Member Author

@swift-ci smoke test

@MaxDesiatov
Copy link
Member Author

@swift-ci test windows

1 similar comment
@MaxDesiatov
Copy link
Member Author

@swift-ci test windows

It's useful to be able to set host triple in Swift SDKs to `arm64-apple-macosx13.0` to allow cross-compiling from an older version of macOS. This triple is not recognized as directly matching `arm64-apple-macosx14.0` on a newer version of macOS.

We should support backward compatibility with Swift SDKs that were built for older version of macOS.
@MaxDesiatov
Copy link
Member Author

@swift-ci test

@MaxDesiatov
Copy link
Member Author

@swift-ci test

@rauhul
Copy link
Contributor

rauhul commented Sep 19, 2023

This looks reasonable to me, though again I would love to see Triple moved to a distinct target shared between driver and pm

@MaxDesiatov
Copy link
Member Author

@swift-ci test windows

@MaxDesiatov
Copy link
Member Author

@swift-ci test

MaxDesiatov added a commit that referenced this pull request Sep 19, 2023
Cherry-pick of #6819.

When setting host triple in Swift SDKs to `arm64-apple-macosx13.0` to allow cross-compiling from an older version of macOS, this triple is not recognized as directly matching `arm64-apple-macosx14.0` on a newer version of macOS.

We should support backward compatibility with Swift SDKs that were built for older version of macOS.

Resolves rdar://113967401.

```
# Conflicts:
#	Sources/PackageModel/SwiftSDKBundle.swift
```
@MaxDesiatov
Copy link
Member Author

@swift-ci test windows

1 similar comment
@MaxDesiatov
Copy link
Member Author

@swift-ci test windows

@MaxDesiatov
Copy link
Member Author

@swift-ci test

@MaxDesiatov
Copy link
Member Author

@swift-ci test windows

@MaxDesiatov MaxDesiatov merged commit 074f51d into main Sep 20, 2023
5 checks passed
@MaxDesiatov MaxDesiatov deleted the maxd/fix-host-triple-matching branch September 20, 2023 16:30
MaxDesiatov added a commit that referenced this pull request Sep 28, 2023
Cherry-pick of #6819.

When setting host triple in Swift SDKs to `arm64-apple-macosx13.0` to allow cross-compiling from an older version of macOS, this triple is not recognized as directly matching `arm64-apple-macosx14.0` on a newer version of macOS.

We should support backward compatibility with Swift SDKs that were built for older version of macOS.

Resolves rdar://113967401.

```
# Conflicts:
#	Sources/PackageModel/SwiftSDKBundle.swift
```
MaxDesiatov added a commit that referenced this pull request Sep 28, 2023
Cherry-pick of #6819.

When setting host triple in Swift SDKs to `arm64-apple-macosx13.0` to allow cross-compiling from an older version of macOS, this triple is not recognized as directly matching `arm64-apple-macosx14.0` on a newer version of macOS.

We should support backward compatibility with Swift SDKs that were built for older version of macOS.

Resolves rdar://113967401.

```
# Conflicts:
#	Sources/PackageModel/SwiftSDKBundle.swift
```
MaxDesiatov added a commit that referenced this pull request Sep 28, 2023
When setting host triple in Swift SDKs to `arm64-apple-macosx13.0` to allow cross-compiling from an older version of macOS, this triple is not recognized as directly matching `arm64-apple-macosx14.0` on a newer version of macOS.

We should support backward compatibility with Swift SDKs that were built for older version of macOS.

Resolves rdar://113967401.
MaxDesiatov added a commit that referenced this pull request Sep 28, 2023
When setting host triple in Swift SDKs to `arm64-apple-macosx13.0` to allow cross-compiling from an older version of macOS, this triple is not recognized as directly matching `arm64-apple-macosx14.0` on a newer version of macOS.

We should support backward compatibility with Swift SDKs that were built for older version of macOS.

Resolves rdar://113967401.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants