From 4c3a009c2b93d77b0791b001c1257929a4c1a8bf Mon Sep 17 00:00:00 2001 From: Allan Shortlidge Date: Wed, 4 Sep 2024 22:38:10 -0700 Subject: [PATCH] SILGen: Remove triplesAreValidForZippering() assert. This assert was correctly catching the fact that `-target-variant` is not being normalized at the same time as `-target` when building arm64e modules from swiftinterface. That should be fixed, but at the moment it isn't causing any concrete harm and the assertion fails when building against the SDKs included with the latest Xcode 16 betas. Resolves rdar://133020098. --- lib/SILGen/SILGenDecl.cpp | 1 - lib/Serialization/SerializedModuleLoader.cpp | 1 + validation-test/ParseableInterface/rdar133020098.swift | 5 +++++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 validation-test/ParseableInterface/rdar133020098.swift diff --git a/lib/SILGen/SILGenDecl.cpp b/lib/SILGen/SILGenDecl.cpp index 09302419fb4e4..27d19179c4e9c 100644 --- a/lib/SILGen/SILGenDecl.cpp +++ b/lib/SILGen/SILGenDecl.cpp @@ -1771,7 +1771,6 @@ SILValue SILGenFunction::emitZipperedOSVersionRangeCheck( // macCatalyst process it will use the iOS version. llvm::Triple VariantTriple = *getASTContext().LangOpts.TargetVariant; llvm::Triple TargetTriple = getASTContext().LangOpts.Target; - assert(triplesAreValidForZippering(TargetTriple, VariantTriple)); // From perspective of the driver and most of the frontend, // -target and -target-variant are symmetric. That is, the user diff --git a/lib/Serialization/SerializedModuleLoader.cpp b/lib/Serialization/SerializedModuleLoader.cpp index 080895370af67..949f2395a90c1 100644 --- a/lib/Serialization/SerializedModuleLoader.cpp +++ b/lib/Serialization/SerializedModuleLoader.cpp @@ -1323,6 +1323,7 @@ bool swift::extractCompilerFlagsFromInterface( // we have loaded a Swift interface from a different-but-compatible // architecture slice. Use the compatible subarchitecture. for (unsigned I = 1; I < SubArgs.size(); ++I) { + // FIXME: Also fix up -target-variant (rdar://135322077). if (strcmp(SubArgs[I - 1], "-target") != 0) { continue; } diff --git a/validation-test/ParseableInterface/rdar133020098.swift b/validation-test/ParseableInterface/rdar133020098.swift new file mode 100644 index 0000000000000..1e26962a627df --- /dev/null +++ b/validation-test/ParseableInterface/rdar133020098.swift @@ -0,0 +1,5 @@ +// RUN: %target-swift-frontend -typecheck %s + +// REQUIRES: OS=macosx + +import System