Skip to content

[swift-3.0-preview-1] stdlib: test improvements #4009

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

Closed
wants to merge 39 commits into from

Conversation

gribozavr
Copy link
Contributor

This is a cherry-pick of #3993, #3985, #3991, and (TODO) #4007.


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
All supported platforms @swift-ci Please smoke test and merge
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

A smoke test on macOS does the following:

  1. Builds the compiler incrementally.
  2. Builds the standard library only for macOS. Simulator standard libraries and
    device standard libraries are not built.
  3. lldb is not built.
  4. The test and validation-test targets are run only for macOS. The optimized
    version of these tests are not run.

A smoke test on Linux does the following:

  1. Builds the compiler incrementally.
  2. Builds the standard library incrementally.
  3. lldb is built incrementally.
  4. The swift test and validation-test targets are run. The optimized version of these
    tests are not run.
  5. lldb is tested.

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
All supported platforms @swift-ci Please test and merge
OS X platform @swift-ci Please test OS X platform
OS X platform @swift-ci Please benchmark
Linux platform @swift-ci Please test Linux platform

Lint Testing

Language Comment
Python @swift-ci Please Python lint

Note: Only members of the Apple organization can trigger swift-ci.

shahmishal and others added 30 commits August 2, 2016 19:40
Issue better diagnostics, along with notes and fixits, for the common
case of using an implicitly non-escaping parameter of function type in
a context expecting an @escaping closure. Provides even more specific
diagnostics for common scenarios such as passing to another function
or assignment.
Extends the more useful diagnostics for non-escaping function
parameters used in @escaping contexts to apply to all functions that
are equivalent modulo ExtInfo.
This allows us to freely pass the address of a variable of such
types to a C function without worrying about it overwriting other
things if e.g. it memcpy's sizeof(T) bytes and thus clobbers the
otherwise-non-existent tail padding.

There are ways to get this optimization back, but they require
things like materializing to a temporary instead of passing the
address directly.  We haven't done that work yet, so we don't
get to take advantage of it.

rdar://26828018
)

Otherwise we get into a situation like this:

1. Change made to the interface of file A.swift that also causes an
   error in A.swift.
2. Fixing the error in A.swift does not affect A.swift's interface.
3. File B.swift that depends on A.swift is not rebuilt, since the most
   recent change to A.swift did not change its interface.

To fix this, mark downstream files as needing to be rebuilt even when
a compilation job fails with errors. Additionally, attempt to be extra
conservative when there's a crash.

rdar://problem/25405605
(cherry picked from commit 848b3eb)
Thanks, Dmitri.

(cherry picked from commit b8cc267)
This ensures that blocks that come from `DispatchWorkItem`s will
function correctly.

The only exception is __dispatch_barrier_sync() as the block passed to
that call is not `@convention(block)` so it doesn't matter.

Fixes SR-2246.
[swift-3.0-branch] Added String.init<T>(_: T) and marked it unavailable
rdar://27226313
(cherry picked from commit b5a8805)
This test is known to fail on a debug stdlib
Huge thanks to John for noting that 'consume' didn't provide the
guarantees we wanted, and to Michael G. for getting a TSan build up
and running to identify/verify this race.

It's possible that this is overlay strict, and that we only need to
look at the domain to ensure that the code and userInfo are
visible. However, TSan seems to prefix the form in this patch, so
we'll be more conservative for now.

Fixes rdar://problem/27541751.

(cherry picked from commit e07e887)
Count tail-padding in the size of imported C types.
It is important to call doPreProcess to correctly setup the available opened archetypes which were referenced from the original instruction being copied.

This fixes a concrete bug in LoopRotate optimization and potential bugs related to cloning.

rdar://27659420
...because otherwise option sets that get imported as members using
NS_SWIFT_NAME are printed with an 'enum' tag, and the definition of
NS_OPTIONS only declares the typedef under C++.

We should come back and figure out something more principled for this
later, but for now this solves an issue with generated headers
imported into C++ translation units.

rdar://problem/27130343
(cherry picked from commit 02d2517)
[sil-cloner] Always call doPreProcess when visiting SILInstructions.
…-race

Eliminate a race condition in NSError bridging
[3.0] [Driver] Make sure to rebuild dependents when a dirty file fails.
[swift-3.0-branch] Fix Dispatch API's handling of block parameters
…asses.

In addition to using the 'Class' existential representation for
NSError, use it for subclasses of NSError, which can also be toll-free
bridged. Narrowly addresses rdar://problem/27658748.

(cherry picked from commit 3f960e3)
…xistentials.

Imported Cocoa error types are represented by structs wrapping an
NSError. The conversion from these structs to Error would end up
boxing the structs in _SwiftNativeNSError, losing identity and leading
to a wrapping loop.

Instead, extract the embedded NSError if there is one. In the Swift
runtime, do this as part of the dynamic cast to NSError, using a (new,
defaulted) requirement in the Error type so we can avoid an extra
runtime lookup of the protocol. In SILGEn, do this by looking for the
_BridgedStoredNSError protocol conformance when erasing to an Error
type. Fixes SR-1562 / rdar://problem/26370984.

(cherry picked from commit d219531)
When emitting an existential erasure to Error from an archetype, use
the _getEmbeddedNSError() witness. If it produces an NSError, erase
that; otherwise, go through the normal erasure path.

Of course, make NSError and CFError implement _getEmbeddedNSError() so
this kicks in for the obvious cases as well as the more obscure ones.

Fixes the rest of SR-1562 / rdar://problem/26370984.

(cherry picked from commit 75e85dc)
…SError.

This clarifies the 'Indirect' case. Thanks, Dmitri!

(cherry picked from commit 4b8b7bb)
…r existential.

SILGen already attempts to extract an embedded NSError when
type-erasing to an Error existential; make the runtime do the same
thing dynamically.

Huge thanks to Joe Groff who noticed that I missed this path.

(cherry picked from commit e83fb64)
tkremenek and others added 9 commits August 3, 2016 23:52
[swift-3.0-branch] SpriteKit overlay: add a better variant of the SKWarpGeometryGrid() initializer overlay
We're still seeing some problems on the CI from re-enabling this test,
despite TSan being happy with the result. Disable this test again
while we track the issue down.
[Swift 3.0] Eliminate double-wrapping of NSErrors in _SwiftNativeNSError
[Preset] SR-2232 Update preset to use build-swift-static-sdk-overlay
…ation

[swift-3.0-branch] stdlib/Foundation: optimize the NSDictionary copy-constructor
These exact tests already exist in
validation-test/stdlib/SpriteKit.swift.
@gribozavr
Copy link
Contributor Author

Wrong target branch.

@gribozavr gribozavr closed this Aug 4, 2016
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.