Skip to content

Update swift-log/swift-protobuf and support trait-disabled builds - #58

Merged
trasch merged 1 commit into
mainfrom
update_dependencies_trait_build
Oct 22, 2026
Merged

trasch merged 1 commit into
mainfrom
update_dependencies_trait_build

Conversation

@trasch

@trasch trasch commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Updates swift-log to 1.16.2 and swift-protobuf to 1.39.0
  • gis-tools remains at 3.0.0-beta.1: every gis-tools-* format package pins it to exact: "3.0.0-beta.1", so bumping it alone fails resolution. This constraint is now documented in Package.swift.
  • Makes the package build with any trait combination, including no traits at all.

Trait-disabled builds

swift build / swift test without --enable-all-traits previously failed because the CLI and CLI tests called coders that only exist with the corresponding trait enabled:

  • Sources/MVTCLI/TileFormat.swift: loadTile(from:) cases for MLT/FIT/GPX/CSV/Shapefile/GeoPackage are now guarded by #if Enable…; otherwise they throw a new TileFormat.unavailableError ("Format 'mlt' is not available in this build (enable the corresponding package trait)").
  • Sources/MVTCLI/WriteTile.swift: same guards for the write path.
  • Format-specific tests and test helpers are wrapped in their traits (Tests/MVTCLITests/*, TileDataContentConsistencyTests).
  • Formats are still recognized on the command line (extension / --output-format) when the coder is not compiled in; they fail with the runtime error above instead of a compile error.

Also removed a few pre-existing warnings (unnecessary try, unused createFile results).

Verification

No compiler warnings in any configuration.

Configuration Library tests CLI tests
no traits 117 / 17 suites 47 / 8 suites
--traits EnableMLT 176 / 25 54 / 8
--traits EnableCSV,EnableGPX 126 / 19 60 / 8
--enable-all-traits 198 / 30 82 / 8

Dependencies:
- swift-log 1.14.0 -> 1.16.2
- swift-protobuf 1.38.1 -> 1.39.0
- gis-tools stays at 3.0.0-beta.1 because every gis-tools-* format
  package pins it exactly; documented in Package.swift.

Trait-disabled builds (e.g. a plain `swift build`) previously failed
because the CLI and CLI tests referenced coders that are gated behind
package traits. Format load/write paths and format-specific tests are
now guarded by #if Enable…; unbuilt formats are still recognized on the
command line but fail with a clear runtime error.

Also fix a few pre-existing compiler warnings in the tests.
@trasch trasch self-assigned this Oct 22, 2026
@trasch trasch added the bug Something isn't working label Oct 22, 2026
@trasch
trasch merged commit 99fe00a into main Oct 22, 2026
1 check passed
@trasch
trasch deleted the update_dependencies_trait_build branch October 22, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant