Commit Graph
9 Commits
Author SHA1 Message Date
Rick Newton-Rogers 60089114f8 Enable MemberImportVisibility check - attempt 2 (#3029)
Enable MemberImportVisibility check on all targets. Use a standard
string header and footer to bracket the new block for ease of updating
in the future with scripts.

See https://github.com/apple/swift-nio/pull/3021
2024-12-17 11:21:02 +00:00
Franz Busch c9756e1083 Adopt swift-format (#2794)
* Apply formatting

* Apply no block comments rule

* Apply OmitExplicitReturns

* Apple OnlyOneTrailingClosureArgument

* Apply NoAssignmentInExpressions

* Fix up DontRepeatTypeInStaticProperties lint errors

* Apply `OrderedImports`

* Apply `ReplaceForEachWithForLoop`

* format file

* Enable the formatting pipeline

* Adopt `AmbiguousTrailingClosureOverload`

* Fix license header

* Fix format check

* Fix `EndOfLineComment`

* Fix CI

* Adapt CI script to check if changes when running formatting

* Separate lint and format into to steps

* Fix format

* Adopt `UseEarlyExits`

* Revert "Adopt `UseEarlyExits`"

This reverts commit d1ac5bbe12.
2024-07-19 11:48:17 +02:00
George Barnett cc158ec6c7 Raise minimum Swift version to 5.8 (#2675) 2024-03-11 08:47:57 +00:00
Si Beaumont 83f49cb335 Throw SocketAddressError (cf. fatalError) in SocketAddress.convert for unknown address family (#2477)
* Throw SocketAddressError (cf. fatalError) in SocketAddress.convert for unknown address family

Signed-off-by: Si Beaumont <beaumont@apple.com>

* fixup: Use AF_UNSPEC, not AF_SYSTEM, in tests

Signed-off-by: Si Beaumont <beaumont@apple.com>

* fixup: Use try! instead of catch and fatalError

Signed-off-by: Si Beaumont <beaumont@apple.com>

* fixup: Move address conversion before side effects

Signed-off-by: Si Beaumont <beaumont@apple.com>

* fixup: Propagate error from SocketAddress.convert in DGVRM

Signed-off-by: Si Beaumont <beaumont@apple.com>

* fixup: Add __test_only shim for Swift 5.6

Signed-off-by: Si Beaumont <beaumont@apple.com>

---------

Signed-off-by: Si Beaumont <beaumont@apple.com>
2023-07-20 12:13:07 +01:00
788b759d0b Fix Nightly Build to work with new Swift versions (#2288)
Swift 5.8 has recently changed the name of the function assign to now be called update. Now, they call update like seen in this proposal:
https://github.com/apple/swift-evolution/blob/main/proposals/0370-pointer-family-initialization-improvements.md

Co-authored-by: Carolina Cassedy <ccassedy@apple.com>
Co-authored-by: Cory Benfield <lukasa@apple.com>
Co-authored-by: David Nadoba <d_nadoba@apple.com>
2022-10-13 14:29:40 +01:00
Cory Benfield 67c0fd36d3 Add support for translating subnet prefixes to masks (#2169)
Motivation:

On Windows we have a need to transform a subnet prefix into a subnet
mask when enumerating devices. This is a straightforward transformation
that we can easily do in pure-Swift, so let's do that. Additionally, the
functions have small enough domains that we can just exhaustively test
them.

Modifications:

- Added functions to create SocketAddress objects from subnet prefixes.
- Added exhaustive tests for those functions.
- Use these functions in Windows code.

Result:

Correct transformations of prefixes into masks on Windows.
2022-06-07 04:49:19 -07:00
Cory BenfieldandGuillaume Lessard b2195f7973 Rebind less load more (#2055)
* rebind less, load more.

* Rebind even less, load even more

* Remove the mutatings

Co-authored-by: Guillaume Lessard <guillaume.lessard@apple.com>
2022-03-07 03:20:16 -08:00
Cory Benfield 19403414ba Get unit tests running again on nightly builds. (#1961)
Motivation:

In February, @weissi noticed that the nightly builds of Swift could no
longer compile the unit tests. We disabled them at that time and
reported an upstream bug, https://bugs.swift.org/browse/SR-14268. This
is not an ideal situation, but the Swift core team has provided a
workaround we can use to re-enable the tests.

Modifications:

Provide free functions that wrap some specific extension methods that
are called in unit tests, and amend the call sites to use them.

Result:

We can re-enable the nightly tests.
2021-09-17 20:50:29 +01:00
Cory Benfield b05c6f2206 Move NIO to NIOPosix, make NIO a shell. (#1936)
Motivation:

The remaining NIO code really conceptually belongs in a module called
NIOPosix, and NIOCore should really be called NIO. We can't really do
that last step, but we can prepare by pushing the bulk of the remaining
code into a module called NIOPosix.

Modifications:

- Move NIO to NIOPosix
- Make NIO an umbrella module.

Result:

NIOPosix exists.
2021-08-16 16:50:40 +01:00