Skip to content

chore: ignore root-level compiler intermediates - #1296

Draft
grdsdev wants to merge 1 commit into
mainfrom
guilhermesouza/gitignore-root-compiler-artifacts
Draft

grdsdev wants to merge 1 commit into
mainfrom
guilhermesouza/gitignore-root-compiler-artifacts

Conversation

@grdsdev

@grdsdev grdsdev commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

A build once left 252 files in the repository root — ASN1.o, ASN1.dia, MuSig+Nonces.swiftdeps and the like, 63 basenames × 4 extensions. The 63 match the shared sources of swift-secp256k1's P256K target one for one. Nothing ignored them, so a git add -A committed them and the commit had to be rewritten.

Cause is upstream, not a misconfiguration here. These belong in .build/ or DerivedData, and both are configured correctly: there is no WorkspaceSettings.xcsettings overriding the build location, and Xcode's IDEBuildLocationStyle / IDECustomBuildLocationType defaults are unset. P256K takes its sources from a build-tool plugin's output directory, and SwiftPM bug #7930 then writes the per-file intermediates relative to the build process's working directory. SharedSourcesPlugin's own header documents the leak and suggests a cleanup find.

Root-anchored, not bare globs. *.o would hide a file anywhere in the tree; these only ever appear beside Package.swift. git ls-files | grep -E '\.(o|d|dia|swiftdeps|swiftmodule)$' is empty, so nothing tracked is masked.

Verified both directions:

Path Result
ASN1.o, ASN1.d, ASN1.dia, ASN1.swiftdeps, MuSig+Nonces.swiftdeps, Foo.swiftmodule ignored, each attributed to its rule by git check-ignore -v
Sources/Probe/Nested.{o,d,dia,swiftdeps} not ignored (exit 1); git status still reports the directory

No cleanup trap added to scripts/test-docs.sh or scripts/xcodebuild.sh, deliberately. Neither compiles P256K — a -dry-run plan for -scheme Supabase contains no P256K, libsecp256k1 or SharedSourcesPlugin entry — so a trap there would look like a fix while never firing on the real cause. And the upstream command deletes on globs as generic as *.d at the repo root; a docs script silently removing untracked files it never created is a bad trade once these are ignored.

The exact trigger is still not reproducible on demand, which is the one loose end here. Everything tried, none of which leaked a single file:

Attempt Result
swift build --build-tests, recompiling all 63 P256K sources no leak
wiping the plugin output directory to re-run its prebuildCommand no leak
swift package dump-symbol-graph no leak
./scripts/test-docs.sh in isolation no leak
swift build with .build/…/debug/P256K.build deleted (cold P256K) no leak
dump-symbol-graph with the index-build and swift-dce-index P256K.build dirs deleted no leak

So the ignore rules are the fix that holds regardless: the leak is real and has recurred several times during unrelated work, but nothing identifies a command to hang a targeted cleanup off. That is also the second reason not to add a trap to a specific script — there is no evidence any particular script is the one that leaks.

A build once left 252 files in the repository root — `ASN1.o`, `ASN1.dia`,
`MuSig+Nonces.swiftdeps` and the like, 63 basenames times four extensions. The
63 match the shared sources of swift-secp256k1's `P256K` target one for one.
Nothing ignored them, so a `git add -A` committed them and the commit had to be
rewritten.

These belong in `.build/` or DerivedData, and both are configured correctly:
there is no `WorkspaceSettings.xcsettings` overriding the build location and
Xcode's build-location defaults are unset. The cause is upstream. `P256K` takes
its sources from a build-tool plugin's output directory, and SwiftPM bug #7930
then writes the per-file intermediates relative to the build process's working
directory. SharedSourcesPlugin's own header documents the leak.

Root-anchored patterns rather than bare globs: `*.o` would hide a file anywhere
in the tree, and these only ever appear beside Package.swift. Verified both
ways — the seven root spellings are ignored, the same extensions nested under
Sources/ are not.

No cleanup trap added to the build scripts. Neither compiles `P256K`: a
`-dry-run` plan for `-scheme Supabase` contains no `P256K`, `libsecp256k1` or
`SharedSourcesPlugin` entry, so a trap there would not fire on the real cause,
and an unconditional root-level `find -delete` for globs as generic as `*.d`
would remove untracked files the script never created.
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 33062826035

Coverage remained the same at 87.101%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 10613
Covered Lines: 9244
Line Coverage: 87.1%
Coverage Strength: 1011900.84 hits per line

💛 - Coveralls

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Capability matrix drift detected

The following capabilities are marked implemented in the matrix but could not be found in swift:

  • client.session_management.persist_session → expected symbol: AuthLocalStorage.defaultLocalStorage
  • functions.invocation.streaming_response → expected symbol: FunctionsClient._invokeWithStreamedResponse

The following capabilities are marked implemented in swift but have no registered symbols to verify:

  • auth.passkey.register_passkey (no symbols list — cannot confirm implementation exists)
  • auth.passkey.sign_in_with_passkey (no symbols list — cannot confirm implementation exists)
  • client.observability.trace_propagation (no symbols list — cannot confirm implementation exists)
  • database.using_modifiers.request_cancellation (no symbols list — cannot confirm implementation exists)
  • functions.invocation.request_cancellation (no symbols list — cannot confirm implementation exists)
  • storage.file_buckets.url_cache_nonce (no symbols list — cannot confirm implementation exists)

These may have been renamed, removed, or never registered. Please update the capability matrix.
See: https://github.com/supabase/sdk/blob/main/packages/capability-matrix/docs/capability-matrix.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants