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

pod install repeatedly fails trying to understand .git/tags_lock #4715

Closed
kamitchell opened this issue Jan 2, 2016 · 8 comments
Closed

pod install repeatedly fails trying to understand .git/tags_lock #4715

kamitchell opened this issue Jan 2, 2016 · 8 comments
Assignees
Labels
s4:awaiting validation A Pull Request that is waiting for validation by a CocoaPods Core Team member t3:discussion These are issues that can be non-issues, and encompass best practices, or plans for the future.

Comments

@kamitchell
Copy link

Command

/Users/kevin/.gem/bin/pod install --no-repo-update

Report

  • What did you do?

See above. Just trying to install. (--no-repo-update was added to shorten the time for each attempt; I did let it update the first few times)

  • What did you expect to happen?

Updates and installs.

  • What happened instead?

The crash listed below. Repeatedly. Sometimes, it manages to work for one Pod, but then breaks on the next one.

Also fails with the Git that comes with Xcode 7.2.

Stack

   CocoaPods : 0.39.0
        Ruby : ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]
    RubyGems : 2.0.14
        Host : Mac OS X 10.11.2 (15C50)
       Xcode : 7.2 (7C68)
         Git : git version 2.6.2
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 0afd0f40a4c92b317d4d45012979c0f95dccb0b5

Plugins

cocoapods-plugins      : 0.4.2
cocoapods-podfile_info : 1.0.0
cocoapods-search       : 0.1.0
cocoapods-stats        : 0.6.2
cocoapods-trunk        : 0.6.4
cocoapods-try          : 0.5.1

Podfile

platform :ios, '8.0'
use_frameworks!

workspace 'Actor'
xcodeproj 'Actor.xcodeproj'

inhibit_all_warnings!

target 'Actor' do
    xcodeproj 'Actor.xcodeproj'
    pod 'ActorSDK-iOS'
end

Error

RuntimeError - unknown file type: /var/folders/tc/7l13f83d2p93v8nvck8c28pr0000gn/T/d20160102-59662-133r619/.git/tags_lock
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1375:in `copy'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:463:in `block in copy_entry'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1485:in `call'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1485:in `wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1488:in `block in wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1487:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1487:in `wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1488:in `block in wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1487:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1487:in `wrap_traverse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:460:in `copy_entry'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:435:in `block in cp_r'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1558:in `block in fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1574:in `fu_each_src_dest0'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1556:in `fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:434:in `cp_r'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/downloader/cache.rb:200:in `copy_and_clean'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/downloader/cache.rb:158:in `block (2 levels) in uncached_pod'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/downloader/cache.rb:156:in `each'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/downloader/cache.rb:156:in `block in uncached_pod'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/downloader/cache.rb:180:in `call'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/downloader/cache.rb:180:in `in_tmpdir'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/downloader/cache.rb:152:in `uncached_pod'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/downloader/cache.rb:33:in `download_pod'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/downloader.rb:34:in `download'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/installer/pod_source_installer.rb:113:in `download_source'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/installer/pod_source_installer.rb:53:in `install!'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:339:in `install_source_of_pod'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:306:in `block (2 levels) in install_pod_sources'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/user_interface.rb:80:in `titled_section'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:305:in `block in install_pod_sources'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:297:in `each'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:297:in `install_pod_sources'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:146:in `block in download_dependencies'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/user_interface.rb:59:in `section'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:144:in `download_dependencies'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:106:in `install!'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/command/project.rb:71:in `run_install_with_update'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/command/project.rb:101:in `run'
/Users/kevin/.gem/gems/claide-0.9.1/lib/claide/command.rb:312:in `run'
/Users/kevin/.gem/gems/cocoapods-0.39.0/lib/cocoapods/command.rb:47:in `run'
/Users/kevin/.gem/gems/cocoapods-0.39.0/bin/pod:44:in `<top (required)>'
/Users/kevin/.gem/bin/pod:23:in `load'
/Users/kevin/.gem/bin/pod:23:in `<main>'
@kamitchell
Copy link
Author

A few more notes:

  • I did update my gems to make sure I had the latest stuff.
  • It seems to succeed occasionally, which makes me wonder if there's some kind of strange race condition, especially since the suspect file has "lock" in the name.
  • Also tried pod cache clean --all

@kamitchell
Copy link
Author

Ugh, it's my bad. I have a script based on:

http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html

...that does this in post-checkout in my Git template:

#!/bin/sh
set -e
PATH="/usr/local/bin:$PATH"
dir="`git rev-parse --git-dir`"

mkdir .git/tags_lock 2>/dev/null || exit 0
trap "rmdir .git/tags_lock; rm -f .git/tags.$$" EXIT

git ls-files | \
  ctags --tag-relative -L - -f"$dir/$$.tags" --extra=+qf --languages=-javascript,sql
mv "$dir/$$.tags" "$dir/tags"

I think the file copy in CocoaPods races the tags script and trips over the lock file.

@segiddins
Copy link
Member

So if you remove the post-checkout, it works fine for you?

@kamitchell
Copy link
Author

So if you remove the post-checkout, it works fine for you?

It works, but this is something I like having be automatic for all of my Git repos, since it's part of my template.

I'm trying to make it just not run the ctags script if the Git repo is private, by just not running the script if git rev-parse --init-dir is in the temporary file tree. That seems to be helping.

A couple things on CocoaPods end might help:

  1. One would be if there was an environment variable CocoaPods had set for its forked commands, then hooks (and other things, like shell RC scripts) could choose not to run for CocoaPods. Something like COCOAPODS_RUNNING, perhaps?
  2. If these git repos are being used internally to CocoaPods, and CocoaPods would like them not to be encumbered with user-configured stuff, the cloning could include --template= to override a global init.templateDir setting.

@segiddins
Copy link
Member

Honestly, I'm not sure what the right answer here is.

@segiddins segiddins added the t3:discussion These are issues that can be non-issues, and encompass best practices, or plans for the future. label Jan 7, 2016
@segiddins
Copy link
Member

What do you think of making a PR to cocoapods-downloader that passes a blank template argument?

@kamitchell
Copy link
Author

I’ve actually started looking into that, just it may take some time because I’m not really that much of a Ruby expert, and not that familiar with using a CocoaPods of my own development.

cocoapods-downloader is the best place?

@segiddins
Copy link
Member

yup

@segiddins segiddins self-assigned this Mar 13, 2016
@segiddins segiddins added the s4:awaiting validation A Pull Request that is waiting for validation by a CocoaPods Core Team member label Mar 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s4:awaiting validation A Pull Request that is waiting for validation by a CocoaPods Core Team member t3:discussion These are issues that can be non-issues, and encompass best practices, or plans for the future.
Projects
None yet
Development

No branches or pull requests

2 participants