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

rake appraisal:relativize #49

Closed
grosser opened this issue May 16, 2013 · 13 comments
Closed

rake appraisal:relativize #49

grosser opened this issue May 16, 2013 · 13 comments

Comments

@grosser
Copy link
Contributor

grosser commented May 16, 2013

That's what we are currently doing to get relative paths in our lockfiles (to not always change them when another user bundles)

Can this get into appraisal, so we do not have to copy-paste it around ?

task :default do
  sh "bundle exec rake appraisal:install appraisal:relativize && bundle exec rake appraisal test"
end

namespace :appraisal do
  task :relativize do
    Dir["gemfiles/*.lock"].each do |file|
      content = File.read(file)
      content.gsub!(File.dirname(__FILE__), "../")
      File.open(file, "w") { |f| f.write(content) }
    end
  end
end
@bwillis
Copy link

bwillis commented May 24, 2013

I would like to see this issue resolved 👍 and thanks for the rake task.

@sikachu
Copy link
Contributor

sikachu commented May 27, 2013

I'm going to hold off this one for now. It seems like Bundler supposed to put the path in the lock file as relative part, but for some reason it resolve the path into an absolute path instead. See this file

I'm going to try to find the way to catch this bug in Bundler.

@bwillis
Copy link

bwillis commented May 27, 2013

I did some digging and agree that this is actually a bundler issue. The gem command works correctly, but it's actually the gemspec command that's problematic. I actually found this out and just submitted a pull request last night: rubygems/bundler#2485

I've tested it with my appraisal setup and it was working as expected.

@sikachu
Copy link
Contributor

sikachu commented May 27, 2013

Hmm, from my testing earlier it seems to be broken with the gem directive as well, but if it's really broken only with gemspec, that's fine with me.

I'll try to test and see if I'm seeing the same issue or not. Thanks for digging into this!

@bwillis
Copy link

bwillis commented May 27, 2013

There could be additional issues that might have not been in my use-case. For clarity, here was my problem:

Here is my Appraisals file:

# /Users/bwillis/Work/versioncake/Appraisals
appraise "rails3.2" do
  gem('actionpack',     '~> 3.2.0')
  gem('activesupport',  '~> 3.2.0')
  gem('railties',       '~> 3.2.0')
end

I would run the typical rake appraisal install and it would generate a gemfile with a relative reference and a lock file with an absolute reference:

# /Users/bwillis/Work/versioncake/gemfiles/rails3.2.gemfile
# This file was generated by Appraisal

source "https://rubygems.org"

gem "actionpack", "~> 3.2.0"
gem "activesupport", "~> 3.2.0"
gem "railties", "~> 3.2.0"

gemspec :path=>"../"
# /Users/bwillis/Work/versioncake/gemfiles/rails3.2.gemfile.lock
PATH
  remote: /Users/bwillis/Work/versioncake
  specs:
    versioncake (1.2.0)
      actionpack (>= 3.2)
      activesupport (>= 3.2)
      railties (>= 3.2)
      tzinfo

GEM
  remote: https://rubygems.org/
  specs:
    actionpack (3.2.13)
      activemodel (= 3.2.13)
      activesupport (= 3.2.13)
      builder (~> 3.0.0)
...

@nathany
Copy link

nathany commented Aug 6, 2013

I installed Bundler 1.4.0.pre.1 which properly put the relative path in place when running rake appraisal:install.

@sikachu
Copy link
Contributor

sikachu commented Aug 6, 2013

Thanks for reporting back @nathany!

@jtmalinowski
Copy link

Hey, what's the status here? Do we need to wait for cli (or rather ea5b74b) to be merged into next deployed version?

@grosser
Copy link
Contributor Author

grosser commented Aug 24, 2013

@sikachu is your commit getting merged ?

@sikachu
Copy link
Contributor

sikachu commented Aug 24, 2013

Sorry for the slow progress, but I can't merge the CLI stuff back into master just yet. I'll finish it pretty soon, then release the RC version.

In the meantime, you can try using bundler 1.4.0 RC which should already fix the issue.

I'll let you guys know when the RC is out.

@nathany
Copy link

nathany commented Aug 24, 2013

Why add this feature when bundler 1.4 will resolve the issue?

@grosser
Copy link
Contributor Author

grosser commented Aug 24, 2013

Ideally don't want to wait another 6+ months or so (release + everyone updating), but no big deal ...

sikachu added a commit that referenced this issue Sep 4, 2013
@sikachu
Copy link
Contributor

sikachu commented Sep 4, 2013

I'm going to close this, since I already implement it for CLI, which will be released in 1.0. I'm sorry for the slowness of the progress, but I'm trying to cover all the stuff before I cut the release.

@sikachu sikachu closed this as completed Sep 4, 2013
sikachu added a commit that referenced this issue Sep 4, 2013
sikachu added a commit that referenced this issue Sep 4, 2013
sikachu added a commit that referenced this issue Sep 4, 2013
sikachu added a commit that referenced this issue Sep 13, 2013
sikachu added a commit that referenced this issue Sep 19, 2013
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

Successfully merging a pull request may close this issue.

5 participants