ekazaev / ChatLayout

ChatLayout is an alternative solution to MessageKit. It uses custom UICollectionViewLayout to provide you full control over the presentation as well as all the tools available in UICollectionView. It supports dynamic cells and supplementary view sizes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Xcode version 13.2 build issue

farshadmb opened this issue · comments

Hi bro,
I use Xcode 13.2 as a daily basis IDE. however, I met a compile error segmentation fault 11 for some files such as StateController line 675 columns 13. I've also realized that there is no Xcode backward compatibility. I've wondered so much as well.

Do you have any clue what's wrong with it?

@farshadmb hi. No. Not really. And I don’t have the Xcode 13.2 at this moment. Can you please try one of the previous versions to check if it compile. But this issue means that it is the compiler bug.

Ill have a look later

@ekazaev hi, bro, I actually did it. look at commit id c48557a1cfd659714981fad6eb04242898d6e949. everything works fine.
Also, I tried to build commit by commit. if you move from mentioned commit to the head commit, Xcode would not build at all.

One more thing, in some cases you try to make mutable some properties by using exactly the same name. Swift 5.5 and later are fine but earlier versions make compiler present errors.

var sections = sections

https://github.com/farshadmb/ChatLayout/blob/6f66082bf5f78fe82b85b34c8fc02e9960dde77a/ChatLayout/Classes/Core/Model/LayoutModel.swift#L151

@ekazaev I highly encourage you to create a GitHub action workflow to run test cases on a specified Xcode version.
I would like to create one for you.

segmentation fault 11 It is a bug in the compiler in the first place, but this fact is not even important in this case. Another thing is that I have already moved to swift 5.7 at the end of July and where that expression is a valid string. I can fix it but you may get some next problem with #unavailable or something like this as XCode 13.2 is not even the latest XCode 13 version. So I am not sure if I have to do something about it, as if you are using the previous version of the compiler, probably it worth to use an older version of the library that is written in swift 5.2. There is nothing wrong with it and you are clearly not interested in the fixes added for IOS 16 SDK that were added later.

So I am not sure what action to take here TBH. If you are for some reason temporary can not update but intrested in the latest version of the library - Id say it probably worth to have a temporary fork of the library where you fix those issues until youll be able to move to swift 5.7. @farshadmb What do you think?

Regarding GitHub action - please do. Ill appreciate it.I used travis while it was free. But I dont have any CI any more.

@ekazaev I will do it as fast as I could. also, I provide a GitHub action for this repository as well because Github makes totally free for open projects such as yours.

@farshadmb Thank you. Ill also have a look when ill have time.
But I assure you that there is nothing wrong with the older version of the library, so if you can not update your xcode just temporary - just use the older version. There was only one problematic version where i had a typo in a binary search algorithm and as far as i remember I fixed it in swift 5.2 version. And if not - its such a small defect that you may never even hit it. And I assume you’ll be able to update your compiler version and the library later, before the release of your application.

Best of luck.

@farshadmb Morning. I have checked the library in XCode 13.2. The issue is not in the line that you pointed out but in the use of the associated values in the models and it is clearly a compiler bug. But anyways I made for you a version of the library that compiles in XCode 13.2. You can check it out in the branch xcode_13_2_issue.

Please, let me know if I can help you further.

@farshadmb Ill close this issue for now. Hope the branch I provided will cover your needs. Please dont hesitate to reopen this issue if you need any further assistance.

Thanks, I will work on it in my spare time, however, my plate is so full.

I know your pain :) . Best of luck.