Commit Graph

73 Commits

Author SHA1 Message Date
George Barnett f32314f82f
Script to list transitive dependencies (#2082)
Motivation:

Cocoapods appears to have a different idea of the dependency graph to
SPM which has led to a handful of build failures (e.g.
https://github.com/apple/swift-nio/issues/2073).

This appears to have originated when we dropped the explicit dependency
on `CNIOAtomics` from `NIO` (https://github.com/apple/swift-nio/pull/1719).

We can work around this by listing all transitive dependencies as
requirements in the generated podspecs.

Modifications:

- Add a script to list transitive dependencies for a given module.
- Fix a bug in build_podspecs.sh which did a `pod repo update` even if
  the pods were not being uploaded.
- Update build_podspecs.sh to use transitive dependencies.
- Use Python3 in 'dev/stackdiff-dtrace.py' and update soundness.sh

Result:

Podspecs should include all transitive dependencies.
2022-04-20 14:39:43 +01:00
Fabian Fett dc8a317a24
Drop support for Swift 5.2 and 5.3 (#2080)
* Drop support for 5.2 and 5.3

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.

In this commit we drop support for Swift 5.2 and 5.3. We update CI for Swift 5.4 to run on bionic instead of focal to ensure that we still test bionic.

* Added Versions paragraph to Security document

* Apply suggestions from code review

Co-authored-by: Cory Benfield <lukasa@apple.com>

Co-authored-by: Cory Benfield <lukasa@apple.com>
2022-04-20 11:48:41 +01:00
Franz Busch d6e3762e0a
Use SPM API diff checker (#2019)
### 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.
2022-03-22 07:41:43 -07:00
Johannes Weiss a94e7ccf34
nio-diagnose: list all thread names (#2030) 2022-01-10 15:48:57 +00:00
Cory Benfield b337796bdd
Update soundness script for 2022 (#2027) 2022-01-05 09:54:25 -08:00
tomer doron b5c662adfc
Update doc script to match latest source-kitten (#2013)
motivation: fix broken doc generation script

changes:
* pass the --spm flag now required by source-kitten
* update location of source-kitten source to make it more robust
* update list of module to generate docs for to match the structural changes in nio
2021-12-16 09:28:39 +00:00
Johannes Weiss 094cd8c6e8
nio-diagnose script (#2008)
Motivation:

Frequently when folks have issues with SwiftNIO or related technologies,
we need to ask the same questions over and over again.

It'd be much nicer to just have a script that collects them.

Modifications:

Add `scripts/nio-diagnose`.

Result:

Users/devs can easily create nio-diagnose files which are markdown and
can easily be pasted into GH.
2021-12-10 11:02:29 -08:00
George Barnett 99807d9a0c
Add compiler setting for __APPLE_USE_RFC_3542 for CNIODarwin (#1942)
Motivation:

In #1888 a C compiler setting was added to Package.swift for CNIODarwin.
This isn't reflected in the associated CNIODarwin podspec so the pod
fails to build.

Modifications:

Modify the build_podspecs.sh script to add the missing compiler setting
for CNIODarwin.

Result:

CNIODarwin pod builds.
2021-09-07 12:28:23 +01:00
George Barnett 2f189a39f6
Fix doc generation and jazzy version (#1950)
* Fix doc generation and jazzy version

From: https://github.com/apple/swift-nio-extras/pull/141

motivation: fix ci

changes:
* only install ruby and jazzy on focal since jazzy id not supported onlder versions of ubuntu
* fix doc generations script adjusting it to latest source-kittent syntax

* Always install ruby: we need it for generating a test manifest
2021-09-02 18:08:04 +01:00
George Barnett f9b8f15512
Remove extra whitespace when generating license header for linux tests (#1913)
Motivation:

The soundness check is failing because of the generated year range is
not as it should be. Moreover when re-generating the linux tests for the
length prefix tests (which are failing soundness) the generated header
has extra whitespace before the year; this also fails the soundness
check.

Modifications:

- Strip whitespace from the copyright year range generated for linux
  tests
- Re-generate the test manifest for ByteBufferLengthPrefixTests

Result:

- Soundness is happier
2021-07-23 11:57:52 +01:00
Cory Benfield d0e54e9d7e
Provide a fallback date for new files. (#1903)
Motivation:

The test generation script automatically fills in the dates for the
autogenerated test files. Unfortunately, it doesn't tolerate a brand-new
file very well and puts in year zero. That's not right.

Modifications:

Default to the current year if no years are present.

Result:

Better default dates.
2021-07-20 11:35:00 +01:00
Matt Eaton 3873886ebd
issue-1036: Fix for dates on Linux test generation script. (#1894)
* issue-1036: Fix for dates on Linux test generation script.

Motivation:

Fix for issue-1036 to add a date or date range for the header.
These dates are derived from the git log on the file.

Modifications:

Parsing method to extract the date or date range from the git log
of the file.  This was added to generate_linux_tests.

Result:

Dynamic date or date range added to the file header.

* issue-1036: Added revised headers from generation script

* Regenerating dates on XCTests.

Motivation:

Addressing feedback from PR.

Modifications:

All of the XCTests now have -2021 as a header date attached to them.

Result:

Dates modified on the XCTests.

Co-authored-by: Cory Benfield <lukasa@apple.com>
2021-07-13 14:31:01 +01:00
Johannes Weiss 87c532383a
remove NIO1 API shims (#1897)
Motivation:

The lastest NIO versions require Swift 5.2+ to compile. Given that
hopefully nobody ever created a NIO1 application for Swift 5.2+, I'd say
it's about time to remove the NIO1 API shims (and related docs).

Modification:

- remove the NIO1 API shims
- remove the migration docs

Result:

Less code.
2021-07-13 12:36:28 +01:00
David Evans b0effbcfd9
Make Swift 5.2 the minimum requirement (#1860)
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.
2021-06-18 21:02:41 +01:00
Johannes Weiss 06195d2f46
dev/scripts: add missing license headers (#1852)
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.
2021-05-07 10:28:07 +01:00
tomer doron bd41bd5cf5
fix doc generation script (#1773)
motivation: generate docs

changes: use a more robust path to source-kitten
2021-03-03 07:49:55 +00:00
Johannes Weiss 6d3ca7e54e
update code of conduct to version 1.4 (#1753) 2021-02-17 14:17:51 +00:00
Fabian Fett f745421d49
Final language fix (#1732) 2021-01-22 18:39:10 +00:00
Fabian Fett 76b4637122
Make language more welcoming (#1728) 2021-01-21 12:45:46 +00:00
buttaface 44d67ba4e0
Update and finish Android port. (#1695)
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>
2020-11-27 11:16:11 +00:00
George Barnett 74bedaf43b
Add watchOS deployment to PodSpec build script (#1679)
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.
2020-10-21 09:00:01 +01:00
George Barnett bbb0e92702
Print the usage if no args ar provided to the build_podspecs script (#1665)
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
2020-10-01 17:37:55 +01:00
Cory Benfield e7880565aa
We use main as our development branch now. (#1651) 2020-09-24 18:02:44 +01:00
Daniel Alm 8d430f2d85
Minor build_podspecs.sh usage tweak. (#1613) 2020-08-20 15:09:34 +01:00
Johannes Weiss 5268726898
fix inappropriate lanugage in NIO (#1554)
Motivation:

It's 2020, we shouldn't use unnecessary offensive, insulting, or
outdated language.

Modifications:

Fix a few examples.

Result:

More inclusive.
2020-06-12 19:34:05 +01:00
Jake Prickett c05eeb40ee
Add synchronous option to trunk push (#1551)
Co-authored-by: Prickett <jpricke1@ford.com>
2020-06-09 14:51:21 +01:00
Johannes Weiss 197664726f
link swift-nio-extras in docs (#1483) 2020-04-17 18:14:15 +01:00
Johannes Weiss 4d4b9ab4b9
list_topsorted_deps: multiple fixes (#1420)
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>
2020-03-02 15:49:09 +00:00
tomer doron 9030326196
update docs generation script to work better with selinux (#1419)
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
2020-02-28 12:48:43 -08:00
Johannes Weiss 589bc7cf08
improve pod updater script (#1391)
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.
2020-02-13 07:32:11 +00:00
Johannes Weiss a76a98eb00
dev/stackdiff-dtrace: stack aggregation diffing script (#1373)
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.
2020-02-03 09:09:20 +00:00
Johannes Weiss 7f8e96cf02
fix 5.2 builds (#1366)
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>
2020-01-29 14:39:28 +00:00
Johannes Weiss d3afb073e0 adding an extra test for reading many chunks (#1356)
* adding an extra test for reading many chunks

* Update docker-compose.1804.50.yaml
2020-01-27 10:36:45 +00:00
Johannes Weiss c2c725044a
allow deprecated tests to test deprecated functionality (#1271)
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.
2019-11-27 14:26:51 +00:00
Cory Benfield 5a7b23d8b5
Fix Dash docset generation. (#1256)
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.
2019-11-20 13:41:02 +00:00
Johannes Weiss 1ca4c2113c
perf tests: switch printed metric to mean (#1244)
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.
2019-11-13 19:07:50 +00:00
Johannes Weiss ca69149d5f
api breakage tester: fetch all refs (#1076)
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.
2019-07-17 18:23:45 +01:00
Johannes Weiss 5f8d3f0b40
workaround SR-11143 for api-digester: pass -sdk / on Linux (#1068)
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.
2019-07-16 12:40:51 +01:00
Konrad `ktoso` Malawski ed3bca3131 check breakages: fail loudly when unable to checkout tag (#1060)
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
```
2019-07-09 15:51:40 +01:00
George Barnett 07e7e01c76 Check jq is available before checking API breakages (#1058)
* 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.
2019-07-04 18:47:21 +01:00
Johannes Weiss 069fcde4c5 docs: add forgotten modules (#1050)
Motivation:

Embarrassingly, we forgot a bunch of modules in the documentation.

Modifications:

Add the forgotten modules.

Result:

Better docs.
2019-06-23 16:33:47 +01:00
Johannes Weiss 448a0ba8c8 analyze_performance_results: switch to "min" instead of "mean" (#1044)
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.
2019-06-19 16:10:43 +01:00
Johannes Weiss 0357118bee Add check_no_api_breakages, a script to check public API breakages (#1016)
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.
2019-05-23 13:15:46 +01:00
tomer doron c1aff57ba4 add performance analysis docker-compose setup and script (#1013)
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
2019-05-23 11:37:21 +01:00
Johannes Weiss 5d1d59868d new alloc counter tests (#996) 2019-05-09 14:27:29 +01:00
JP Simard f6692f5c37 Add 'Show on GitHub' link to API docs (#977)
* Add 'Show on GitHub' link to API docs

Addresses #955

* Remove trailing slash
2019-04-23 10:21:41 +01:00
Johannes Weiss 8e59048aaf API docs: repo switcher
Motivation:

API docs should be cross-linked.

Modifications:

Cross-link them.

Result:

better API docs
2019-03-31 16:18:35 +01:00
Johannes Weiss 8d5994be5f
update the podspec generator to require Swift 5.0 (#929)
Motivation:

Our podspecs should also correctly require Swift 5.

Modifications:

require Swift 5 in the podspec generator.

Result:

better podspecs for NIO2.
2019-03-26 15:50:55 +00:00
Johannes Weiss d3e611f3de
allow 2017-2019 copyright headers (#790)
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
2019-01-29 15:17:01 +00:00
Cory Benfield 3659a4a973 Update list_topsorted_dependencies script. (#723)
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.
2019-01-02 15:17:40 +00:00