Skip to content

Merely having drake installed breaks gem installs that use rake-compiler #5

Open

Description

@FooBarWidget

Reproducible case: https://github.com/FooBarWidget/drake-break-rake-compiler

Download the gem: https://github.com/FooBarWidget/drake-break-rake-compiler/releases/download/v1.0.0/drake-break-rake-compiler-1.0.0.gem

Installing the gem fails:

Building native extensions. This could take a while...
ERROR:  Error installing drake-break-rake-compiler-1.0.0.gem:
	ERROR: Failed to build gem native extension.

    current directory: /Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/drake-break-rake-compiler-1.0.0/ext
/Users/hongli/.asdf/installs/ruby/3.3.1/bin/ruby -rrubygems /Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/rake-13.2.1/exe/rake RUBYARCHDIR\=/Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/extensions/x86_64-darwin-23/3.3.0/drake-break-rake-compiler-1.0.0 RUBYLIBDIR\=/Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/extensions/x86_64-darwin-23/3.3.0/drake-break-rake-compiler-1.0.0
#<Thread:0x000000010f450320 /Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/drake-0.9.2.0.3.1/lib/rake/multi_task.rb:10 run> terminated with exception (report_on_exception is true):
/Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/3.3.0/fileutils.rb:365:in `mkdir_p': wrong number of arguments (given 2, expected 1) (ArgumentError)
	from /Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/drake-0.9.2.0.3.1/lib/rake/file_utils_ext.rb:33:in `mkdir_p'
	from /Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/drake-0.9.2.0.3.1/lib/rake/dsl_definition.rb:61:in `block (2 levels) in directory'
	from /Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/drake-0.9.2.0.3.1/lib/rake/task.rb:227:in `block in execute'
	from /Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/drake-0.9.2.0.3.1/lib/rake/task.rb:224:in `each'
	from /Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/drake-0.9.2.0.3.1/lib/rake/task.rb:224:in `execute'
	from /Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/drake-0.9.2.0.3.1/lib/rake/task.rb:163:in `block in invoke_with_call_chain'
	from /Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/drake-0.9.2.0.3.1/lib/rake/task.rb:160:in `synchronize'
	from /Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/drake-0.9.2.0.3.1/lib/rake/task.rb:160:in `invoke_with_call_chain'
	from /Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/drake-0.9.2.0.3.1/lib/rake/task.rb:199:in `block in invoke_prerequisites'
	from /Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/drake-0.9.2.0.3.1/lib/rake/task.rb:197:in `each'
	from /Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/drake-0.9.2.0.3.1/lib/rake/task.rb:197:in `invoke_prerequisites'
	from /Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/drake-0.9.2.0.3.1/lib/rake/task.rb:162:in `block in invoke_with_call_chain'
	from /Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/drake-0.9.2.0.3.1/lib/rake/task.rb:160:in `synchronize'
	from /Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/drake-0.9.2.0.3.1/lib/rake/task.rb:160:in `invoke_with_call_chain'
	from /Users/hongli/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/drake-0.9.2.0.3.1/lib/rake/multi_task.rb:10:in `block (2 levels) in invoke_prerequisites'
rake aborted!
wrong number of arguments (given 2, expected 1)

Tasks: TOP => default => x86_64-darwin/libdrake-break-rake-compiler.bundle => x86_64-darwin/drake-break-rake-compiler/drake-break-rake-compiler.o => x86_64-darwin/drake-break-rake-compiler

Environment: Ruby 3.3.1 on macOS.

Analysis

gem install runs rake, which requires rake/xxx (among other things) without gem activation.

Merely having drake installed makes RubyGems prefer loading rake/xxx from drake rather than from rake. I guess it's because d comes before r, alphabetically.

Meanwhile, drake's rake/file_utils_ext.rb is incompatible with newer versions of FileUtils. rake-compiler makes use of FileUtils. And so things break.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions