Skip to content

Exclude derived data folders from from Xcode#64

Open
mdab121 wants to merge 3 commits intostevegrunwell:developfrom
mdab121:develop
Open

Exclude derived data folders from from Xcode#64
mdab121 wants to merge 3 commits intostevegrunwell:developfrom
mdab121:develop

Conversation

@mdab121
Copy link
Copy Markdown

@mdab121 mdab121 commented Dec 19, 2020

No description provided.

Comment thread tests/AsimovTest.php Outdated
Comment thread asimov Outdated
Co-authored-by: Jed Fox <git@jedfox.com>
Copy link
Copy Markdown
Owner

@stevegrunwell stevegrunwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the addition!

Copy link
Copy Markdown
Owner

@stevegrunwell stevegrunwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests failing here made me dig deeper, and I'm hoping someone with Xcode experience can help provide context.

From what I've read, Xcode will store build artifacts in the DerivedData/ directory, and this is usually(?) at a system-wide level (e.g. ~/Library/Developer/Xcode/DerivedData) — is this correct? If so, Asimov would be better-served blocking that directory.

As it stands now, the code in this PR tells Asimov "Look for a DerivedData directory that sits adjacent to...itself", which seems like a roundabout way of saying "Block all DerivedData directories from Time Machine backups. However, that runs counter to Asimov's more conservative "make sure there's a matching dependency file so we don't block anything accidentally" ethos.

Granted, "DerivedData" seems very unlikely to be anything else on a developer's machine (save for perhaps some Swift developer's musical side-project), but I'd like to better understand this directory before including it in Asimov, please.

@mdab121
Copy link
Copy Markdown
Author

mdab121 commented Dec 22, 2020

Hey!

Thanks for the response. You're right, that the DerivedData folder (which is basically build artifacts, indexes, etc) are located at ~/Library/Developer/Xcode/DerivedData by default.

However it's very common to have it in the project directory. I do that as an iOS developer, and I know many other devs that do. That's why it's also listed in the default .gitignore for XCode.

It's really a time machine killer, because these tend to be ~1GB even for a simple XCode project.


What i can suggest is to make it conditional to exclude DerivedData unless an XCode project file exists in the directory? Which would be anything like *.xcodeproj.

@stevegrunwell
Copy link
Copy Markdown
Owner

What i can suggest is to make it conditional to exclude DerivedData unless an Xcode project file exists in the directory? Which would be anything like *.xcodeproj.

I think that makes the most sense, but it'll require refactoring how the find command is utilized within Asimov, as test -e checks for the existence of a file, but doesn't account for wildcards.

We want to make sure that whatever we do here is still performant, but adding wildcard support would open up some opportunities.

@stevegrunwell stevegrunwell changed the title Exclude derived data folders from from xcdoe Exclude derived data folders from from Xcode Dec 30, 2020
django23 added a commit to django23/asimov that referenced this pull request Feb 19, 2026
…upport

Add glob pattern support for sentinel definitions so wildcards like
*.xcodeproj can be used. Sentinels containing '*' use sh -c with ls -d
for glob expansion instead of test -e, with no performance impact.

Add DerivedData *.xcodeproj entry to exclude Xcode build artifacts when
an Xcode project is present alongside the DerivedData directory.

Inspired by stevegrunwell#64 (props @mdab121).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants