Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cargo no longer excludes temp files from backups on macOS #7189

Closed
calebmarcus opened this issue Jul 30, 2019 · 3 comments · Fixed by #7192
Closed

Cargo no longer excludes temp files from backups on macOS #7189

calebmarcus opened this issue Jul 30, 2019 · 3 comments · Fixed by #7192

Comments

@calebmarcus
Copy link

In 1.36.0, cargo no longer excludes directories in target from Time Machine backups on macOS machines (see #3884).

To reproduce: Delete the target directory for some project, and run a build. Run xattr -r target and note that there is no attribute com.apple.metadata:com_apple_backup_excludeItem applied to any subdirectories (if nothing has any extended attributes, it will not print anything.) Try the same with a prior version such as 1.35.0, and it will apply that attribute to subdirectories of target.

This regression seems to have been introduced in 8258ca4 -- from what I can tell (and it's entirely possible that I'm completely misreading the situation!), the issue is that the directory that is to be excluded from backups upon creation is actually not created in Layout::prepare as might be expected -- it winds up being created earlier, in Layout::at, when it calls open_rw on the flock::Filesystem. Reverting that change would fix the problem, but I hope there might be a more elegant way to fix it that still maintains the spirit of that change (not updating that bit of metadata every time!)

alexcrichton added a commit to alexcrichton/cargo that referenced this issue Jul 30, 2019
This fixes an accidental regression from rust-lang#6880 identified in rust-lang#7189 by
moving where the configuration of backup preferences happens since it
was accidentally never happening due to the folder always having been
created.
@alexcrichton
Copy link
Member

Oops sorry about that, and thanks for the report! Mind testing out #7192 to see if it works for you?

@calebmarcus
Copy link
Author

Hey - that does the trick. This is a neat feature, by the way -- At some point I realized how big these directories were, went to go figure out whether they were in my backups, and realized they were already magically excluded! So, thanks to @kornelski for thinking of this. Some third-party backup software respects that attribute too.

@alexcrichton
Copy link
Member

Ok great, thanks for checking!

bors added a commit that referenced this issue Jul 31, 2019
Fix excluding target dirs from backups on OSX

This fixes an accidental regression from #6880 identified in #7189 by
moving where the configuration of backup preferences happens since it
was accidentally never happening due to the folder always having been
created.

Closes #7189
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 a pull request may close this issue.

2 participants