build: add swift package for local builds#172
Merged
Conversation
Add Package.swift vending the `Mx` library. With MX_LOCAL_CHECKOUT set, `Mx` is a source target compiled from this checkout -- the path a sibling consumer (komp) takes via `.package(path:)`. SPM globs the C++ sources under src/private (minus the Catch2 runner, the test suites, and the examples) with the mx::api headers in src/include as the public surface. Without the variable the manifest fails loudly; the binary xcframework release is follow-up work. Add a macOS swift-local CI job that builds the package in local-checkout mode on every pull request, covering the SPM / AppleClang source build alongside the CMake gates.
gen-quality
|
Coverage reportCore-dev coverage
|
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 77.9% | 28505 / 36590 |
| Functions | 74.4% | 6354 / 8542 |
| Branches | 50.7% | 22645 / 44673 |
API coverage src/private/mx/{api,impl,utility}/
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 68.7% | 4734 / 6895 |
| Functions | 53.5% | 1507 / 2816 |
| Branches | 40.3% | 3851 / 9562 |
Core HTML report | API HTML report
Commit bf0ccebc2a17c9c5cc5c326d845c5827af60e1d5.
mx::api modeled xs:decimal/float/double values as long double, but the
impl only widens core doubles into them, so they never hold extra
precision -- and writing them back via brace-init (core::Decimal{ v })
is a long double -> double narrowing that Clang rejects as ill-formed
while GCC merely warns. That split broke every AppleClang build (the
macOS CMake job and the new Swift package).
Make api::Double a double and sweep the stray literal long double
declarations and their L-suffixed literals to match. xs:* values are
<= 64-bit and long double == double on Apple silicon, so this loses
nothing and removes the narrowing at the root.
gen-quality
|
Coverage reportCore-dev coverage
|
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 77.9% | 28505 / 36590 |
| Functions | 74.4% | 6354 / 8542 |
| Branches | 50.7% | 22645 / 44673 |
API coverage src/private/mx/{api,impl,utility}/
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 68.7% | 4734 / 6895 |
| Functions | 54.8% | 1475 / 2692 |
| Branches | 40.3% | 3848 / 9556 |
Core HTML report | API HTML report
Commit b5cdacd695d6e20386f38953d0e11b0d1cec6e0b.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Compile
mxas a Swift package so a sibling consumer can depend on it via.package(path:)for local-checkout development.Package.swiftvends theMxlibrary.MX_LOCAL_CHECKOUTselects the mode:swift-localci job builds the package in local modeAlso fixes the AppleClang charconv error on
from_chars/to_charsBase:
musicxml-4.0(feeds #169).