As a standard pattern, the vendoring script needed some changes, as did
our internal code.
The biggest change here is that BoringSSL has changed its name mangling
scheme. This causes us to no longer need to explicitly write the prefix
out anymore: in fact, doing that causes compiler errors. So this patch
rewrites the code to resolve that issue.
Along the way, I've also added some checks for making sure the name
mangling is correct.
Migrate CI to use GitHub Actions.
### Motivation:
To migrate to GitHub actions and centralised infrastructure.
### Modifications:
Changes of note:
* Disable warnings-as-errors until issues with recent NIO changes are
resolved
* Adopt swift-format using rules from SwiftNIO
* Remove scripts which are no longer needed
### Result:
Feature parity with old CI minus allocation tests which remain on the
old CI.
This patch has 3 parts: a commit to update the vendoring script, a
commit that contains the results of running the script, and then a fixup
for the API breaks we got.
* Update vendoring and perlasm
* Update vendoring script
* Update to BoringSSL 3309ca66385ecb0c37f1ac1be9f88712e25aa8ec
* Handle API break in BoringSSL
* Drop Swift 5.5
This patch drops Swift 5.5 support. It removes docker-compose files and
deletes any conditional compilation guards that are no longer necessary.
* Remove test generation script
Motivation:
Docs are generated by and hosted on the Swift Package Index. We no
longer need the script to generate docs via Jazzy.
Modifications:
- Remove the generate_docs script
- Remove Jazzy from the Dockerfile but keep Ruby; it's used for
generating test manifests.
- Remove SwiftFormat from the Dockerfile; we don't use it.
Result:
Fewer unused things.
Motivation:
SwiftNIO periodically drops support for older Swift versions. Now that
5.7 has been released, 5.4 will be dropped.
Modifications:
- Remove 5.4 specific Package.swift and docker-compose
- Update the 5.7 docker-compose to use the released 5.7 and move from
focal (2004) to jammy (2204)
- Fix the tools version in Package@swift-5.5.swift
- Update docs
Results:
Minimum Swift version is 5.5
Motivation
Documentation is nice, and we can help support users by providing useful
clear docs.
Modifications
Add Docc to 5.6 and later builds
Make sure symbol references work
Add overview docs
Result
Nice rendering docs
* Various vendor script fixes:
- Fix various 'gsed' occurrences with '$sed'
- Remove the delocate patch, it is no longer required
- Add another patch to include inttypes in
CNIOBoringSSL/crypto/x509/t_x509.c where PRIu64 is used and remove it
from CNIOBoringSSL_bn.h. this works around a build failure with
xcodeproj.
- Use the host platform build directory when mangling C++ symbols
- Fix Python bytes/string writing in build-asm.py
* Update BoringSSL to c239ffd0552179f358de31517391679e9b62ccd3
Motivation:
To workaround https://github.com/apple/swift-nio/issues/2073 we must
list all transitive dependencies when building podspecs.
Modifications:
- Copy over `list_transitive_dependencies.py` from the NIO repo.
- Include transitive dependencies in the build_podspec script
- Bump C++ language standard from 11 to 14
- Ignore non-modular header warnings
- Be more precise when specifying 'CNIOBoringSSL*' targets
- Use python3 in build-asm.py (The soundness script includes the
shebang as part of the 'hash' when checking for license headers and
only allows for one shebang per extension so we cannot use both Python
2 and 3 in the same repo.)
Result:
Podspec generation script includes transitive dependencies.
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