Commit Graph
96 Commits
Author SHA1 Message Date
Franz Busch 28f9cae996 [CI] Fix docs check (#2811)
# Motivation

I broke the docs check in one of my previous PRs.

# Modification

This PR fixes the docs check again.

# Result

No more broken CI
2024-07-25 17:52:34 +01:00
Franz Busch f17f7e5909 [CI] Add shellcheck and fix up warnings (#2809)
# Motivation

We have quite a lot of shell scripts in our repo and want to make sure that they all pass `shellcheck`.

# Modification

This PR adds a GH action workflow to the soundness script for `shellcheck` and fixes up all errors and warnings.

# Result

No more shell/bash discussions
2024-07-25 14:55:44 +00:00
Franz Busch 541a90026a [CI] Add format ignore file (#2803)
# Motivation

Some repositories may want to exclude files from being format checked.

# Modification

This PR moves the formatting into a separate script and adds an optional `.swiftformatignore` file that can be placed at the repo root similar to the `.licenseignore` file.

# Result

Repos can now decide what files are ignored when running the formatter.
2024-07-24 14:57:59 +01:00
Franz Busch 8a69bd9d88 [GHA] Cxx interoperability compatibility and integration tests check (#2790)
# Motivation

Another reusable check is to make sure that all library products of a package are successfully building when consumed from a module that has Cxx interoperability enabled. Another check that's missing is running the integration tests.

# Modification

This PR adds two new checks to the reusable workflow. One to check for Cxx interoperability compatibility and another one to run the integration tests. I also fixed a misalgined name for the nightly benchmarks.

# Result

This should be one of the last reusable workflow checks.
2024-07-16 01:22:04 -07:00
Franz Busch b1bf036143 [GHA] Introduce reusable matrix workflow (#2789)
* [GHA] Introduce reusable matrix workflow

# Motivation

We have a few checks that we want to run across all supported Swift versions e.g. unit tests and benchmarks. Right now we already added two matrix based jobs to the reusable workflow. This leads to a lot of duplication and harder maintenance.

# Modification

This PR splits off the current reusable workflow to only contain soundness related checks and introduces a new reusable matrix based workflow which can be customized to execute different commands.

# Result

It is now easy to setup multiple matrix based workflows.

* Code review

* Change nightly next
2024-07-15 18:07:03 +01:00
Franz Busch eea0f74cb2 [GHA] Broken symlink and format check (#2787)
# Motivation

The next two reusable checks that we need to create are for broken symlinks and formatting. The latter is disabled for this repo for now since we need to discuss the formatting rules separately.

# Modification

This PR adds two new checks - broken symlinks and formatting.

# Result

Closer to having everything on GitHub actions.
2024-07-12 12:58:37 +01:00
Franz Busch 654bf41c03 [GHA] Add license header check (#2781)
* [GHA] Add license header check

# Motivation

We need to make sure all code files have the appropriate license headers in place. This is currently part of the soundness check and we need to replace this with a GH action.

# Modification

Adds a new job to the reusable workflow the check all files for license headers. Since some files are ignored every repo can specify a `.licenseignore` file.

# Result

Last part of the soundness script migrated.

* Review

* Remove default excludes
2024-07-12 03:07:06 -07:00
Franz Busch fd31c9504c [GHA] Move docs check to script (#2776)
# Motivation

For longer scripts we want to use a standalone shell script instead of using a multiline script inside the workflow yml.

# Modification

This PR uses the existing doc script instead of an inline script in the workflow

# Result

Better maintainability of the scripts.
2024-07-10 15:51:45 +01:00
Franz Busch 5cc05490c4 [GHA] Unacceptable language check (#2766)
* [GHA] Unacceptable language check

# Motivation

Next up replacing part of our soundness script that checked for unacceptable language.

# Modification

This PR adds a new GH action that checks for unacceptable language.

# Result

One more script replaced

* PR review

* Change homepage link to repo
2024-07-09 07:56:26 +01:00
taylorswift 38f6b98c6a convert the NIOFileSystem example code to a Snippet (#2746)
* convert the NIOFileSystem example code to a Snippet

* fix compilation error

* add missing license header

* exclude snippets from soundness.sh
2024-06-21 10:23:18 +01:00
Franz Busch 8a9a3b1db5 Introduce assumeIsolated() methods on EventLoop, EventLoopPromise and EventLoopFuture (#2657)
* Introduce `assumeIsolated()` methods on `EventLoop`, `EventLoopPromise` and `EventLoopFuture`

> All methods/types are currently `internal` so we don't have to bikeshed just yet but we can move forward to get `NIOCore` warning free under strict concurrency

# Motivation

Methods on the above types are often called from the same event loop; however, we cannot prove to the compiler that this is true so we had to mark many methods on those types with `@Sendable` or require the generic type to be `Sendable`. This leads to unnecessary usage of `NIOLoopBound` when instead we should just dynamically assert that we are on the event loop. @dnadoba opened a very similar PR https://github.com/apple/swift-nio/pull/2228.

# Modification

This PR provides a method called `assumeIsolated()` on the three types that returns a type which re-declaration of all methods of the wrapped typed that have `Sendable` annotations. This new type is asserting at runtime that we are on the right event loop; hence, we don't need a `Sendable` value.

# Result

This PR makes it easier for our adopters to avoid newly introduced `Sendable` warnings

* Review
2024-02-19 18:09:26 +00:00
Gregor Milos (Grzegorz Miłoś) f4c61cfdb7 Fix up the markdown output generated by scripts/analyze_performance_results.rb (#2651)
Motivation:

`scripts/analyze_performance_results.rb` has `-o markdown`. But the output that it currently generates isn't compliant. It outputs:
`|--|--|...` as the header separator. There need to be three or more `-` in that (or `:` replacing one of the dashes).

I've also put the test names in code blocks, this improves the rendering slightly.

Modifications:

* Fix header separator output in markdown
* Put the test names in code blocks

Result:

Markdown output renders properly in standard markdown viewers (github, MacDown).
2024-02-14 13:35:36 +00:00
1445dcabeb Add cxx interop build pipeline (#2614)
* Add cxx interop build pipeline

* Add imports to source

* Update docker-compose for 5.9 and 5.10

* Remove test target

---------

Co-authored-by: George Barnett <gbarnett@apple.com>
Co-authored-by: David Nadoba <d_nadoba@apple.com>
2023-12-22 02:47:32 -08:00
Andrew 8a248107e1 Allow opt-out of PII in CONTRIBUTORS.txt (#2453)
* Update CONTRIBUTORS.txt

* Update generate_contributors_list.sh to allow removed emails

* Removed from mailmap too

* Remove entries instead
2023-06-27 02:20:55 -07:00
David Nadoba 6720612111 Drop Swift 5.5 (#2406)
* Drop Swift 5.5

* Use `swift-atomics` 1.1.0 with `Sendable` adoption
2023-04-17 08:40:35 +01:00
Cory BenfieldandGeorge Barnett a7c36a7654 Clean up and regression check the docs. (#2400)
Motivation:

Up until recently, it has not been possible to regression check our
documentation. However, in recent releases of the DocC plugin it has
become possible to make warnings into errors, making it possible for us
to CI our docs.

This patch adds support for doing that, and also cleans up our
documentation so that it successfully passes the check.

Along the way I accidentally wrote an `index.md` for `NIOCore` so I
figure we may as well keep it.

Modifications:

- Structure the documentation for NIOCore
- Fix up DocC issues
- Add `check-docs.sh` script to check the docs cleanly build
- Wire things up to our docker-compose scripts.

Result:

We can CI our docs.

Co-authored-by: George Barnett <gbarnett@apple.com>
2023-04-11 09:05:22 +01:00
Cory Benfield d20a0dd472 2023 is real, we should support it (#2342) 2023-01-09 02:21:30 -08:00
George Barnett fcca969463 Raise minimum supported Swift version from 5.4 to 5.5 (#2267)
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)
- Remove unused swiftformat from Dockerfile
- Update tools version in syscall wrapper tests to 5.5
- Update docs

Results:

Minimum Swift version is 5.5
2022-09-29 11:47:44 +01:00
Cory Benfield 6918034260 Update HTTP parser to LLHTTP (#2263)
Motivation:

The node.js HTTP parser library that we use has been unmaintained for some time. We should move to the maintained replacement, which is llhttp. This patch will update our dependency and bring us over to the new library, as well as make any changes we need.

Modifications:

This patch comes in 4 parts, each contained in a separate commit in the PR.

The first commit drops the existing http_parser code and updates some of the repo state for using llhttp.
The second commit rewrites the update script to bring in llhttp instead of http_parser.
The third runs the actual script. You can skip reviewing this except to sanity check the outcome.
The fourth commit updates the NIO code and the tests to get everything working.

In general the substance of the product modifications was minimal. The logic around keeping track of where we are in the buffer and how upgrades work has changed a bit, so that required some fiddling. I also had to add an error reporting path for the delegates to be able to throw specific errors that llhttp no longer checks for. Finally, I removed two tests that were a little overzealous and that llhttp does not police.

Result:

Back on the supported path.
2022-09-13 14:09:57 +01:00
Johannes Weiss f16991836d helpful error message when compiling without test discovery on >= Swift 5.5 (#2264) 2022-09-07 15:49:48 +01:00
tomer doron 92e1e06303 Update soundness.sh (#2240)
motivation: correct exception list to be bash safer

changes: quote expulsion pof custom Package.swift files
2022-08-09 08:16:04 +01:00
tomer doronandCory Benfield 712e207f26 initial adoption of DocC based documentaiton (#2235)
* initial adoption of DocC based documentaiton

motivation: use DocC for docs

change:
* add DocC catalog to NIO target, as the "landing page"
* remove jazzy doc generation script
* add Package.swift with tools-version 5.6 so that DocC can be used, and add a dependency on the DocC plugin
* udpate soundness script

* * add packge.swift files for older vrsions
* adjust waning-as-error and enable-test-discovery to the different permutations

* fixup

* remove jazzy

Co-authored-by: Cory Benfield <lukasa@apple.com>
2022-08-08 03:55:18 -07:00
George Barnett 1a4028a96b Remove build_podspec.sh (#2094)
Motivation:

We no longer support Cocoapods.

Modifications:

- Remove build_podspec.sh and associated scripts

Result:

Less unused code.
2022-05-04 03:19:09 -07:00
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 FettandCory Benfield 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 EatonandCory Benfield 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
buttafaceandCory Benfield 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 PrickettandPrickett 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