Setting TimeMachine exclusions on build directories?

I've been going through this exercise of excluding a number of directories from my Time Machine backups because they often contain thousands of tiny files that are easily regenerated. This can really help speed Time Machine backups, especially first-time backups (which I find I have to do far too often).

It would be handy if swift build (and maybe SPM) could set the tmexclusion flags when they create some of these temporary directories.

Thoughts?

3 Likes

I think that would be reasonable if you're interested in filing an issue or opening a PR. We could probably apply it at the same time as the created-by-build-system xattr on top-level build directories.

2 Likes

Which repo would that be? And if you want to point me to where the created-by-build-system xattr gets applied, I’d be happy to take a stab at implementing it and submitting a PR.

This is already done in Exclude scratch directory from Time Machine backups by MahdiBM · Pull Request #10464 · swiftlang/swift-package-manager · GitHub. Should make it to Swift 6.5.

3 Likes

oh yeah, I guess I forgot that already landed

I've put up a cherry-pick PR for this to be cherry picked for Swift 6.4.3 if possible.
Would be nice to not have to wait until Swift 6.5.

1 Like

Ah I missed that part.

Though personally it'd be fine for me as I use VSCode and i'll just switch the toolchain whenever it's released.

I'm assuming there will be a Swift 6.4.3 release for Darwin, just not an Xcode release to accompany it? Or is it totally no 6.4.3 for Darwin?