Skip to content

[Serialization] Don't fail the precise tag check if only the last digit doesn't match #63639

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 3 commits into from
Feb 14, 2023

Conversation

xymus
Copy link
Contributor

@xymus xymus commented Feb 13, 2023

Weaken the precise tag check at loading swiftmodules to accept binary modules build by a compiler with a tag where only the last digit is different. This relies on the assumption that the other digits in the version should ensure compiler and stdlib compatibility. If the last digit doesn't match, raise a remark.

The new getCurrentCompilerSerializationTag can be used to add vendor-specific information in the tag.

The precise tag check can be disabled with the env var SWIFT_IGNORE_SWIFTMODULE_REVISION.

rdar://105158258

Rename the env var to SWIFT_IGNORE_SWIFTMODULE_REVISION as it's
recommended for use outside of testing.
…ag check

Weaken the precise tag check at loading swiftmodule to accept binary
modules build by a compiler with a tag where only the last digit is
different. We assume that the other digit in the version should ensure
compiler and stdlib compatibility. If the last digit doesn't match,
still raise a remark.

rdar://105158258
@xymus xymus requested review from bnbarham and nkcsgexi and removed request for xedin, slavapestov, artemcm and hborla February 13, 2023 22:31
@xymus
Copy link
Contributor Author

xymus commented Feb 13, 2023

@swift-ci Please smoke test

@xymus xymus changed the title [Serialization] Don't fail the precise tag check if only the last digit mismatch [Serialization] Don't fail the precise tag check if only the last digit doesn't match Feb 13, 2023
@xymus xymus requested a review from DougGregor February 13, 2023 22:32
@xymus
Copy link
Contributor Author

xymus commented Feb 13, 2023

@swift-ci Please smoke test Linux

Copy link
Contributor

@nkcsgexi nkcsgexi left a comment

Choose a reason for hiding this comment

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

Thank you for incorporating this use case🙏

if (moduleRevision != compilerRevision) {
result.status = Status::RevisionIncompatible;
// The module versions are mismatching, record it and diagnose later.
result.problematicRevision = moduleRevision;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could go with mismatchedRevision, but problematic is okay too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was working in diagnostics at the same time where we do use the generic problematic but here mismatched would be more precise. I'll try to update it next time I work in this code.

Comment on lines 91 to +94
version::Version compatibilityVersion = {};
llvm::VersionTuple userModuleVersion;
StringRef sdkName = {};
StringRef problematicRevision = {};
Copy link
Contributor

Choose a reason for hiding this comment

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

All the {} aren't actually needed here - they'd already all be default initialized (like VersionTuple).

@xymus
Copy link
Contributor Author

xymus commented Feb 14, 2023

@swift-ci Please smoke test macos

@xymus xymus merged commit 9a1a32c into swiftlang:main Feb 14, 2023
@xymus xymus deleted the serial-precise-tag branch February 14, 2023 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants