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

XcodeEditor does not handle Emoji in build phase names well #78

Open
edwardmp opened this issue May 16, 2016 · 14 comments
Open

XcodeEditor does not handle Emoji in build phase names well #78

edwardmp opened this issue May 16, 2016 · 14 comments

Comments

@edwardmp
Copy link
Contributor

edwardmp commented May 16, 2016

Hi,

Thanks so much for developing this. It was exactly what I needed.

I noticed one issue, though.
CocoaPods now uses a emoji in various build phase names it adds automatically. These ordinarily are just strings with a UTF8-Code in them. You could just remove those Emoji (see https://gist.github.com/cihancimen/4146056 on how to detect them). Right now it just turns these Emoji in some gibberish.

Furthermore, I needed some functionality that is not present in the current CocoaPods release. Any idea when the next release will be?

For example:

schermafbeelding 2016-05-16 om 22 34 54

Best regards,
Edward

@edwardmp
Copy link
Contributor Author

@jasperblues
Decided to investigate this. It appears the problem does not originate in your code. As I understand it, XCodeEditor will write XML output to the pbxproj file. Xcode then converts it to another format (PLIST?). When I close Xcode and the conversion does not take place, all is file. XcodeEditor correctly outputs the Emoji.

However, when Xcode is open and the conversion happens, the emoji are corrupted. I think this is a bug in Xcode, I'll try to file a bug report at Apple.

Correct XML output by XcodeEditor:
schermafbeelding 2016-06-22 om 19 26 15

Corrupted conversion by Xcode:
schermafbeelding 2016-06-22 om 19 46 22

Possibly related to http://openradar.appspot.com/18512876 and http://openradar.appspot.com/13827044

@edwardmp
Copy link
Contributor Author

I filed a radar, copy listed here.
I could reproduce the bug by converting the pbxproj file to XML using plutil. So this issue has nothing to do with XcodeEditor itself, although it is still important to resolve.

Before Apple fixes this, I suggest stripping emoji from build script names?

@jasperblues
Copy link
Member

@edwardmp Thanks for the information. I noticed some other projects (eg CocoaPods) recently stopped using emoji in the project files, so that makes sense.

@edwardmp
Copy link
Contributor Author

edwardmp commented Jun 22, 2016

@jasperblues
Yes indeed, found a few issues in the CocoaPods repo that might be related. Let's see how (or if) Apple responds. Seems they are replacing the emoji with [CP] CocoaPods/CocoaPods#5382

The major issue here by the way is not necessarily the emoji no longer working: I noticed my pbxproj grew to 200 mb and Xcode freezing because somehow the affected build phases would get added multiple times. For the latter I'm not sure whether this is because of a deeper issue in Xcode or in XcodeEditor.

Anyway, if I create a pull request for (at least temporarily) stripping emoji would you consider merging it in?

@jasperblues
Copy link
Member

Yes, that sounds like an excellent temporary solution.

Speaking of bugs. There's a few bug fixes on another branch that I did for a client using this project. I had to strip out generics as they were on an earlier platform. . . need to merge those back some time.

@edwardmp
Copy link
Contributor Author

OK great, I'll see what I can make of it the coming days. Aside for this, your library has been working well for me, so thanks for creating it 👍

@jasperblues
Copy link
Member

:) You're welcome buddy. Thanks for using and, if you feel like it, contributing too.

@edwardmp
Copy link
Contributor Author

@jasperblues
I created a pull request. I found this neat NSString category which does the job well. But since you currently don't have any dependencies, I just copied these 2 files to Utils.

I also added tests for it. However, as mentioned in the pull request the changes are not written to the project file yet. Using the debugger I see that all emojis are stripped from XCBuildShellScript & XCBuildShellScriptDefinition. Maybe you need to mark them as dirty somewhere so that the changes will be written to file.

@edwardmp
Copy link
Contributor Author

@jasperblues you merged in my stuff but did you see my question to you as the implementation was not complete yet.

@edwardmp
Copy link
Contributor Author

Got a response from Apple today:

There are no plans to address this based on the following:

We do not officially support the XML file format or workflows involving it.

Thus, it is important that we remove all emoji in all build scripts, but I'm still waiting for your input how to achieve this @jasperblues

@jasperblues
Copy link
Member

@edwardmp sorry for the delay in reply! Would you be able to check in a broken test? (It doesn't have to have asserts that fail if that is hard - just eyeball the plist file). I could then make it pass for you.

@edwardmp
Copy link
Contributor Author

edwardmp commented Sep 4, 2016

@jasperblues
Hi Jasper sorry didn't have time until now to respond.

The issue is that the updated build scripts (without emoji) are somehow not applied/saved properly. When the project is saved I see the old build script names as if nothing has changed. This may be in some part of the code that determines which stuff should get overwritten? Any clue? If not I can try to make a test case but this will take me some more time

@edwardmp
Copy link
Contributor Author

Hi @jasperblues
Did you see my previous message? I'd like to know since a project I develop is delayed solely by the emoji issue. Hope to hear from you soon. Thanks.

@jasperblues
Copy link
Member

@edwardmp I'm snowed in with work at the moment, so won't be able to look at it for a while.

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

No branches or pull requests

2 participants