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

Extend YAML::Syck::DefaultKey fixing to marshal_dump as well. #121

Merged
merged 1 commit into from
Jun 22, 2011
Merged

Extend YAML::Syck::DefaultKey fixing to marshal_dump as well. #121

merged 1 commit into from
Jun 22, 2011

Conversation

danp
Copy link
Contributor

@danp danp commented Jun 22, 2011

I'm running into a problem on our internal gems repo where built-gem
metadata is being uploaded with unquoted ='s. When gem generate_index is run, the metadata is loaded which turns the
= into DefaultKey. That's then marshaled out as part of the quick
specs which breaks clients that try to load them.

Applying the same fix to marshal_dump let quick specs be generated
that didn't have DefaultKey refs in them even though the incoming
gem specs were broken.

zenspider added a commit that referenced this pull request Jun 22, 2011
…dump

+ Extend YAML::Syck::DefaultKey fixing to `marshal_dump` as well.
@zenspider zenspider merged commit b14197a into rubygems:master Jun 22, 2011
@jonforums
Copy link

On a test version of a gem built on Win7 32bit with RG 1.8.8 and installed with RG 1.8.9 I'm seeing an install failure that appears similar to this issue. The failure only occurs for me on MRI 1.8.7; MRI 1.9.3dev and 1.9.4dev are OK.

Can anyone reproduce?

C:\Users\Jon\Documents\RubyDev\posix-spawn-git>gem install posix-spawn-0.3.7.alpha.1.gem
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Invalid gemspec in [C:/ruby187/lib/ruby/gems/1.8/specifications/posix-spawn-0.3.7.alpha.1.gemspec]: Illformed requirement ["# 0.7.6"]
Successfully installed posix-spawn-0.3.7.alpha.1
1 gem installed

The lib/ruby/gems/1.8/specifications/posix-spawn-0.3.7.alpha.1.gemspec contains

# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
  s.name = %q{posix-spawn}
  s.version = "0.3.7.alpha.1"

  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
  s.authors = [%q{Ryan Tomayko}, %q{Aman Gupta}]
  s.date = %q{2011-08-24}
  s.description = %q{posix-spawn uses posix_spawnp(2) for faster process spawning}
  s.email = [%q{r@tomayko.com}, %q{aman@tmm1.net}]
  s.executables = [%q{posix-spawn-benchmark}]
  s.extensions = [%q{ext/extconf.rb}]
  s.extra_rdoc_files = [%q{COPYING}, %q{HACKING}]
  s.files = [%q{bin/posix-spawn-benchmark}, %q{COPYING}, %q{HACKING}, %q{ext/extconf.rb}]
  s.homepage = %q{http://github.com/rtomayko/posix-spawn}
  s.require_paths = [%q{lib}]
  s.rubygems_version = %q{1.8.9}
  s.summary = %q{posix_spawnp(2) for ruby}

  if s.respond_to? :specification_version then
    s.specification_version = 3

    if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
      s.add_development_dependency(%q, ["#<YAML::Syck::DefaultKey:0x3b61f18> 0.7.6"])
    else
      s.add_dependency(%q, ["#<YAML::Syck::DefaultKey:0x3b61f18> 0.7.6"])
    end
  else
    s.add_dependency(%q, ["#<YAML::Syck::DefaultKey:0x3b61f18> 0.7.6"])
  end
end

My gem environment is

C:\Users\Jon\Documents\RubyDev\posix-spawn-git>gem env
Invalid gemspec in [C:/ruby187/lib/ruby/gems/1.8/specifications/posix-spawn-0.3.7.alpha.1.gemspec]: Illformed requirement ["# 0.7.6"]
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.9
  - RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]
  - INSTALLATION DIRECTORY: C:/ruby187/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: C:/ruby187/bin/ruby.exe
  - EXECUTABLE DIRECTORY: C:/ruby187/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32
  - GEM PATHS:
     - C:/ruby187/lib/ruby/gems/1.8
     - C:/Users/Jon/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-ri --no-rdoc"
     - :sources => ["http://rubygems.org"]
  - REMOTE SOURCES:
     - http://rubygems.org

@luislavena
Copy link
Member

@jonforums: seems the issue associated with the generated gemspec. Can you verify the contents of the generated .gem and see inside metadata both all dependencies state YAML::Syck::DefaultKey:0x3b61f18 ?

@jonforums
Copy link

full metadata contents from the test gem that I build (v0.3.7.alpha.1)

--- !ruby/object:Gem::Specification
name: posix-spawn
version: !ruby/object:Gem::Version
  version: 0.3.7.alpha.1
  prerelease: 6
platform: ruby
authors:
- Ryan Tomayko
- Aman Gupta
autorequire: 
bindir: bin
cert_chain: []
date: 2011-08-24 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
  name: rake-compiler
  requirement: &17118504 !ruby/object:Gem::Requirement
    none: false
    requirements:
    - - =
      - !ruby/object:Gem::Version
        version: 0.7.6
  type: :development
  prerelease: false
  version_requirements: *17118504
