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

Workaround copy bug for APFS volumes #2032

Merged
merged 3 commits into from
Jun 30, 2017

Conversation

BobElDevil
Copy link
Contributor

Fixes #1982

Drop down to the C api for copying files so we can avoid using the APFS
cloning functionality, which has a bug that can result in invalid
binaries

Drop down to the C api for copying files so we can avoid using the APFS
cloning functionality, which has a bug that can result in invalid
binaries
@BobElDevil
Copy link
Contributor Author

If anyone knows how to programatically check whether we're on an APFS volume or not, I could make that check and only do this modified copy in that situation.

@jdhealy
Copy link
Member

jdhealy commented Jun 28, 2017

Awesome work on this, great stuff!

check whether we're on an APFS volume or not

Took some wrangling, but URLResourceKey.volumeSupportsFileCloningKey should indicate enough for us to avoid the bug.

Give me your comments on those commits, and pending your approval (of course), I can just push them right into this PR…

@BobElDevil
Copy link
Contributor Author

Left some comments on the commits. Thanks for looking into the volume check

@jdhealy
Copy link
Member

jdhealy commented Jun 28, 2017

Changes are up.

Good notes on volumeSupportsFileCloning (now, func volumeSupportsFileCloning() throws -> Bool) — using a throwing method we actually lost some lines, despite improving error messaging. 🎉

…copyItem(at:to:avoiding·rdar·32984063:)`.

Comments migrated to Quick Help markup.
@BobElDevil
Copy link
Contributor Author

Looks good, you just missed changing the call site:
try from.volumeSupportsFileCloning.dematerialize()
Needs to be
try from.volumeSupportsFileCloning()

Then I think we're good to go

@mdiep
Copy link
Member

mdiep commented Jun 29, 2017

I don't love that we have to do this, but it seems like this is a reasonable workaround. Thanks for tackling it! I'll let the two of you keep going with this and merge it. 👍

@BobElDevil
Copy link
Contributor Author

I think we've each reviewed each others portion so I'm gonna go ahead and merge this 🎉

@BobElDevil BobElDevil merged commit e6629d0 into Carthage:master Jun 30, 2017
@BobElDevil BobElDevil deleted the CopyItemWorkaround branch June 30, 2017 17:02
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.

3 participants