Rome
Rome copied to clipboard
Error if carthage cache and rome cache have a file and directory with the same name
Bug Report
Rome terminates with the error if local Carthage cache contains a file, but a cached framework in Rome contains a folder with the same name (case 1). And vice versa, if local cache contains a folder, but framework has a file with the same name (case 2).
Steps which reproduce the bug
- Build version 1 of a framework with a file
abc.nib
and upload the framework to a Rome cache - Build version 2 of a framework with a folder
abc.nib
and upload the framework to a Rome cache - Have version 1 of a framework in local carthage/build folder
- Try to run
rome download
command
Current behavior
There is an error and Rome terminates with exit code 1: case 1:
Downloaded FrameworkName from: path/to/framework/framework_name-version.zip
rome: path/to/framework/FrameworkName.framework/abc.nib: openBinaryFile: inappropriate type (Is a directory)
case 2:
Downloaded FrameworkName from: path/to/framework/framework_name-version.zip
rome: path/to/framework/FrameworkName.framework/abc.nib: createDirectory: already exists (File exists)
Suggested behavior
Rome successfully updates the file/folder in local cache and continues execution.
Why would the enhancement be useful to most users
This error probably corresponds to a rare use case. My situation was that Rome is integrated in a CI/CD process run on several servers. These servers also have Carthage/Build folder cached. Several pipelines were running simultaneously, but they used different versions of a framework. And in this framework there was a change between versions and instead of a folder there was a file with the same name.
I mitigated the error by excluding that specific framework from Rome cache, but I'd like a more permanent solution.
This error was probably a cause for this issue (https://github.com/tmspzz/Rome/issues/215). Cleaning the cache in my case (shared carthage cache between CI servers) could work until someone uses older version of framework again.
Rome version:
0.24.0.65
OS and version:
MacOS 13.4