description: posix-spawn uses posix_spawnp(2) for faster process spawning
email:
- r@tomayko.com
- aman@tmm1.net
executables:
- posix-spawn-benchmark
extensions:
- ext/extconf.rb
extra_rdoc_files:
- COPYING
- HACKING
files:
- .gitignore
- COPYING
- Gemfile
- HACKING
- README.md
- Rakefile
- TODO
- bin/posix-spawn-benchmark
- ext/extconf.rb
- ext/posix-spawn.c
- lib/posix-spawn.rb
- lib/posix/spawn.rb
- lib/posix/spawn/child.rb
- lib/posix/spawn/version.rb
- posix-spawn.gemspec
- test/test_backtick.rb
- test/test_child.rb
- test/test_popen.rb
- test/test_spawn.rb
- test/test_system.rb
homepage: http://github.com/rtomayko/posix-spawn
licenses: []
post_install_message: 
rdoc_options: []
require_paths:
- lib
required_ruby_version: !ruby/object:Gem::Requirement
  none: false
  requirements:
  - - ! '>='
    - !ruby/object:Gem::Version
      version: '0'
required_rubygems_version: !ruby/object:Gem::Requirement
  none: false
  requirements:
  - - ! '>'
    - !ruby/object:Gem::Version
      version: 1.3.1
requirements: []
rubyforge_project: 
rubygems_version: 1.8.8
signing_key: 
specification_version: 3
summary: posix_spawnp(2) for ruby
test_files: []

...and the metadata contents from the official posix-spawn v0.3.6 gem:

--- !ruby/object:Gem::Specification 
name: posix-spawn
version: !ruby/object:Gem::Version 
  hash: 31
  prerelease: 
  segments: 
  - 0
  - 3
  - 6
  version: 0.3.6
platform: ruby
authors: 
- Ryan Tomayko
- Aman Gupta
autorequire: 
bindir: bin
cert_chain: []

date: 2011-04-19 00:00:00 -07:00
default_executable: 
dependencies: 
- !ruby/object:Gem::Dependency 
  name: rake-compiler
  prerelease: false
  requirement: &id001 !ruby/object:Gem::Requirement 
    none: false
    requirements: 
    - - "="
      - !ruby/object:Gem::Version 
        hash: 15
        segments: 
        - 0
        - 7
        - 6
        version: 0.7.6
  type: :development
  version_requirements: *id001
description: posix-spawn uses posix_spawnp(2) for faster process spawning
email: 
- r@tomayko.com
- aman@tmm1.net
executables: 
- posix-spawn-benchmark
extensions: 
- ext/extconf.rb
extra_rdoc_files: 
- COPYING
- HACKING
files: 
- .gitignore
- COPYING
- Gemfile
- HACKING
- README.md
- Rakefile
- TODO
- bin/posix-spawn-benchmark
- ext/extconf.rb
- ext/posix-spawn.c
- lib/posix-spawn.rb
- lib/posix/spawn.rb
- lib/posix/spawn/child.rb
- lib/posix/spawn/version.rb
- posix-spawn.gemspec
- test/test_backtick.rb
- test/test_child.rb
- test/test_popen.rb
- test/test_spawn.rb
- test/test_system.rb
has_rdoc: true
homepage: http://github.com/rtomayko/posix-spawn
licenses: []

post_install_message: 
rdoc_options: []

require_paths: 
- lib
required_ruby_version: !ruby/object:Gem::Requirement 
  none: false
  requirements: 
  - - ">="
    - !ruby/object:Gem::Version 
      hash: 3
      segments: 
      - 0
      version: "0"
required_rubygems_version: !ruby/object:Gem::Requirement 
  none: false
  requirements: 
  - - ">="
    - !ruby/object:Gem::Version 
      hash: 3
      segments: 
      - 0
      version: "0"
requirements: []

rubyforge_project: 
rubygems_version: 1.4.2
signing_key: 
specification_version: 3
summary: posix_spawnp(2) for ruby
test_files: []

@drbrain
Copy link
Member

drbrain commented Aug 24, 2011

I can reproduce with a checkout of https://github.com/rtomayko/posix-spawn.git by rake19 package; gem install pkg/posix-spawn-0.3.6 rake19 is 1.9.3, gem is 1.8.7

@drbrain
Copy link
Member

drbrain commented Aug 25, 2011

The posix-spawn gem is fixed by @a2498af

nobu pushed a commit to nobu/rubygems that referenced this pull request Jan 12, 2014
Add spec for args passed to module/class_exec.
dmeremyanin pushed a commit to dmeremyanin/carrierwave that referenced this pull request Feb 17, 2014
Old rubygems versions (eg. 1.3.7) without this fix
rubygems/rubygems@a2498af
don't like version numbers without a prefix.
As the gemspec specifies to be dependent on rubygems
1.3.5 we should fix this.
Also see rubygems/rubygems#121
for discussion.
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