Make Swift 5.2 the minimum requirement, dropping support for Swift 5.0 and 5.1.
Motivation:
Whenever we have problems, Swift 5.0 and 5.1 seem to be the culprits. Dropping support for these very old versions will require less maintenance and free up our time to work on new features.
Modifications:
Set the tools version in Package.swift to 5.2
Remove CI configurations for 5.0 and 5.1
Update the various readmes to reflect that this change will be rolled out in NIO 2.30.0
Result:
Swift 5.2 is the minimum version of Swift required to use NIO.
Motivation:
We need license headers but the soundness script couldn't check if the
scripts don't have a `.sh` extension.
Modification:
- Add missing license headers.
- Better license checking (search for shell shebangs too)
Result:
Proper license attribution.
Motivation:
Be able to run and test swift-nio on Android.
Modifications:
- Remove the custom ifaddrs and use the one from the Android NDK instead.
- Enable a bunch of conditionally-compiled code for Android.
- Add a handful of constants and other Android declarations.
- Cast some types because of mismatches specific to Android.
Result:
Most tests pass on Android AArch64 and ARMv7.
Co-authored-by: Cory Benfield <lukasa@apple.com>
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`
- Update docs
Result:
Users can deploy to watchOS 6+ with CocoaPods.
Motivation:
The information printed when invoking `build_podspecs.sh` without
arguments is outdated.
Modifications:
- Print usage information when invoking without arguments.
Result:
- 'build_podspecs.sh' is more helpful when you can't remember how it
should be invoked
Motivation:
It's 2020, we shouldn't use unnecessary offensive, insulting, or
outdated language.
Modifications:
Fix a few examples.
Result:
More inclusive.
Motivation:
list_topsorted_dependencies had multiple issues:
- it would list some executable targets (even in libs-only mode)
- it confused packages with modules
- it would also list dependencies from outside the current package
Modifications:
Address all of the above.
Result:
Script more useful, inside and outside of swift-nio.
Co-authored-by: David Evans <david.evans@blackpoint.co>
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
Motivation:
Somewhere in github or Cocoapods, there seems to be a problem that if
you push a pod A and quickly after a pod B that depends on A with
exactly the version you just pushed, the validation sometimes fails
claiming that the right version of A is not available. The workaround is
to wait a bit and to call `pod repo update`.
The modifications in this PR alleviate this problem somewhat, it now
calls `pod repo update` by itself and should it still go wrong, there's
a new `-f` (from) option that can be used to skip over all pods until
the one that failed last. Example
scripts/build_podspecs.sh -u -f SwiftNIO 2.13.1
Modifications:
- update the pod repo often
- provide a skipping option to skip over earlier repos in case something
still goes wrong
Result:
Easier way to update the pods.
Motivation:
NIO has allocation counter tests, NIO also has dev/malloc-aggregation.d
which can give you aggregated stacks that allocated alongside how many
times they allocated. What's missing is a script that can diff two
aggregated stack traces.
Modifications:
Add dev/stacktrace-dtrace which allows aggregated stack trace diffing.
Result:
Easier to track performance regressions.
motivation: tsan is broken on ubuntu 18.04.use 16.04 so 5.2 build can pass
changes:
* change 5.2 docker setup to use 16.04 instead of 18.04
* add the ability to pipe arguments to the integration tests via the docker setup
* skip tests_02 integration tests suite since it broken on 5.2 (swift-pm issue?)
fake the new limits from #1362
Co-authored-by: tomer doron <tomer@apple.com>
Motivation:
It's important to also test deprecated functionliaty. One way of
achieving this without warnings is to also deprecate the tests that test
this deprecated functionality. Unfortunately, on Linux we need to
generate lists of tests which would then reference deprecated tests
(which gives us a warning).
Modifications:
Deprecate test suites and the main test runner all the way to the top so
never get warnings.
Result:
Possible to test deprecated functionlity without warnings.
Motivation:
Jazzy generates Dash docsets for us, but currently they don't work. This
is because the URLs they generate aren't matching the URL scheme we
have. That makes them next to useless.
Modifications:
Add a trailing '/' to the root URL.
Result:
Calls to Ruby's URI.join won't blow away the final path component in the
root URL, which means that the docsets will have correct URLs going
forward.
Motivation:
We should print the same metric that we compare with.
Modifications:
Switch the printed metric to the one selected in `::METRIC`.
Result:
More correct printouts.
Motivation:
To be able to use SHA sums as git versions, we need to pull all the refs
to we get even the commit SHAs from PRs. That's important so CI can use
this script.
Modifications:
Fetch `+refs/pull/*:refs/remotes/origin/pr/*` refs.
Result:
Should be able to be usable in CI across forks.
Motivation:
swift-api-digester requires to be passed `-sdk /` on Linux.
Modifications:
Pass `-sdk /` on Linux and the SDK directory on Darwin.
Result:
check_no_api_breakages works on Linux.
One line description of your change
Motivation:
When using the script ad hoc to verify something you may have forgotten to pull all tags,
the script then fails mysteriously in silence and no output. Detective work can then lead the script mysteriously stopping after a checkout:
```
+ cd /tmp/.check-api_1Q1rvO/repo
+ git checkout 1.1.0
$ ...
```
which reminds you to perform a fetch; it would be nicer if it told us about the issue explicitly though.
Modifications:
Don't silence `git checkout` all error output, though use quiet mode so no progress is printed.
Result:
Script fails nicer and reminds you to perform a git fetch if you forgot to do so.
e.g.
```
[5/5] Merging module Metrics
error: pathspec '1.1.0' did not match any file(s) known to git
```
* Check jq is available before checking API breakages
Motivation:
If jq wasn't installed the API breakage script would erronesouly say
that there were no breaking API changes. That's pretty bad.
Modifications:
Check jq is available before running the check. Updated the usage
message to specify that a Swift 5.1+ toolchain is required.
Result:
More correctness.
Motivation:
Mean is not a great aggregation function because it's not resilient
against outliers at all, so let's switch to min.
Modifications:
Switch 'mean' to 'min' for aggregation.
Result:
Aggregation function that's more resilient against outliers.
Motivation:
It's incredibly hard not to accidentally break the public API, so let's
automate that :).
Modifications:
Add the first version of a public API check script.
Result:
Fewer public API breakages.
motivation: prepare to run performance tests in ci
changes:
* add performance-test docker-compose task
* add script that can parse the performance test suite results and compare between two result-sets
* add generic shell docker-compose task
Motivation:
Our podspecs should also correctly require Swift 5.
Modifications:
require Swift 5 in the podspec generator.
Result:
better podspecs for NIO2.
Motivation:
Previously we required all copyright headers to be 2017-2018 but now
that's not the only allowed string anymore.
Modifications:
allow 2017-2019 besides 2017-2018
Result:
Happy New Year
Motivation:
Newer versions of SwiftPM for the Swift 5 release have changed the output
format of swift package dump-package. This has broken our
list_topsorted_dependencies script. This script is highly useful, so we'd
like to keep it working.
The discussion on SR-9191 suggests that SwiftPM considers this format
changeable at any time, so we may need to make a change like this in future.
We may want to consider writing tests for this script to ensure its continued good functioning.
Modifications:
- Amended the jq scripts to parse the new JSON format.
Result:
list_topsorted_dependencies will work with Swift 5 development copies of
SwiftPM. Note that this will break this script with earlier copies of SwiftPM,
but as we only support Swift 5 on the master branch this change is safe to
make.
* Pass `--module-version` and `--root-url` parameters to `jazzy`
### Motivation:
It would be good if the API document was distributed as a docset that can be installed in Dash, like [Yams](https://www.jpsim.com/Yams/).
### Modifications:
Pass `--module-version` and `--root-url` parameters to `jazzy`.
### Result:
Jazzy generates docsets and add "Install in Dash" link to `index.html`.
* Apply review: Avoid appending `args`
Motivation:
SwiftPM only generates fully usable clang modules for C modules if they
have umbrella headers. Therefore, adding a generated NIO.xcodeproj to
another Xcode project as a sub-project never worked.
To make a header an umbrella header you need to name them _exactly_ like
the module.
Modifications:
give each C module an umbrella header
Result:
generated NIO Xcode projects can be used as sub-projects.
### Motivation:
make swift-nio compatible with Android, and pass all test in Android.
### Modifications:
* add missed `ifaddrs` implementation
* add missed thread related functions - `CNIOLinux_pthread_getname_np`, `CNIOLinux_pthread_setaffinity_np` and `CNIOLinux_pthread_getaffinity_np`
* fix types incositency between Linux and Android, e.g. `Epoll.swift` class
* make bytes counter explicitely 64bits to avoid overflow on 32bit, in `PendingWritesManager.swift` and `PendingDatagramWritesState.swift`
* fix issue with Unix domain socket, first byte need to be zero in Android
* several incosistency fixes between Linux and Android api.
### Result:
now swift-nio works on Android. All tests passed!
Motivation:
A number of users have asked for the ability to install SwiftNIO
via Cocoapods. This is an entirely reasonable request, so let's
do it.
Modifications:
- Added a script that can generate, and optionally upload,
podspecs.
- Made a slight modification to the dependency script to provide
target-specific dependencies.
Result:
Users can use cocoapods if they prefer.
Motivation:
For a long while I had a script which runs NIO's performance tests
against different Swift toolchains. It should be in the repository.
Modifications:
add scripts/compare_perf_of_swift_versions.sh
Result:
everybody can run the performance tests against different Swift versions
Motivation:
Sometimes it's useful to know the top-sorted dependency order. For
example if you need to do something in an order where all dependencies
of a target have already previously processed.
Modifications:
added scripts/list_topsorted_dependencies.sh
Result:
can write other scripts that need top-sorted dependencies
Motivation:
The script to generate the contributors list wasn't executable and
forgot to change to the correct directory before invoking `git`.
Modifications:
- make `scripts/generate_contributors_list.sh` executable
- correctly change directory before invoking git
Result:
it's now possible to invoke the script without explicitly running `bash`
and it's no longer important what directory one invokes the script from.
Problem: contributors.txt file is out of date
Cause: it is a tedious job to edit this file manually everytime a new person contributes to the project
Solution: create a shell script that extracts all contributors from the git repository and adds it to the contributors.txt file
Motivation:
dtrace is extrmely useful when debugging allocation related issues. This
adds two scripts that have helped me many times.
Modifications:
- `dev/malloc-aggregation.d` which prints an aggregation of all
stacks that have allocated
- `dev/boxed-existentials.d` which live prints all allocations of boxed
existentials
Result:
sharing debugging tools is great
Motivation:
The integration tests' info mode lets us see the number of allocations
the did, that's great.
Modifications:
run integration tests in info mode
Result:
mode information
Motivation:
generate_linux_tests.rb is written in a non idiomatic way.
Modifications:
I used Rubocop to refactor the code.
More info: https://github.com/bbatsov/rubocop
Result:
A more idiomatic Ruby script.
Problem: Documentation for classes like _ChannelInboundHandler are not accesible via the official API documentation pages
Cause: GitHub treats the gh-pages branch as Jekyll
Solution: Turn off Jekyll by adding a .nojekyll file to the gh-pages branch