truebit / xUnique

merge Xcode project file is so easy
https://fclef.wordpress.com
Other
1.5k stars 118 forks source link

Build fail on Swift project at Xcode 7 #24

Closed retsohuang closed 9 years ago

retsohuang commented 9 years ago
Uniquify and Sort
Traceback (most recent call last):
  File "/usr/local/bin/xunique", line 9, in <module>
    load_entry_point('xUnique==4.1.2', 'console_scripts', 'xunique')()
  File "/Library/Python/2.7/site-packages/xUnique.py", line 508, in main
    xunique.unique_project()
  File "/Library/Python/2.7/site-packages/xUnique.py", line 158, in unique_project
    self.substitute_old_keys()
  File "/Library/Python/2.7/site-packages/xUnique.py", line 166, in substitute_old_keys
    line = line.decode('utf-8')
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
KeyboardInterrupt
Command /bin/sh failed with exit code 1
truebit commented 9 years ago

From the error log, it seems that you force quit xunique by "ctrl-c" while it running? I cannot see any other problems, please describe the symptoms with more details

— Sent from my mobile phone

On Mon, Oct 19, 2015 at 9:09 PM, Retso Huang notifications@github.com wrote:

Uniquify and Sort
Traceback (most recent call last):
  File "/usr/local/bin/xunique", line 9, in <module>
    load_entry_point('xUnique==4.1.2', 'console_scripts', 'xunique')()
  File "/Library/Python/2.7/site-packages/xUnique.py", line 508, in main
    xunique.unique_project()
  File "/Library/Python/2.7/site-packages/xUnique.py", line 158, in unique_project
    self.substitute_old_keys()
  File "/Library/Python/2.7/site-packages/xUnique.py", line 166, in substitute_old_keys
    line = line.decode('utf-8')
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
KeyboardInterrupt
Command /bin/sh failed with exit code 1

Reply to this email directly or view it on GitHub: https://github.com/truebit/xUnique/issues/24

retsohuang commented 9 years ago

No, I run this script by add run scripts phase into Xcode, this will fail after build several times, especially at when I editing Stroybaords (Xcode will build project in the background every time when I made some changes in Storyboard) maybe this cause the force quit?

truebit commented 9 years ago

Could you try to run xunique manually in terminal instead of the run script build phase and with -v flag, like xunique -v path/to/your/xcodeproj and paste the logs when failure occurs? I suspect that Xcode hid some error details.

retsohuang commented 9 years ago

Here is the log https://www.dropbox.com/s/krink8g5zvyzwzu/debug_result.json?dl=0

truebit commented 9 years ago

Thanks. please also paste the full terminal output for reference. Or let me change my question: this problem happened only when you run xunique in run-script-build-phase or it also occurred when you manually run xunique in terminal?

retsohuang commented 9 years ago

Sorry terminal crashed :(, I'll post when it happen again.

truebit commented 9 years ago

OK. As you said "Xcode will build project in the background every time when I made some changes in Storyboard", I suspect that because of that, Xcode will force quit ongoing building process when you change the storyboard frequently; and when the ongoing process is in "RunScriptBuildPhase", Xcode will force-quit it, the you got that error.

All above is my suspection. If you found anything, please comment here. Based on my theory, I suggest you use xunique in git hook instead of target shell script phase or scheme pre/post-actions

retsohuang commented 9 years ago

I tried that before, but I get following error

.git/hooks/pre-commit: line 2: xunique: command not found
truebit commented 9 years ago

is /usr/local/bin in your PATH ? xunique should be installed in that directory.

retsohuang commented 9 years ago

It works now, thanks.