-
Notifications
You must be signed in to change notification settings - Fork 440
[6.0][CompilerPlugin] Remove Foundation dependency #2619
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Inspired by swift-foundation's JSONEncoder/JSONDecoder. But basically a re-implementation of Encoder / Decoder. (cherry picked from commit 61c7338)
Instead, use read(2) and write(2) via Darin/Glibc/UCRT (cherry picked from commit e20a65c)
* Rename PluginMessageJSON to JSON * Make JSON encoder/decoder SPI * Make encoding/decoding internals private (cherry picked from commit 29032ed)
(cherry picked from commit 7886469)
Use DecodingError / EcodingError properly (cherry picked from commit 3d676d0)
(cherry picked from commit 39acd5a)
(cherry picked from commit c830a21)
If read(2) returned 0, STDIN is closed. So return nil from 'waitForNextMessage()' so the caller can exit cleanly. (cherry picked from commit adb2fb0)
(cherry picked from commit 4edb04a)
(cherry picked from commit b8ae7a6)
(cherry picked from commit d6f5327)
(cherry picked from commit 9246250)
(cherry picked from commit c986761)
(cherry picked from commit 6b594b8)
Add _CShims module. For CMake it's a INTERFACE library. (cherry picked from commit 10cc964)
Speculative fix for Windows (cherry picked from commit 3b36bde)
(cherry picked from commit b3494aa)
(cherry picked from commit 585dae0)
(cherry picked from commit 5250447)
(cherry picked from commit 27fc293)
Back to read(2)/write(2). Some cleanups. (cherry picked from commit 278aea7)
(cherry picked from commit 488c434)
In some platforms memcmp don't accept optional value (cherry picked from commit 401229c)
There's no reason to '- 2'/'+ 2'. (cherry picked from commit c0fc9b5)
* typo * Remove unnecessary withExtendedLifetime() * remove JSONObject.subscript(_:) as it's not O(1) * Use 'LosslessStringConvertible' (cherry picked from commit 4c84edb)
* Don't use UTF8 decoder for decoding escaped strings * Only memcmp ASCII non-escaped strings (cherry picked from commit 5ab0c7e)
Update for review comments (cherry picked from commit 197a45c)
Update for review comments (cherry picked from commit 17a0c6b)
Use 'for' look instead of 'while cursor != end { cursor += 1 }' (cherry picked from commit cf4f3e4)
The source JSON buffer is not guaranteed to be null terminated. If a number is at top-level, 'strtod'/'strtof' tries to read past the buffer which is not great (cherry picked from commit 679b929)
Avoid possible module name collision (cherry picked from commit 1e2c3bd)
@swift-ci Please test |
@swift-ci Please test macOS |
@swift-ci Please test Linux |
@swift-ci Please test macOS |
@swift-ci Please test Linux |
@swift-ci Please test macOS |
1 similar comment
@swift-ci Please test macOS |
@swift-ci Please test Linux |
bnbarham
approved these changes
Apr 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
cherry-pick https://github.com/apple/swift-syntax/pull/2598/commits
swift-foundation
as a package dependency, sinceFoundation
uses macros, it depends onSwiftCompilerPlugin
. Soswift-syntax
should not depends onFoundation
. Implement its own JSON coder, and useread(2)
,write(2)
, etc. for standard I/O communication