As outlined in a [Swift forums post in November ’21](https://forums.swift.org/t/swiftnio-swift-version-support/53232), SwiftNIO will only support the latest non-patch Swift release and the 2 immediately prior non-patch versions.
- drop support for Swift 5.2 and 5.3
- update CI for Swift 5.4 to run on bionic instead of focal to ensure that we still test bionic
### Motivation:
SPM has built in functionality to check the API of modules against a target git treeish. We can use this to simplify our `check_no_api_breakages.sh` script. Closes https://github.com/apple/swift-nio/issues/1239
### Modifications:
This PR, exchanges the direct calls to Swift's API checker with the new SPM `diagnose-api-breaking-changes` tool. This allows us to get rid of the manual module parsing, build invocations and result comparisons.
### Result:
We are now using SPMs `diagnose-api-breaking-changes` to check for breaking changes.
Motivation:
The docs haven't been generated for a while.
See also: https://github.com/apple/swift-nio/pull/2013
Modifications:
- Pass `--spm` flag to sourcekitten
- Update source location of sourcekitten
- Fix link to NIO docs
Result:
Docs build.
Motivation:
With NIO 2.32.0 we broke the core NIO module up into modules that split
apart the POSIX layer and the core abstractions. As a result, this
package no longer needs to express a hard dependency on the POSIX layer.
Modifications:
- Rewrote imports of NIO to NIOCore.
- Added NIOEmbedded and NIOPosix imports where necessary in tests.
- Extended soundness script to detect NIO imports.
- Note that the main modules still depend on NIO, which is necessary
for backwards-compatibility reasons. This dependency is unused.
Result:
No need to use NIOPosix.
From: https://github.com/apple/swift-nio-extras/pull/141
Motivation:
The combination of Ruby and Jazzy are throwing up issues in CI on older
Ubuntu versions.
Modifications:
- Only install Jazzy on focal
- Fix doc generation script to use more recent source-kitten syntax
Results:
- CI doesn't complain
- Docs get built
Motivation:
SwiftNIO recently dropped support for Swift 5.0 and Swift 5.1 but our
build_podspec.sh script doesn't reflect this change. Additionally the
list_topsorted_dependencies.sh script always assumed named depenencies
when listing module depenencies. Since our tools version has now been
bumped to 5.2 that's no longer the case and the script produces a bunch
of nulls which throws the build_podspec.sh script off course.
Modifications:
- Bump the Swift version in build_podspec.sh to 5.2
- Include "product" dependencies when listing module dependencies in
list_topsorted_dependencies.sh
Result:
Podspecs are created as expected
Co-authored-by: Cory Benfield <lukasa@apple.com>
Changes made:
Removed CI config for 5.0 ad 5.1
Changed 5.2 to be based on 16.04 so we have some coverage there
Converted Package.swift to the latest syntax
Added a description to supported Swift versions in the README
Motivation:
Run the tests on Android.
Modifications:
- Enable the tests on Android.
- Replace a few uses of /tmp with FileManager.default.temporaryDirectory in the
Swift tests.
Result:
All the tests pass on Android AArch64.
Motivation:
When pushing Cocoapods a warning is emitted for SwiftNIOSSL
('SecTrustEvaluateAsync' was deprecated in watchOS 6.0). Pushing the
pods fails as a result.
Modifications:
Allow warnings when pushing pods.
Result:
Pods can be pushed with warnings.
Motivation:
C++ structures emit a number of symbols into their binaries that are
named based on the name of the structure. Most notably, these are the
three (or five, depending on mode) magic structure methods: copy
constructor, copy assignment operator, destructor.
By and large this isn't an issue for us as BoringSSL already namespaces
most of its structures. However, a few structures are the target of
opaque typedefs in the public header files. These need to use the names
that would appear in the internal source. If they didn't, the internal
source wouldn't compile! As a result they need to appear outside the
inner prefixing namespace.
We knew about this limitation at the time we did this work, but hoped
we'd get along just fine without changing anything. In fact we did, for
nearly three years. But the chickens have come home to roost in
https://github.com/grpc/grpc-swift/issues/1134.
So it's time to fix it.
Fortunately for us, we never write down the names of the inner types in
our source code. That means we don't actually care what that name _is_.
This gives us our escape hatch: we can namespace the names of the
underlying C++ types using the same preprocessor trick as the function
names. This will have the effect of also namespacing their magic
methods.
Modifications:
This patch attempts to make this change defensively, by assuming that
other structures may be added that meet this pattern. To do it, we
compile the binary _again_ and search for any C++ methods that haven't
already been namespaced and that don't belong to Swift. We then extract
the structure name from them and add a `#define` for it. This forcibly
renames the structure in all cases.
Result:
No more colliding symbols.
* Update vendoring script to fix a missing includeo
Motivation:
The openssl/evp.h header was missing causing compilation to fail.
In addition, a previously missing header is now included by BoringSSL.
Modifications:
- Update the fix import line to fix the new missing header.
Result:
BoringSSL can be vendored using our script.
* Update BoringSSL to 4a265be4d931e35f0d108040c94d37bb49827948.
Motivation:
We support watchOS 6+ with SwiftNIO Transport Services; as such we should
include watchOS as a deployment target for our CocoaPods.
Modifications:
- Add a watchOS deployment target to `build_podspecs.sh`
Result:
Users can deploy to watchOS 6+ with CocoaPods.
Motivation:
The build_podspec.sh script generates a podspec which requires exact
versions of its dependencies. This very quickly turns into unresolvable
dependency graphs.
Modifications:
NIO version passed to script must be in the format MAJOR.MINOR
Podspec dependencies are now '>= MAJOR.MINOR', '< MAJOR+1'
Result:
Looser version requirements for podspecs
motivation: docs scripts is broken on selinux due to restriction on ssh-agent
changes:
* change the jazzy workspace to a directory accessible by the CI node so we can push from the agent instead of from the docker container
* dont remove older docs when pushing new ones
* add version information and source links
Motivation:
BoringSSL and Folly both attempt to play silly buggers with the sdallocx
symbol defined in jemalloc. Unfortunately, they don't play nicely
together, and the end result if you have both present is that BoringSSL
will reliably SIGBUS or SIGSEGV on initialization. Naturally, this isn't
good.
Modifications:
- Resolve the issue by patching out BoringSSL's allocator optimisation.
- Update BoringSSL to 6432bb46ab44731567ec923e6c8fc182f13d0070.
Result:
Flow and BoringSSL will play better together.
Motivation:
If we want to deprecate anything, we either have to remove the tests or
enable testing deprecated functionality without warnings. Conveniently,
@weissi has already written a patch that enables this for swift-nio in
apple/swift-nio@c2c7250, so we can just port that across.
Modifications:
Port Johannes' patch and run it.
Result:
We can test deprecated code.
motivation: run performance tests 🎉
changes: add performance-test task in docker-compose setup, add script to analyze performance results to be used in CI
Motivation:
BoringSSL potentially defines different symbols on different
architecture and platform combinations. This means that we've
historically missed mangling some symbol names when our script only
involved building on macOS.
We should build on more platforms to test this.
Modifications:
- Added support for cross compiling to Linux amd64, Linux aarch64, and
Linux armv7 in symbol mangling script.
- Added support for compiling for iOS armv6 and arm64 in symbol mangling
script.
Result:
Harder to run the mangling script, better results when you do.
motivation: test for api breakage on PR
changes:
* add script to detect api breakage
* amend docker setup to include jq
* amend docker-compose setup to include a shell utility task
Motivation:
Well-formed Linux assembly code declares a .note.GNU-stack section in
order to help out the linker. When absent, the linker makes some
suboptimal linking decisions that can cause pain in running programs.
Modifications:
- Amend the vendoring script to add the .note.GNU-stack section to all
assembly files on Linux.
- Updated BoringSSL
Results:
Better linker behaviour.
Motivation:
Our scripts have code to catch the functions that are used with STACK_OF
and LHASH_OF data structures in BoringSSL in order to namespace them.
Sadly, some declarations were falling through the cracks: we missed some
LHASH_OF functions used internally, and we missed the
DEFINE_NAMED_STACK_OF macro used for a new C++ data type.
Modifications:
- Improved these scripts to catch more cases.
- Updated BoringSSL to 9806ae005b3085683a2fcf2953e4170893e0973d.
Result:
Fewer exported symbols from BoringSSL.
Motivation:
When including an xcodeproj generated by SwiftPM (which builds
CNIOBoringSSL) into an xcodeproj which wasn't generated by SwiftPM it
doesn't know about the correct header paths.
Modifications:
Update the vendor-boringssl script to:
- Namespace BoringSSL with CNIOBoringSSL_ instead of CNIOBoringSSL/
- Create an umbrealla CNIOBoringSSL header
- Apply a patch to replace inttypes.h with sys/types.h in bn.h
- Apply a patch to conditionally include arm_arch.h
BoringSSL was also updated to: ae223d6138807a13006342edfeef32e813246b39
Result:
Non-SwiftPM xcodeproj's can build a SwiftPM generated xcodeproj
which includes CNIOBoringSSL.
Motivation:
The 32-bit assembly in BoringSSL doesn't assemble correctly on 32-bit
apple platforms. It took us a while to notice because we previously
haven't had any supported 32-bit platforms. NIOSSL still doesn't really
support any 32-bit Apple platforms, as all production use on those
platforms should use NIOTS, but there's no excuse for the compilation
failures really.
Modifications:
Remove assembly acceleration on 32-bit Apple platforms.
Result:
Better compilation on 32-bit Apple platforms.
Motivation:
Allowing readers of the API documentation to drill into the implementation of documented declarations can be educational and helpful for debugging, among several other reasons.
Modifications:
Add --github-file-prefix appending the current version in order to keep stable links. This means that documentation generated from any non-release revision may resolve incorrectly. This can be refined in the doc generation script later if it is deemed problematic by resolving to the commit sha if it doesn't exactly align with the version.
Result:
Users will be able to click a 'Show on GitHub' for all documented API declarations.