Carthage: cartfile name is caseignore

Created on 6 Jun 2016  Ā·  7Comments  Ā·  Source: Carthage/Carthage

I found that when cartfile file named cartfile is also works on carthage update in current project, but when your project is referenced with other project, only Cartfile name works for identify dependency.

bug help wanted

Most helpful comment

I suppose if we wanted make this more user friendly, we could return a specific message [via an added CarthageError] specifying that a file named cartfile was found and suggest to the user to update the file name.

I’d encourage you to open a PR with [WIP] at front of the title — fine to have a temporary CarthageError.readFailed at first. We could collaborate on implementing and communicating that message/error later in that same PR.

Thanks! šŸ‘

All 7 comments

This happens because the current project's Cartfile is read from the working dir, which is usually on a case-insensitive file system, while the dependencies' Cartfiles are read from Git, which is case sensitive.

Thanks @mdiep, make sense to me

I'm going to reopen this because we should address it if possible

Given that this issue is based on the behavior of the file system and there is no Foundation solution for enforcing case sensitivity. I have identified two areas where we could validate the file correctness; Project.loadCombinedCartfile() or Cartfile.from().

If this feature is to be implemented I feel the best place to put the validation is in the Project.loadCombinedCartfile(). The Cartfile and Cartfile.private names are already accessed in this method. I could simply add a validation step which would ensure the name of the file in the URL matches the expected name of the file from the Constants.Project type.

@mdiep Thoughts?

That sounds reasonable to me. šŸ‘

I am planning on treating this as a CarthageError.readFailed and still returning a NSFileReadNoSuchFileError as the underlying error. Unless you see another reason to return a different error.

I suppose if we wanted make this more user friendly, we could return a specific message specifying that a file named cartfile was found and suggest to the user to update the file name. I could do that as well. However, I do not see a suitable CarthageError that would work for relaying such a message. So, I would need to add new CarthageError.

I will start with the validation. But would like to discuss whether or not it makes sense to add the suggestion as well.

I suppose if we wanted make this more user friendly, we could return a specific message [via an added CarthageError] specifying that a file named cartfile was found and suggest to the user to update the file name.

I’d encourage you to open a PR with [WIP] at front of the title — fine to have a temporary CarthageError.readFailed at first. We could collaborate on implementing and communicating that message/error later in that same PR.

Thanks! šŸ‘

Was this page helpful?
0 / 5 - 0 ratings

Related issues

robb picture robb  Ā·  57Comments

NachoSoto picture NachoSoto  Ā·  36Comments

davbeck picture davbeck  Ā·  54Comments

mstfy picture mstfy  Ā·  72Comments

gregorpichler picture gregorpichler  Ā·  30Comments