* 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>
### 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.
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.
### 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.
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>
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.
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.
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.
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.
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.
### 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.
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
* 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>
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.
# 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.
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
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.
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.
* 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
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>
* 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>
* Add support for CRLF line endings to `PEMDocument`
* Remove `lineEnding` as an argument and instead detect line ending automatically.
* Fix description
* Refactor
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>
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>
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
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`.
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.