Skip to content

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

Merged
merged 5 commits into from
Oct 1, 2016
Merged

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Sep 22, 2016

Not quite ready for checkin.
rdar://problem/28409189

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@swiftix
Copy link
Contributor

swiftix commented Sep 23, 2016

@slavapestov Builds of benchmarks are broken with this PR due to linking problems.

build/swift-macosx-x86_64/benchmark/bin/Benchmark_O

Undefined symbols for architecture x86_64:
  "type metadata accessor for Swift._NativeDictionaryStorageOwner", referenced from:
      DictTest3.run_Dictionary3OfObjects (Swift.Int) -> () in DictTest3.o
      type metadata accessor for Swift._NativeDictionaryStorageOwner<DictTest3.Box<Swift.String>, DictTest3.Box<Swift.Int>> in DictTest3.o
  "type metadata accessor for Swift.DictionaryIteratorRepresentation", referenced from:
      DictTest3.run_Dictionary3OfObjects (Swift.Int) -> () in DictTest3.o
      type metadata accessor for Swift.DictionaryIteratorRepresentation<DictTest3.Box<Swift.String>, DictTest3.Box<Swift.Int>> in DictTest3.o
ld: symbol(s) not found for architecture x86_64

@slavapestov
Copy link
Contributor Author

I'll take a look, thanks.

@slavapestov slavapestov force-pushed the fix-resilient-build branch 2 times, most recently from 9fc1e30 to d80fead Compare September 30, 2016 02:06
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor Author

@swiftix The patches themselves need some cleanup, but this should now work well enough for preliminary testing. Let me know how it goes!

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - d80fead
Test requested by - @slavapestov

@slavapestov slavapestov force-pushed the fix-resilient-build branch 2 times, most recently from 1d28bb8 to 2f9e315 Compare September 30, 2016 08:58
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

1 similar comment
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 2f9e315faeb4a8c9928739e97a761e05e02f461a
Test requested by - @slavapestov

@slavapestov
Copy link
Contributor Author

@swift-ci Please test clean macOS

@slavapestov
Copy link
Contributor Author

@swift-ci Please retest macOS

@slavapestov
Copy link
Contributor Author

@swift-ci Please clean test macOS

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 2f9e315faeb4a8c9928739e97a761e05e02f461a
Test requested by - @slavapestov

@swiftix
Copy link
Contributor

swiftix commented Sep 30, 2016

@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>.
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

1 similar comment
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please clean smoke test macOS

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke clean test macOS

@slavapestov
Copy link
Contributor Author

@swift-ci Please clean test macOS

@slavapestov slavapestov merged commit 42d3b18 into swiftlang:master Oct 1, 2016
@jrose-apple
Copy link
Contributor

I'm seeing the test fail:

[ RUN      ] ResilientProtocol.DynamicCastToResilientProtocol
stderr>>> CRASHED: SIGSEGV
the test crashed unexpectedly
[     FAIL ] ResilientProtocol.DynamicCastToResilientProtocol

@jrose-apple
Copy link
Contributor

(in a non-resilient build, to be clear)

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