Commit Graph
125 Commits
Author SHA1 Message Date
Craz1k0ekandBram Kolkman 810496cf12 Fixed BMPString encoding (#111)
* Fixed #110 by using UTF-16 to encode the string literal
* Added a unit test to test the added functionality

Co-authored-by: Bram Kolkman <bramkolkman@thinkerium.com>
1.5.1
2025-12-01 18:07:08 +00:00
Melissa Kilby 823291a67d chore: restrict GitHub workflow permissions - future-proof (#109)
See https://github.com/swiftlang/github-workflows/issues/167 for
additional context

This approach aligns with security best practices, as detailed in the
following documentation:

-
https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions
-
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#defining-access-for-the-github_token-scopes
-
https://openssf.org/blog/2024/08/12/mitigating-attack-vectors-in-github-workflows/


The default GITHUB_TOKEN permissions are defined at the repository
level. This PR modifies the workflow-level overrides to conform to
OpenSSF best practices -> defense in depth.

Allow me to quote OpenSSF:

https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

> The highest score is awarded when the permissions definitions in each
workflow's yaml file are set as read-only at the top level and the
required write permissions are declared at the run-level.”

> Remediation steps
> - Set top-level permissions as read-all or contents: read as described
in GitHub's documentation.
> - Set any required write permissions at the job-level. Only set the
permissions required for that job; do not set permissions: write-all at
the job level.


Compare to the LLVM project:

Top-level: contents read, e.g.
https://github.com/swiftlang/llvm-project/blob/next/.github/workflows/build-ci-container-windows.yml#L3-L4
-> this makes it future-proof

Job-level: Allow write permissions as needed, e.g.
https://github.com/swiftlang/llvm-project/blob/next/.github/workflows/build-ci-container-windows.yml#L53-L58

Signed-off-by: Melissa Kilby <mkilby@apple.com>
2025-10-20 08:51:15 +01:00
Orhan Yigit Yazicilar 40d25bbb2f Drop Swift 5.10 (#108)
### Motivation:

Swift 5.10 is no longer supported, we should bump the swift-tools
version.

### Modifications:

* Update Swift tools version to 6.0
* Add `strictConcurrencyDevelopment` mode

### Result:

Code reflects our support window.
1.5.0
2025-09-25 13:45:05 +01:00
Rick Newton-Rogers 348b60eb35 Enable Swift 6.2 jobs in CI (#107)
Motivation:

Swift 6.2 has been released, we should add it to our CI coverage.

Modifications:

Add additional Swift 6.2 jobs where appropriate in main.yml,
pull_request.yml

Result:

Improved test coverage.
2025-09-22 14:28:23 +01:00
Raphael 6bbdf5fb8b Enable release mode builds (#105)
### Motivation:

Some errors do not show up in debug builds. Enabling release mode builds
improves the CI coverage.

### Modifications:

Enable release mode builds for pull requests and scheduled builds on
main.

### Result:

Improved CI coverage.
2025-07-30 08:59:50 +01:00
Rafael CepedaandGeorge Barnett f702259812 Introduced -Xswiftc -Xfrontend flag to GA workflow. (#104)
Introduced -Xswiftc -Xfrontend flag to GA workflow. There were no
Sendability warnings to fix after this change.

---------

Co-authored-by: George Barnett <gbarnett@apple.com>
1.4.0
2025-06-20 12:57:05 +01:00
Evan Wilde 078ef3316a Install swiftmodules with full module triple (#103)
Clean up how the CMake build installs swiftmodules, using the full
module triple instead of just the architecture. This change uses the
compiler to compute the expected module triple instead of attempting to
compute it in CMake script. This is more maintainable and robust to
adding new platforms and architectures.
2025-05-14 04:49:00 +00:00
Rick Newton-Rogers bb75fd81b3 Drop Swift 5.9 (#102)
Motivation:

Swift 5.9 is no longer supported, we should bump the tools version and
remove it from our CI.

Modifications:

* Bump the Swift tools version to Swift 5.10
* Remove Swift 5.9 jobs where appropriate in main.yml, pull_request.yml

Result:

Code reflects our support window.
2025-04-29 15:32:34 +01:00
Rick Newton-Rogers a54383ada6 add thresholds for Swift 6.1 from 6.0 thresholds (#101)
- **Enable Swift 6.1 jobs in CI**
- **add thresholds for Swift 6.1 from 6.0 thresholds**
1.3.2
2025-04-14 12:00:45 +01:00
Rick Newton-Rogers 15fb892c05 Enable Swift 6.1 jobs in CI (#99)
Motivation:

Swift 6.1 has been released, we should add it to our CI coverage.

Modifications:

Add additional Swift 6.1 jobs where appropriate in main.yml,
pull_request.yml

Result:

Improved test coverage.
2025-04-14 10:47:03 +01:00
Rick Newton-Rogers d1b6295fef Enable macOS CI on pull requests (#98)
Motivation:

* Improve test coverage

Modifications:

Enable macOS CI to be run on pull request commits and make the use of
the nightly runner pool for main.yml jobs explicit.

Result:

Improved test coverage.
2025-04-01 17:41:09 +01:00
Rick Newton-Rogers 945d24b4c6 Enable macOS CI on merge to main and daily timer (#97)
Motivation:

* Improve test coverage
* Check test pass/fail status
* Monitor CI throughput

Modifications:

Enable macOS CI to be run on all merges to main and on a daily timer.

Result:

Improved test coverage run out-of-band at the moment so we can get a
feeling for if any changes need to be made in the repo or in the CI
pipelines to ensure timely and stable checks.
2025-03-28 15:12:04 +00:00
Rick Newton-Rogers 6578d7acfc Use centralized CMake checks (#96)
### Motivation:

We now have centrally-hosted CMake checks in the NIO repository which we
should use to reduce maintenance. The new checks also increase coverage
by performing a build with CMake as part of the checks.

### Modifications:

* Use the new workflow
* Commit formatting changes in the CMakeLists files from the new script
* Document how to update the CMakeLists files
* Remove the obsolete scripts

### Result:

Better CI coverage.
2025-03-17 11:15:52 +00:00
Rick Newton-Rogers 6cac4d424c Add static SDK CI workflow (#95)
Add static SDK CI workflow which runs on commits to PRs, merges to main
and daily on main.
2025-03-13 11:02:10 +00:00
Rick Newton-Rogers 3e5252c581 Only apply standard swift settings on valid targets (#94)
Only apply standard swift settings on valid targets. The current check
ignores plugins but that is not comprehensive enough.
2025-03-07 15:04:27 +00:00
Rick Newton-Rogers cc8d801730 Delete Thresholds/nightly-6.1 symlink (#93)
Following on from https://github.com/apple/swift-asn1/pull/92 delete
`Thresholds/nightly-6.1` which is no longer needed now that the shared
benchmarks workflow has been updated
2025-03-07 12:10:31 +00:00
Rick Newton-Rogers e0c82abd86 move nightly-next thresholds and add legacy symlink (#92)
Move nightly-next thresholds and add legacy symlink; see
https://github.com/apple/swift-nio/pull/3122
2025-03-03 15:27:11 +00:00
Rick Newton-Rogers 9fb1b88a90 Rename nightly_6_1 params to nightly_next (#91)
Rename nightly_6_1 params to nightly_next; see
https://github.com/apple/swift-nio/pull/3122
2025-03-03 14:50:35 +00:00
Gus Cairo 77d6ab4537 Import FoundationEssentials instead of Foundation when available (#89)
`FoundationEssentials` is more lightweight than `Foundation`, and so we
should switch to importing it when possible.
2025-02-24 11:39:35 +00:00
Rick Newton-Rogers 82d28dbe21 CI use 6.1 nightlies (#87)
CI use 6.1 nightlies now that Swift development is happening in the 6.1
branch
2025-01-30 09:44:09 +00:00
David Nadoba 9cbe88dedd Move nightly-6.0 benchmark thresholds to 6.1 (#86)
6.0 nightly is gone. 6.1 was added somehow. Haven't found a PR for that
though. Not sure how that has changed.
2025-01-25 08:33:01 +00:00
michael-yuji 24d6a08b2e fix amd64 support (#85)
Fix when "${CMAKE_SYSTEM_PROCESSOR}" is lowercase "amd64"
2025-01-24 10:09:53 -08:00
Cory BenfieldandNicolas Bachschmidt ae33e5941b Merge commit from fork
* Throw error instead of halting when the encoding is invalid

Signed-off-by: Cory Benfield <lukasa@apple.com>

* Avoid extra precondition failure

---------

Signed-off-by: Cory Benfield <lukasa@apple.com>
Co-authored-by: Nicolas Bachschmidt <nicolas@nunk.net>
1.3.1
2025-01-14 14:18:46 +00:00
Franz Busch c27bcbd7ec Update release.yml (#84)
Update the release.yml file with the latest label changes
2024-12-18 14:14:56 +01:00
Rick Newton-Rogers fe261eeb42 Enable MemberImportVisibility check on all targets (#83)
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.
2024-12-13 15:11:01 +01:00
Franz Busch 15a8a271b4 Aligning semantic version label check name (#82) 2024-11-28 12:47:15 +01:00
Rick Newton-RogersandCory Benfield e647aabfb8 unify scheduled and main yamls (#79)
Co-authored-by: Cory Benfield <lukasa@apple.com>
2024-11-15 11:17:47 +00:00
Rick Newton-Rogers b65ee9bc34 add .editorconfig file (#80) 2024-11-14 15:59:53 +00:00
Franz Busch 892b611455 [CI] Enable Windows CI (#77)
# Motivation

We want to make sure our packages build on all supported platforms.

# Modification

This PR enabled the Windows CI.

# Result

Better test coverage in our package.
2024-10-23 10:43:11 +01:00
Peter Adams 8f3abb33b0 Remove script for updating contributors list (#78)
Motivation:

Contributors list is nolonger being maintained
as it can be trivially derived from git history.

Modifications:

Remove script for updating contributors list.

Result:

One fewer script
2024-10-22 16:38:52 +01:00
Rick Newton-Rogers 81ee7dc715 CI: concurrency=complete require-explicit-sendable (#76)
CI: concurrency=complete require-explicit-sendable

Motivation:

Adopt `-Xswiftc -strict-concurrency=complete -Xswiftc
-require-explicit-sendable` in CI to lock-in concurrency-safety wins.

Modifications:

Added strict flags to pull request and scheduled GHA CI on Swift 6.0.

Result:

CI should ensure we don't regress data-race safety on Swift 6.0.
2024-10-17 09:36:37 +01:00
Rick Newton-Rogers b4353f4ec9 Remove legacy CI docker/script files (#75)
Motivation:

Now that we have cut over to GitHub Actions we can remove files
supporting the old workflow.

Modifications:

Remove docker and stubbed-out script files.

Result:

Nothing should change because GHA is now used as CI.
2024-10-15 14:32:08 +01:00
Rick Newton-Rogers d016643222 Migrate to GitHub Actions reusable workflows (2) (#74)
* Prepare repo for new GHA checks

Motivation:

Migrate to GitHub Actions reusable workflows (2)

Modifications:

* Add GHA PR label checks
* Add GHA benchmarks checks
* Satisfy soundness checks

Result:

New soundness checks should be green and ready for adoption

* review comments
2024-10-15 13:04:58 +01:00
Cory Benfield 7faebca1ea Drop Swift 5.8 (#69)
We no longer support Swift 5.8, so let's wave it goodbye
1.3.0
2024-10-14 11:13:45 +00:00
Peter AdamsandCory Benfield aeb9c927fd More Sendability annotiations (#72)
Motivation:

Completing annotations helps with coverage for consuming projects.

Modifications:

Mark more things and Sendable or not.

Result:

Consuming libraries more likely to get correct usage.

Co-authored-by: Cory Benfield <lukasa@apple.com>
2024-10-14 10:49:11 +00:00
Peter Adams 9969712080 yamllint fixes (#73) 2024-10-14 11:43:24 +01:00
Rick Newton-RogersandFranz Busch 381bf08f8f Migrate to GitHub Actions reusable workflows (1) (#70)
* Migrate to GitHub Actions reusable workflows (1)

Motivation:

Migrate to GitHub Actions reusable workflows whilst keeping CI green.

Modifications:

As the first step in migrating to use GitHub actions this PR provides
the workflows which will be used in the future, at first in disabled
state so that we can keep CI green during the changeover.

Result:

Once this PR is merged we can:
* Enable the new CI
* In a future PR neutralize the old CI scripts
* Disable the old CI via GitHub
* In a future PR Delete the old CI scripts

* add scheduled GHA CI

* Update .github/workflows/pull_request.yml

Co-authored-by: Franz Busch <privat@franz-busch.de>

* review comments

---------

Co-authored-by: Franz Busch <privat@franz-busch.de>
2024-10-10 10:46:42 +01:00
aryan-25 a6cdd4d974 Add support for CRLF line endings to PEMDocument (#68)
* Add support for CRLF line endings to `PEMDocument`

* Remove `lineEnding` as an argument and instead detect line ending automatically.

* Fix description

* Refactor
2024-10-09 10:38:02 +01:00
1a80ac7e4b Update Swift targets to enable ExistentialAny (#65)
Motivation:

With the advent of Upcoming Feature Flags https://www.swift.org/blog/using-upcoming-feature-flags/ ,
we should make it a one-liner to enable feature flags.

As a follow-on to PR 63, we should enable the ExistentialAny feature flag, as
the code currently complies, and we may as well help flag any unintentional
regressions to that behavior.

Modifications:

Update Package.swift to allow for one-liner additions of new feature flags.
Enable the upcoming feature flag ExistentialAny

Result:

Better confidence that we don't break downstreams that compile this code with
ExistentialAny enabled.
Makes it (slightly) easier for future authors to modify the set of enabled feature flags.

Co-authored-by: Paul Seligman <pseligman@apple.com>
Co-authored-by: Cory Benfield <lukasa@apple.com>
2024-09-19 10:38:22 +01:00
Cory Benfield 64d3644b6b Update nightly benchmark thresholds (#67) 2024-09-19 10:41:29 +02:00
LamTrinh.Dev 60b2af8382 Update link for swift-docc-plugin repository. (#64) 2024-09-17 03:18:11 -07:00
Paul SeligmanandPaul Seligman dd8cacc283 Update code to compile without issue when ExistentialAny enabled (#63)
Motivation:

We should feel confident that we compile clean when built in an environment
that has enabled upcoming Swift features.

When compiling swift-asn1 specifying `.enableUpcomingFeature("ExistentialAny")`
there are some minor warnings emitted by ASN1.swift.

Modifications:

Minor code changes to address surfaced warnings

Result:

Better confidence that we don't break downstreams that compile this code with
these upcoming features enabled.

Co-authored-by: Paul Seligman <pseligman@apple.com>
2024-09-13 23:59:52 -07:00
LamTrinh.Dev cc2468226c Correct the link of sswg-security at SECURITY.md (#62) 2024-09-09 02:43:24 -07:00
Franz Busch 7b4b3c7a81 Add release.yml (#61) 2024-09-06 13:10:28 +01:00
Peter Adams 544ffa8eae Use filePath for test assert location (#59)
Motivation:

This is consistent with what underlying assert does.
Swift 6 warns about this mismatch

Modifications:

Use filePath for test assert location

Result:

Consistency in test assert location reporting
2024-08-12 16:08:42 +01:00
Alex Hoppen df5d2fcd22 Update swift-syntax link to swiftlang/swift-syntax (#57) 1.2.0 2024-06-25 07:51:02 -07:00
Clinton Nkwocha 41bee14cff Add rawFractionalSeconds property to GeneralizedTime (#53)
Motivation:

There is a possible overflow when computing a `Double` value for `fractionalSeconds` from an `ArraySlice` of bytes. Hence, access to this original `ArraySlice` is necessary.

Modifications:

- Add `rawFractionalSeconds` property to `GeneralizedTime`.
- Add a new `internal init` to `GeneralizedTime` that accepts `rawFractionalSeconds` instead of `fractionalSeconds` and generates the later from the former.
- Adjust the algorithm for computing `fractionalSeconds`, from a mathematical to a `String` computation. This is due to the precision mismatch between the mathematical computation and the native `Double` computation. This issue, which previously did not surface, now does, due to the newly included round-trip conversion from `fractionalSeconds` to `rawFractionalSeconds`.

Result:

- The `rawFractionalSeconds` property now provides the original `ArraySlice` from which `fractionalSeconds` was computed.
- `GeneralizedTime` can now compute `fractionalSeconds` from the provided `rawFractionalSeconds`.
2024-06-19 08:26:50 -07:00
aryan-25andCory Benfield e61ef9579a Add initializers for ASN1ObjectIdentifier (#56)
* Add initializers for ASN1ObjectIdentifier

* Added comments to public symbols. Updated error name.

* Add new Substring initializer. Refactor UInt Collection initializer.

---------

Co-authored-by: Cory Benfield <lukasa@apple.com>
2024-06-18 06:18:58 -07:00
Neil Jones 77e4ab7683 add support for riscv64 (#55) 2024-06-17 12:44:59 -07:00
Cory Benfield 9702323ae1 Swift 6 preparedness (#54)
Motivation

We should feel confident that we compile clean under the strict
checks of Swift 6. As this is a data-processing-only framework
it's not a surprise that it turns out to be fine, but this patch
adds the necessary docker-compose steps to ensure it continues
to work.

Modifications

- Add docker-compose file for Swift 6 nightlies
- Extend docker-compose to pass explicit sendable and strict
    concurrency checks
- Add those checks to 6.0 and main nightlies

Result

Better confidence that we don't break our downstreams in Swift 6
support.
2024-06-10 07:20:20 +01:00