Skip to content
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

[SE-0134][stdlib] Rename/remove two properties on String #3816

Merged
merged 4 commits into from
Jul 28, 2016
Merged

[SE-0134][stdlib] Rename/remove two properties on String #3816

merged 4 commits into from
Jul 28, 2016

Conversation

xwu
Copy link
Collaborator

@xwu xwu commented Jul 28, 2016

What's in this pull request?

This PR implements SE-0134. Merge simultaneously with apple/swift-corelibs-foundation#486.


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.

// Subtract 1 so we don't get the null terminator byte. This matches NSString behavior.
return Data(bytes: ptr.baseAddress!, count: ptr.count - 1)
return string.utf8CString.withUnsafeBufferPointer { (ptr) in
ptr.baseAddress!.withMemoryRebound(to: UInt8.self, capacity: ptr.count) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Annoyingly, Data(bytes: UnsafeRawPointer, count: Int) isn't available in this repo as it now is in swift-corelibs-foundation. Should I address that in this PR too?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that issue is separate.

Copy link
Contributor

Choose a reason for hiding this comment

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

@parkera What is the meaning of this? How can corelibs-foundation and Foundation overlay vend different APIs? I would love to change the Foundation overlay to "bytes: UnsafeRawPointer" so that it's usable without breaking the memory model. That change would be mostly source compatible, but, strictly speaking it is source breaking, thus verboten.

@xwu
Copy link
Collaborator Author

xwu commented Jul 28, 2016

@lattner @atrick Would you mind reviewing?

@tkremenek As requested on swift-evolution list, I'm pinging you because this is a Swift 3-related proposal implementation.

mangledNameLength: UInt,
outputBuffer: UnsafeMutablePointer<UInt8>?,
outputBuffer: UnsafeMutablePointer<CChar>?,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Out of my depth with @_silgen_name; is this OK?

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, your version of the code is more correct than what was there before...

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, this is good.

@atrick
Copy link
Contributor

atrick commented Jul 28, 2016

Otherwise looks great.

@gribozavr
Copy link
Contributor

gribozavr commented Jul 28, 2016

Could you add an unavailable declaration with a fixit to the new API? LGTM with that.

Edit: never mind, found it.

@gribozavr
Copy link
Contributor

@swift-ci Please test

@xwu
Copy link
Collaborator Author

xwu commented Jul 28, 2016

OS X failure is unrelated. Linux failure is expected and is solved by simultaneous merge of apple/swift-corelibs-foundation#486.

@atrick
Copy link
Contributor

atrick commented Jul 28, 2016

@tkremenek Someone please merge this.

I merged the corelibs change but I'm not authorized to merge this, so things will be broken until this merge happens.

@atrick
Copy link
Contributor

atrick commented Jul 28, 2016

@gribozavr Please merge

@gribozavr
Copy link
Contributor

@swift-ci Please smoke test

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