-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix resilient build #4932
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 resilient build #4932
Conversation
@swift-ci Please smoke test |
@slavapestov Builds of benchmarks are broken with this PR due to linking problems.
|
I'll take a look, thanks. |
9fc1e30
to
d80fead
Compare
@swift-ci Please test |
@swiftix The patches themselves need some cleanup, but this should now work well enough for preliminary testing. Let me know how it goes! |
Build failed |
1d28bb8
to
2f9e315
Compare
@swift-ci Please test |
1 similar comment
@swift-ci Please test |
Build failed |
@swift-ci Please test clean macOS |
@swift-ci Please retest macOS |
@swift-ci Please clean test macOS |
Build failed |
@slavapestov Great job! I can build & test now. |
We need to arrange enum type metadata in a way where a client can fish out generic parameters without knowing if we have a payload size or not. The payload size is only used inside the module that defined the enum, and may change if new cases are added. So put the generic parameters first before the payload size, and don't crash when an EnumMetadataScanner is used with a resilient enum.
If a protocol witness table requires instantiation, the runtime needs to call the witness table accessor when looking up the conformance in swift_conformsToProtocol(). We had a bit of code for this already, but it wasn't fully hooked up. Change IRGen to emit a reference to the witness table accessor rather than the witness table itself if the witness table needs instantiation, and add support to the runtime for calling the accessor.
…ce is passed in Resilient classes are not fully implemented yet, and can cause crashes at runtime; add a flag disabling them until the code is done, to unblock standard library testing with resilience enabled.
A recent change made accessibility checking stricter. This had some fallout on the half-baked @_versioned attribute, where we could no longer define @_versioned members on a non-@_versioned type. This was wrong anyway (and will be diagnosed when we add proper diagnostics for @_versioned), because type metadata for the internal type did not get the right linkage, but it used to work as long as you didn't try to get the type metadata at runtime. This patch adds @_versioned attributes to the right types now that this broken behavior is gone. As a result, _Variant{Set,Dictionary}Storage became resilient (non-@_versioned internal types are not resilient), which broke too many tests that assumed you can exhaustively switch over all the cases. Since eager-bridging is going to eliminate this enum anyway (or so I've heard), make it @_fixed_layout for now.
…g tests All unoptimized tests should now pass when Swift is built with 'build-script -- --swift-stdlib-enable-resilience=1'. There are still some issues when the tests themselves are built with optimizations via 'check-swift-validation-optimize'. Fixes <rdar://problem/28409189>.
2f9e315
to
d28b8ea
Compare
@swift-ci Please smoke test |
1 similar comment
@swift-ci Please smoke test |
@swift-ci Please clean smoke test macOS |
@swift-ci Please smoke clean test macOS |
@swift-ci Please clean test macOS |
I'm seeing the test fail:
|
(in a non-resilient build, to be clear) |
Not quite ready for checkin.
rdar://problem/28409189