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

Add Rake task to install dev dependencies. #2173

Merged
merged 4 commits into from Feb 13, 2018
Merged

Add Rake task to install dev dependencies. #2173

merged 4 commits into from Feb 13, 2018

Conversation

duckinator
Copy link
Member

Description:

This adds a rake setup which installs the ependencies required for working on RubyGems.

It's basically a replacement for rake newb.

Usage:

$ gem install rake
$ rake setup
$ rake test

Tasks:

  • Describe the problem / feature
  • Write tests
  • Write code to solve the problem
  • Get code review from coworkers / friends

I will abide by the code of conduct.

@duckinator
Copy link
Member Author

This is marked as a WIP because the code for it is more than a bit gross, since it eval()s rubygems-update.gemspec.

Any ideas on how to make it less gross without duplicating the list of dependencies would be greatly appreciated.

@duckinator
Copy link
Member Author

@bundlerbot try

@bundlerbot
Copy link
Collaborator

⌛ Trying commit 3e087eb with merge b162822...

bundlerbot added a commit that referenced this pull request Feb 3, 2018
[WIP] Add Rake task to install dev dependencies.

# Description:

This adds a `rake setup` which installs the ependencies required for working on RubyGems.

It's basically a replacement for `rake newb`.

Usage:

    $ gem install rake
    $ rake setup
    $ rake test

# Tasks:

- [x] Describe the problem / feature
- [ ] Write tests
- [ ] Write code to solve the problem
- [ ] Get code review from coworkers / friends

I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).
@duckinator
Copy link
Member Author

how the actual fuck did this break things lmao

@bundlerbot
Copy link
Collaborator

💥 Test timed out

@duckinator
Copy link
Member Author

duckinator commented Feb 3, 2018

NOTE: For the time being, you can do:

$ git clone https://github.com/rubygems/rubygems.git
$ cd rubygems
$ git submodule update --init
$ gem install rake 'builder:~> 2.1' 'rdoc:~> 4.0' 'minitest:~> 5.0'
$ rake test

@segiddins
Copy link
Member

segiddins commented Feb 3, 2018

@duckinator perhaps something like this would be a bit lack hacky?

diff --git a/Rakefile b/Rakefile
index d681d2b3..00f2ae50 100644
--- a/Rakefile
+++ b/Rakefile
@@ -16,12 +16,10 @@ end
 
 task :setup do
   # TODO: I am sorry for this abomination, and it needs to be replaced. -@duckinator
-  gemspec = eval(File.read(File.expand_path("../rubygems-update.gemspec", __FILE__)))
-  deps = gemspec.dependencies.map { |dep|
-    "'#{dep.name}:#{dep.requirement.to_s}'"
-  }
-
-  sh "gem install #{deps.join(" ")}"
+  gemspec = Gem::Specification.load(File.expand_path("../rubygems-update.gemspec", __FILE__))
+  gemspec.dependencies.each do |dep|
+    Gem.install(dep.name, dep.requirement)
+  end
 end
 
 Rake::TestTask.new do |t|
diff --git a/rubygems-update.gemspec b/rubygems-update.gemspec
index 64ed401e..dd402b53 100644
--- a/rubygems-update.gemspec
+++ b/rubygems-update.gemspec
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
       s.add_development_dependency(%q<rdoc>.freeze, ["~> 4.0"])
       s.add_development_dependency(%q<rake>.freeze, ["~> 10.5"])
       s.add_development_dependency(%q<minitest>.freeze, ["~> 5.0"])
     else
       s.add_dependency(%q<builder>.freeze, ["~> 2.1"])
       s.add_dependency(%q<rdoc>.freeze, ["~> 4.0"])

@duckinator
Copy link
Member Author

@segiddins that exact code tries to install it to the global installation directory, despite my .gemrc specifying that it should use --user-install.

I'll see if I can figure out how to make that part work right, but even if I can't, the fact that I no longer have to do the eval() makes me a lot more comfortable with this code.

I give up. It'll just call a shell command.
@segiddins
Copy link
Member

Ah dang, I guess that’s because those options in the gemrc only apply to the CLI

@duckinator duckinator changed the title [WIP] Add Rake task to install dev dependencies. Add Rake task to install dev dependencies. Feb 4, 2018
@duckinator
Copy link
Member Author

I give up. I spent way too much time going down that rabbit hole.

It works and it doesn't use eval() anymore so good enough i guess ¯\(ツ)

@duckinator
Copy link
Member Author

@segiddins any idea why this would cause test failures? that doesn't really make sense to me, and it seems to be different tests failing every time...

@bundlerbot
Copy link
Collaborator

☔ The latest upstream changes (presumably #2177) made this pull request unmergeable. Please resolve the merge conflicts.

@hsbt
Copy link
Member

hsbt commented Feb 5, 2018

@duckinator test failures happened randomly. I already filed #2133

I couldn't find a root cause of this failures yet. You can get green status with restarting failed tasks in Travis.

@duckinator
Copy link
Member Author

thanks for the info, @hsbt.

i don't seem to have access to restart the AppVeyor build, which is what's failed atm; could someone do that for me?

@indirect
Copy link
Member

indirect commented Feb 5, 2018

uhh... why are we using appveyor's segiddins/rubygems to build rubygems, instead of rubygems/rubygems? I don't have permission to restart builds on segiddins/rubygems either. @segiddins?

@indirect
Copy link
Member

indirect commented Feb 5, 2018

(Somewhat related: I have just now configured Appveyor so that anyone in the GitHub rubygems/rubygems team should now have access to control the Appveyor project rubygems/rubygems.)

@segiddins
Copy link
Member

@indirect I have 0 clue why it's linking to me instead of rubygems... the web hook configured for the repo just seems to have an ID, and I dont see where on appveyer that ID is coming from

@hsbt
Copy link
Member

hsbt commented Feb 13, 2018

@bundlerbot r+

@bundlerbot
Copy link
Collaborator

📌 Commit 8fed9a8 has been approved by hsbt

@bundlerbot
Copy link
Collaborator

⌛ Testing commit 8fed9a8 with merge 27b471f...

bundlerbot added a commit that referenced this pull request Feb 13, 2018
Add Rake task to install dev dependencies.

# Description:

This adds a `rake setup` which installs the ependencies required for working on RubyGems.

It's basically a replacement for `rake newb`.

Usage:

    $ gem install rake
    $ rake setup
    $ rake test

# Tasks:

- [x] Describe the problem / feature
- [ ] Write tests
- [ ] Write code to solve the problem
- [ ] Get code review from coworkers / friends

I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).
@bundlerbot
Copy link
Collaborator

☀️ Test successful - status-travis
Approved by: hsbt
Pushing 27b471f to master...

@bundlerbot bundlerbot merged commit 8fed9a8 into rubygems:master Feb 13, 2018
@duckinator duckinator deleted the replace-rake-newb branch May 9, 2018 17:26
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 this pull request may close these issues.

None yet

6 participants