From 881c2adb974fb9fedc44b6a51e3db96c09722e20 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Thu, 27 Aug 2026 07:21:18 -0300 Subject: [PATCH] chore: ignore root-level compiler intermediates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .gitignore | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.gitignore b/.gitignore index 54126a4de..4816c9bac 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,24 @@ playground.xcworkspace .build/ +# Per-file compiler intermediates leaked into the working directory. +# +# These belong in .build/ (SwiftPM) or DerivedData (Xcode), and both are configured correctly — +# nothing here overrides the build location. SwiftPM bug #7930 writes them relative to the build +# process's working directory instead, for a target whose sources come from a build-tool plugin's +# output directory. swift-secp256k1's `P256K` is such a target: its 63 shared sources are copied +# in by SharedSourcesPlugin, and its own plugin header documents the leak. One observed run left +# 252 files (63 basenames x 4 extensions) in the repository root, where a `git add -A` committed +# them. +# +# Root-anchored on purpose. A bare `*.o` would silently hide a file anywhere in the tree; these +# only ever appear beside Package.swift. +/*.o +/*.d +/*.dia +/*.swiftdeps +/*.swiftmodule + # CocoaPods # # We recommend against adding the Pods directory to your .gitignore. However