Repository navigation
swift-cidr 0.8.0
This release combines contextual address identity fixes, context-preserving iteration and endpoints, explicit containment operations, and consistent prefix parsing with an opt-in strict address policy.
Changes
- Correct IPAddress equality and hashing to use address bits and prefix context consistently, including Set/Dictionary keys, AnyIPAddress, and endpoint identity. Equality no longer traps when two IPv6 addresses are farther apart than Int128 can represent.
- Avoid the observed synthesized mixed-family enum-hashing alignment crash on x86-64 Swift 6.2/6.3 with explicit hashing implementations. Int128 stride behavior and the starting prefix context remain unchanged; the mixed-prefix inverse-law limitation is documented.
- Preserve parent prefix context during network iteration and shared CIDR first/last/range endpoints. Add an explicit addresses view with O(1) exact sequence membership.
- Add labeled hierarchical address and complete-subnet containment. Retain deprecated unlabeled overloads with their previous behavior.
- Apply one unsigned, unpadded ASCII prefix grammar through concrete, generic, Codable, CLI, and wrapper parsing. Add explicit strict address parsing, including rejection of padded dotted IPv4 tails within IPv6.
- Preserve compatible padded-decimal IPv4 ingestion for IANA workflows. Applications must carry the validated typed value or canonical addressLiteral into transport; reconnecting with original ambiguous text retains a resolver-mismatch risk.
Compatibility
This pre-1.0 minor version intentionally changes contextual equality, iteration/endpoints, generic membership, and malformed prefix acceptance. Review the migration guide before adoption, especially the unchanged CIDRNIO boundary policy and contextual request/reply matching.
Swift 6.2, macOS 15, and iOS 18 minimums remain unchanged, as do the four products and dependency requirements. Existing custom address families retain a compatible default parser and must explicitly implement strict support. The malformed IPv6 literal fixes already shipped in 0.7.1 are retained, not presented as new.
Validation before publication
- Complete optimized suites: 266 tests / 28 suites each on macOS Swift 6.3.3 and native x86-64 Linux Swift 6.2.4 and 6.3.3, including equality/hash regressions.
- Existing merged-main debug CI passed on both Linux toolchains and macOS 26; macOS 15 compatibility and iOS 18 simulator deployment-floor builds passed.
- Source API comparison against 0.7.1 reports no breaking declarations in all four products. This does not negate the intentional behavioral changes. All four DocC builds passed with warnings treated as errors.
- Coordinated local consumer validation passed optimized package tests, macOS and iOS simulator Release app builds for arm64 and x86_64 at the deployment floors, selected offline app tests, and a Release Mac Catalyst build. Live-service/UI tests and a documented pre-existing unrelated test failure were excluded.
- Every consumer used the same frozen candidate; primary repositories and tracked lockfiles were unchanged. These candidate results do not establish consumer resolution of the published 0.8.0 tag. Release-pin validation remains a separate post-publication step.
No performance experiment or speed claim is included. Parser sanitizer evidence from the behavior-equivalent implementation is retained; no sanitizer rerun was needed for these documentation-only edits. Four intentional deprecated compatibility-warning locations remain.
Full changelog: 0.7.1...0.8.0