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
carthage copy-frameworks produces "The file couldn’t be saved." error #3056
Comments
same error
The contents of Script-2D6F48152518F1F300CCDBE0.sh
Only one solution for me : Reboot MAC (clean derived data, don't work!) |
Clearing DerivedData should not help, the problem is in the $TMPDIR/TemporaryItems folder, hypothetically, it should be cleared when the computer is restarted, which in theory should help, but on my build machine, frequent reboots are not possible |
Add to
|
@caobug tempo fix work for me 👍 |
+1 |
Thanks @caobug. I had to remove the first forward-slash from the command to get it to work:
Otherwise it was resulting in a path like |
I ran into this issue and restarting solved the issue. The proposed fix in the comments didn't worked for me thought (with and without the /) |
I started to face this issue today morning and after I deleted all from |
This command does not work on my machine, I tried to run it on Terminal and it gives
then just remove all directories created by Carthage (named |
@kientux You can work around it by enabling Full Disk Access for Terminal (or, your build manager if you're using CI with remote machines). |
@kientux I had the same issue, so you should enable Xcode App on Full Disk Access. |
Only the (Xcode) "Full Disk Access" not working for me, have to add this:
|
@norbdev I Use this lines |
At scale on CI machines, the limit is reached pretty fast. Most of my CI machines reached the 1000 limit inside |
Thank @caobug . It's work |
@norbdev |
@Droppix have you tried enabling full disk access for Xcode? |
@raducanb |
If we do it this way on CI machine, it means fetching and building dependencies each time. Do we have a better approach? @simonpierreroy do you have such a problem? |
@SValchyshyn you want to delete just |
Enabling full disk access for Xcode solved this issue for me. |
This happens on my CI machine as well. None of the fixes above work. I have to manually restart the machine. |
This looks like it could be caused by a CI runner without proper access rights. Have you checked whether it also has full disk access rights? |
If you use TeamCity as the CI, its probably overrides $TMPDIR, therefore I try this workaround as a (Custom script) TeamCity Build Step: echo 'import Foundation
let ls = Process()
ls.executableURL = URL(fileURLWithPath: "/usr/bin/env")
ls.arguments = ["bash", "-c", "set -x && rm -rfv " + NSTemporaryDirectory() + "TemporaryItems/*carthage*"]
try ls.run()
' | swift (I haven't found a simpler method to recover $TMPDIR) |
This one works in Xcode run scripts:
|
EDIT2: Problems persists even with added permissions I also see it happen on |
Any news on this one? |
For those who don't want to do that manually, I've written a simple python script in order to navigate around that nasty #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import glob
import os
import shutil
import tempfile
if __name__ == "__main__":
tmpdir = os.path.join(tempfile.gettempdir(), "TemporaryItems")
for f in glob.glob(f'{tmpdir}/*carthage*/'):
shutil.rmtree(os.path.join(tmpdir, f), ignore_errors=True) then on terminal $ python /path/to/script.py should clean the folders inside tmp folder created by Carthage. PS: Don't forget to grant write permission: |
FYI it looks like this issue is fixed in the latest release!! (0.36.1) 🎉🎉🎉🎉 |
That would be awesome. I‘ll try to verify that on Monday. Thanks for the heads-up! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
which carthage
:carthage version
: 0.36.0xcodebuild -version
: Build version 11E801a--no-build
? No--no-use-binaries
? No--use-submodules
? No--cache-builds
? Yes--new-resolver
? NoActual outcome
Xcode project build fails, because command "carthage copy-frameworks" returns non zero result, with error: "The file couldn’t be saved."
My investigation showed that the problem was a failed attempt to create a temporary directory due to reaching the maximum allowed limit of 1000 temporary directories. I found information about this limit on the forum https://developer.apple.com/forums/thread/128927
The complete error looks like this: Error Domain = NSCocoaErrorDomain Code = 512 "The file couldn’t be saved."
The code in which the error occurs:
Expected outcome
Carthage should clean up the created temporary folders at the end of the work in order not to reach this limit, or issue human-readable errors with guidance for further actions, instead of the system error "The file couldn’t be saved."
The text was updated successfully, but these errors were encountered: