Skip to content

Drop read/write/close LibcShims and use the platform APIs directly from the SwiftPrivate module #40211

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

Conversation

kubamracek
Copy link
Contributor

This was attempted before by @mikeash in #20194, later reverted in #20372. I'd like to try again -- the goal is to avoid depending on read/write/close APIs in libswiftCore.

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

I really like this change, but one minor question, is the renaming of read, write, close required for something or can we just use the regular libc names?

Copy link
Contributor

@mikeash mikeash left a comment

Choose a reason for hiding this comment

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

Do you know if the problem that prompted #20372 is resolved, or is this part of finding out?

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek
Copy link
Contributor Author

Do you know if the problem that prompted #20372 is resolved, or is this part of finding out?

This is part of figuring that out, yes :)

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek
Copy link
Contributor Author

preset=stdlib_S_standalone_minimal_macho_x86_64,build,test
@swift-ci please test with toolchain and preset

@swift-ci
Copy link
Contributor

swift-ci commented Jan 5, 2022

Build failed
Swift Test Linux Platform
Git Sha - 0209a88

@swift-ci
Copy link
Contributor

swift-ci commented Jan 5, 2022

Build failed
Swift Test OS X Platform
Git Sha - 0209a88

@kubamracek
Copy link
Contributor Author

@swift-ci please test macOS platform

@kubamracek
Copy link
Contributor Author

@swift-ci please test Linux platform

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek
Copy link
Contributor Author

preset=stdlib_S_standalone_minimal_macho_x86_64,build,test
@swift-ci please test with toolchain and preset

@kubamracek
Copy link
Contributor Author

Note that I have now reproduced the scenario that led to the revert last time (#20372, rdar://problem/45817565) and the build failure no longer occurs -- I believe this is due some recent work by Eric. So let's go forward with this change!

@swift-ci
Copy link
Contributor

swift-ci commented Feb 8, 2022

Build failed
Swift Test OS X Platform
Git Sha - 0209a88

@kubamracek
Copy link
Contributor Author

kubamracek commented Feb 8, 2022

I really like this change, but one minor question, is the renaming of read, write, close required for something or can we just use the regular libc names?

I did the "rename" to avoid the name clash with methods called read/write/close on the structs defined in IO.swift. This felt like a less invasive solution compared to renaming of the methods, but I can easily do it the other way if you'd prefer that. @compnerd

@compnerd
Copy link
Member

compnerd commented Feb 8, 2022

I assume that the "do it the other way" is mostly a typealias in the appropriate section or explicitly naming references to calls to the internal function. I think that is kinda nicer, but I'm not too concerned either way. To a certain extent it is about style, and I'm not convinced that this particular bit of style impacts much.

@kubamracek
Copy link
Contributor Author

preset=stdlib_S_standalone_minimal_macho_x86_64,build,test
@swift-ci please test with toolchain and preset

@kubamracek kubamracek merged commit 6fe3ccc into swiftlang:main Feb 8, 2022
@kubamracek kubamracek deleted the remove-read-write-close-shims branch February 8, 2022 23:32
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.

5 participants