-
Notifications
You must be signed in to change notification settings - Fork 616
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
Change gemspec to not rely on the presence of git and the git repository #380
Conversation
…ory, making it compatible with specifying the git repository in a Gemfile, bundle package --all and subsequent deployment.
hey @courtland, i was able to reproduce your problem by running the two bundler commands without changing the i'm fine with changing the gemspec, but i'd like to understand whether this warning actually prevents you from using savon or has any other negative side effects. cheers, |
It definitely prevents me from using the gem, at least the latest master version. I use a lot of other git-sourced gems from github, where I often track the latest master commit instead of the official gem, usually because they don't publish a gem. For most of them I have to fork the repository simply to change the git ls-files bit in the gemspec. I have an unusual production scenario involving hundreds of deployments where re-downloading gems from git repositories is not desirable and often not possible. The same thing happens if you use the :path option in a Gemfile and point it at a local copy of the gem that doesn't have the git repository files (.git directory). Here are some other examples of this issue: steveklabnik/require_relative#4 Thanks for your attention. |
i understand this is a problem to you, but i can also see why people like steve will probably not pay too much attention to your pull requests, because it's missing code to reproduce the workflow and problem. as i said, i'm willing to change savon's gemspec, but i'd like to learn about your workflow and the root cause of your problem before making the change. if you could provide a simple commented script which describes your use case and reproduces this problem, i think people using "the bundler gemspec" would better understand the problem. ps. i had a look at bundler's most recent template for creating gemspecs and noticed that it was changed by one of the referenced pull requests (bundler 2f84b9). i would definitely have to try this out, as i haven't noticed the |
Not sure who you mean by Steve? This is the only pull request I have out there of this nature. The code/solution thats in this pull request I borrowed from one of the examples in my previous comment. I don't particularly like it, but its the most elegant thing I could come up with at the time and needed a solution immediately such that I could use the latest master version of savon in my application. It at least yields an Array that is identical to what I'm not familiar with the gem.files syntax or how it works, but that seems cleaner than doing a glob and would probably work for my environment. I can understand why most people would not care to change this, especially with how prevalent the My workflow is something like this... I have a rails application that runs on FreeBSD. Its part of a commercial networking appliance product that uses rails as the framework for a web administration console. The rails application and various other source code are installed to a production system via a proprietary FreeBSD package. There is no Internet connection available during initial installation. Git is not installed on the system. We develop the rails application using OS X. Source control is done using SVN. The application's Gemfile contains gem 'savon', :git => 'git://github.com/courtland/savon.git' To upgrade my application to the latest version of savon, I would do something like...
Savon is then installed to a production system, still lacking the .git directory. Again, production system does not have a git binary. To install my application's bundle in production I use
The --deployment flag of bundler tells it to install gems from vendor/cache/... and NOT download anything from rubygems or any git repositories. This is extremely important to me because this often happens when there is no Internet connectivity. If the gemspec of a particular gem contains any The --all flag of "bundle package" and its affect on :git options is new to bundler 1.2. Before I was using :path in my Gemfile and manually checking out the latest version of a gem and pointing the Gemfile at it. For example... # vendor/git/savon contains a checkout of the latest version of savon
gem 'savon', :path => 'vendor/git/savon' Bundler 1.2 has made this unnecessary and essentially does this automatically now. Thanks again for your consideration. It continues to baffle me that people think its OK to rely on the existence and behavior of some external binary when describing the files that belong to a gem that supposedly works on any platform having ruby and other gem dependencies. You seem to want to do things "correctly" with savon so I thought I might be able to sway you in the other direction :) |
thanks for the detailed description. i'm going to merge your pull request later today. ps. did you consider opening an issue or pull request at bundler to fix the root cause? |
Nope. I didn't even realize that it was the default. I will go bug them. Thanks! |
fyi: savon.gemspec is changed on master and it's also included in the new v2.1.0 release. |
Great. Thanks! On Sun, Feb 3, 2013 at 4:39 AM, Daniel Harrington
|
I'm hoping you will accept this pull request, or at least do something similar. Although having
git ls-files
is fairly common these days in gem specifications, its actually bad practice because it makes the gem dependent on the existence of git and the git repository. Not all deployment systems have git installed, even though one might want to use the latest git master of a particular gem.Also, a new feature in the latest version of Bundler (1.2.x) enables "bundle package --all" to unpack git repositories specified in the Gemfile into vendor/cache, also removing the git repository (.git directory). This allows one to deploy gems for the latest master of a particular git repository without having to checkout the repository when deploying to production. Savon is currently broken when using this deployment methodology.
For example, in my Gemfile I have
I run something like the following in my development environment
In my production environment I run
The "fatal: Not a git..." error comes from savon.
Thanks.