Issue #141 22 Aug 2019
Written by: Kristaps Grinbergs
Summer is almost over and it seems that the Swift community is getting ready for some big product announcements later this year. Nevertheless we had quite an intense last two weeks in the Swift.org open source projects.
Interested in sponsoring Swift Weekly Brief? Learn more here.
- SR-11295 [Compiler] There should be a warning for unnecessary casts
- SR-11321 [SwiftPM]
generate-xcodeprojdoes not generate relative search paths correctly
News and community
swift-nio-http2users, please update to
swift-nio-http2version 1.5.0 urgently.
A number of HTTP/2 server implementations have been discovered to be at risk of a number of different denial of service attacks. SwiftNIO HTTP/2 has been affected by several of these vulnerabilities. This disclosure covers all of them.
All SwiftNIO HTTP/2 versions between 1.0.0 and 1.4.0 inclusive are affected.
The Swift language guarantees memory safety in single threaded environments. However, conflicting accesses in multithreaded code lead to data races. Data races in Swift cause unexpected behavior and can even lead to memory corruption, breaking Swift’s memory safety. Thread Sanitizer is a bug-finding tool that diagnoses data races at run time. It instruments code during compilation and detects data races when they happen during execution.
Autodiscovery of test methods on Linux* is now a thing in recent Swift 5.1 snapshots. You should be able to delete LinuxMain.swift and run your tests with:
swift test --enable-test-discovery
Delayed parsing is a cool trick. I know JS implementations do it too. The idea is you can skip building AST for some parts of a source file. In order to correctly parse code following a delayed range, you still have to run the lexer - but it suffices to just count matching braces
Commits and pull requests
Proposals in review
A new proposal from the Swift Server Workgroup about an incubation process change. Feedback period will be till August 29.
Swift and SwiftNIO try to offer programmers fast and safe APIs which should mostly make the use of Unsafe constructs unnecessary. If that is not the case, we appreciate feature requests to add API allowing to use safe APIs to the respective projects.
To set expectations clearly: the proposal has been accepted and the default implementation will ship in Swift 5.1. There is no possibility of it being removed from that release, given the point we are at in the convergence of 5.1, regardless of the direction of this discussion.
…I flipped the switch causing stdlibCore to always lower ownership /after/ running the diagnostic passes. This is a large milestone for ownership in general since this is the first time we have exposed some passes downstream of the Mandatory Inlining to ownership in the build itself (vs tests). It will ensure that changes in tree do not break basic functionality when we are in this mode (something that I have run into).
This proposal aims to make a small change to the semantics of didSet, so that the call to the property’s getter is skipped if the user does not refer to the oldValue in the body of the observer. It also aims to make another change, where the lack of a willSet and the presence of a unparameterised didSet could allow for modifications to happen in-place.
I’m opening this thread because one of my proposals, Synthesized
Comparablefor pure enumerations, has been sitting with its swift evolution PR open for nearly a month with no action from core team members who would have the authority to bring it to review. the proposal text is finished, raised issues have been addressed, and its implementation branch has been untouched for about two months now. By all means, the proposal has fulfilled all the requirements to go to community review (except for CI tests, which can only be triggered by members with write-access), yet still, no review has been scheduled.
I’m working on adding SourceKit to Google’s internal source tooling. The architecture is a server that runs one instance of SourceKit per user, and uses those instances of SourceKit to serve requests from IDEs.
To make this work on code that imports modules, I need to give SourceKit access to the appropriate “.swiftmodule” files.
Dale Buckley started a discussion about default protocol implementation inheritance behaviour. The original bug was reported here.
It is summertime now, need to do some gardening.