schwa / punic

[DEPRECATED] Clean room reimplementation of Carthage tool
0 stars 1 forks source link

OSError: [Errno 2] No such file or directory #6

Closed Jeehut closed 8 years ago

Jeehut commented 8 years ago

Here's my Cartfile content:

github "facebook/ios-snapshot-test-case"

Here's what I run:

punic clean
punic update

Here's my output:

Fetching: facebook/ios-snapshot-test-case
Using xcode version: /Applications/Xcode.app (7.3.1)
Building: FBSnapshotTestCase.xcodeproj (scheme: FBSnapshotTestCase iOS, sdk: iphoneos, configuration: None)...
Building: FBSnapshotTestCase.xcodeproj (scheme: FBSnapshotTestCase iOS, sdk: iphonesimulator, configuration: None)...
Traceback (most recent call last):
  File "/usr/local/bin/punic", line 9, in <module>
    load_entry_point('punic==0.1.13', 'console_scripts', 'punic')()
  File "/usr/local/lib/python2.7/site-packages/punic/punic_cli.py", line 365, in main
    punic_cli()
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/punic/punic_cli.py", line 165, in update
    punic.build(dependencies=deps)
  File "/usr/local/lib/python2.7/site-packages/punic/__init__.py", line 118, in build
    self._build_one(platform, project, scheme.name, configuration)
  File "/usr/local/lib/python2.7/site-packages/punic/__init__.py", line 191, in _build_one
    self._post_process(platform, products)
  File "/usr/local/lib/python2.7/site-packages/punic/__init__.py", line 213, in _post_process
    shutil.copytree(device_product.product_path, output_product.product_path)
  File "/usr/local/lib/python2.7/site-packages/punic/shshutil.py", line 10, in copytree
    shutil.copytree(str(src), str(dst), symlinks, ignore)
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 171, in copytree
    names = os.listdir(src)
OSError: [Errno 2] No such file or directory: '/Users/Me/Library/Application Support/io.schwa.Punic/DerivedData/Build/Products/Release-iphoneos/FBSnapshotTestCase.framework'

Somehow FBSnapshotTestCase seems not to build. Did I configure anything wrong?

Looks like a bug to me...

Jeehut commented 8 years ago

Just commented out that dependency, now getting the same for SVProgressHUD. Seems like an issue that affects many projects.

Jeehut commented 8 years ago

Using punic update --configuration None helped getting the builds going. Maybe we should fallback to None if no Release/Debug exists?

schwa commented 8 years ago

I'm not entirely sure what's going with the Facebook project but if you enforce a configuration you can get it to build:

punic update --configuration Release (or debug)

schwa commented 8 years ago

You generally don't want to rely on the default Configuration anyways. It's really up to the framework maintainer to set a configuration and it could be Debug or Release (although it's usually the latter). If you specify it yourself you have way more control.

You can create a default for punic by setting it in a punic.yaml file (see README).

schwa commented 8 years ago

Same thing for the SVProgressHUD project. Manually specify a configuration and things work fine.

schwa@ungoliant ~/Desktop> punic clean --all
Clean
Erasing Carthage/Build directory
Erasing derived data directory
Erasing /Users/schwa/Library/Application Support/io.schwa.Punic/repo_cache
Erasing run cache
schwa@ungoliant ~/Desktop> mkdir Test4
schwa@ungoliant ~/Desktop> cd Test4
schwa@ungoliant ~/D/Test4> echo 'github "SVProgressHUD/SVProgressHUD"' > Cartfile
schwa@ungoliant ~/D/Test4> punic update --configuration Debug
Update
Using xcode version: /Applications/Xcode.app (7.3.1)
Building: SVProgressHUD.xcodeproj (scheme: SVProgressHUD-Framework, sdk: iphoneos, configuration: Debug)...
Building: SVProgressHUD.xcodeproj (scheme: SVProgressHUD-Framework, sdk: iphonesimulator, configuration: Debug)...
schwa commented 8 years ago

See #7. Thanks.

schwa commented 8 years ago

Also fixed in 0.1.14. Thanks.

Jeehut commented 8 years ago

@schwa Thanks for all the answers. I actually had a configuration file in place but I just found out that it was named punic.yml not punic.yaml – my bad. Would be great if punic was robust in that way though as .yml is a perfectly valid yaml file extension.