hoangsonww / hoangsonww/Diffuse-Native-Apps

Add a CI job that builds against the oldest supported Xcode to stop SDK drift

Open
#13 0 comments 0 reactions 1 assignee Claimed by @hoangsonww View on GitHub
accessibility bug documentation enhancement good first issue help wanted question
Dominant language
Swift
Stars
2
Forks
0
Avg merge
1h 53m
Merged PRs (30d)
14

Description

## Motivation

Three separate build breaks reached `master` and were only caught after the fact, all with the same shape: code that compiles on a current Xcode but not on the one CI runs.

- `Canvas.swift` called `tabBarMinimizeBehavior` behind `#available(iOS 26.0, *)`. `#available` is a *runtime* check, so the symbol still has to resolve at compile time and an older SDK fails outright.
- `RetentionPlannerTests.swift` wrote ages as `10 * 86400` inside a labelled-tuple array literal; older Swift will not propagate `Double` into those elements and infers `Int`.
- `CollectorTests.swift` passed `(102_400 + 51200) * 1024` to an `Int64` parameter.

Each was invisible locally on Xcode 26.6 / Swift 6.3.3 and only surfaced in CI on macos-15 — and because the compiler stops at the first failing target, each fix merely uncovered the next. The repository has an explicit cross-SDK guard (`Scripts/crosscheck.sh`) but nothing guarding the *toolchain* axis.

## Proposed Solution

Add a matrix dimension to `ci.yml` covering the minimum supported Xcode alongside the current one, using `maxim-lobanov/setup-xcode` or an explicit `DEVELOPER_DIR` against a runner image that ships it. The minimum version becomes a documented, enforced contract rather than a property of whichever runner image is current.

Pair it with a lint that flags `#available` guarding a symbol newer than the declared minimum SDK without a matching `#if compiler(>=…)` gate — the exact `Canvas.swift` failure — so the class of bug is caught at review rather than in CI.

## Acceptance Criteria

- [ ] `ci.yml` builds and tests against both the minimum and current supported Xcode
- [ ] The minimum supported Xcode / Swift version is stated in `Documentation/TechStack.md` and `CONTRIBUTING.md`
- [ ] The three fixes above are covered by regression tests that would fail on the older toolchain
- [ ] A failure on the minimum toolchain reports which target and which construct broke
- [ ] `Documentation/Troubleshooting.md` gains a section on toolchain-dependent inference failures
- [ ] Job runs in parallel and does not extend wall-clock CI time materially

## Additional Context

Fixed in `8912d1c`, `f6199fa`, `f14e99f`. The point of this issue is to make the *class* of failure impossible to reintroduce.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.