Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Architecture and version being reset on push #147

Closed
djberg96 opened this Issue Aug 3, 2011 · 10 comments

Comments

Projects
None yet
3 participants
Contributor

djberg96 commented Aug 3, 2011

Despite explicitly setting the architecture to "universal" and the version to nil, it's being reset when I push it. This has happened on different platforms with varying versions of rubygems, including the latest (1.8.6).

>gem push sys-proctable-0.9.1-universal-darwin.gem 
Pushing gem to https://rubygems.org...
Successfully registered gem: sys-proctable (0.9.1-x86-darwin-8)

I do NOT want the architecture or version set on this gem.

Regards,

Dan

Member

luislavena commented Aug 3, 2011

Daniel, are you sure this is a RubyGems issue and not a rubygems.org issue?

What happens when you try to install locally? gem install --local sys-proctable-0.9.1-universal-darwin.gem ?

Contributor

djberg96 commented Aug 3, 2011

On 8/3/11 12:09 PM, luislavena wrote:

Daniel, are you sure this is a RubyGems issue and not a rubygems.org issue?

What happens when you try to install locally? gem install --local sys-proctable-0.9.1-universal-darwin.gem ?

Works just fine.

How would I be able to tell if this is a rubygems issue or a
rubygems.org issue? If it's the latter, I'll be darn curious to know
what's happening to cause it.

Regards,

Dan

Member

luislavena commented Aug 3, 2011

Well, well, seems RubyGems is having issues with the spec?

$ gem spec --local sys-proctable-0.9.1-universal-darwin.gem

--- !ruby/object:Gem::Specification 
name: sys-proctable
version: !ruby/object:Gem::Version 
  hash: 57
  prerelease: 
  segments: 
  - 0
  - 9
  - 1
  version: 0.9.1
platform: x86-darwin-8

And that is inside metadata.gz in the gem :(

Seems to me a bug, serious one.

Member

luislavena commented Aug 4, 2011

@djberg96, what is the code you used to generate the gem?

Asking this because setting platform = "universal-darwin" on my Gem::Specification successfully generated a proper gemspec:

--- !ruby/object:Gem::Specification 
name: testext
version: !ruby/object:Gem::Version 
  hash: 29
  prerelease: 
  segments: 
  - 0
  - 0
  - 1
  version: 0.0.1
platform: universal-darwin

And parsing it with gem spec returned properly.

Thank you.

Contributor

djberg96 commented Aug 5, 2011

It's the Rakefile task in the sys-proctable library:

task :create => [:clean] do
spec = eval(IO.read('sys-proctable.gemspec'))

case Config::CONFIG['host_os']
  when /darwin/i
     spec.platform = Gem::Platform.new('universal-darwin')
     spec.files << 'ext/darwin/sys/proctable.c'
     spec.extra_rdoc_files << 'ext/darwin/sys/proctable.c'
     spec.test_files << 'test/test_sys_proctable_darwin.rb'
     spec.extensions = ['ext/darwin/extconf.rb']

Dan

-----Original Message-----
From: luislavena [mailto:reply+i-1339071-
ac3b8820fc746413bc33a576a2854ff82447382d@reply.github.com]
Sent: Thursday, August 04, 2011 5:38 PM
To: djberg96@gmail.com
Subject: Re: [rubygems] Architecture and version being reset on push
(#147)

@djberg96, what is the code you used to generate the gem?

Asking this because setting platform = "universal-darwin" on my
Gem::Specification successfully generated a proper gemspec:

--- !ruby/object:Gem::Specification
name: testext
version: !ruby/object:Gem::Version
  hash: 29
  prerelease:
  segments:
  - 0
  - 0
  - 1
  version: 0.0.1
platform: universal-darwin

And parsing it with gem spec returned properly.

Thank you.

Reply to this email directly or view it on GitHub:
#147 (comment)

Member

luislavena commented Aug 5, 2011

Cloned your repo, did rake gem:create and checked the spec of it:

$ gem spec --local sys-proctable-0.9.1-universal-darwin.gem 
--- !ruby/object:Gem::Specification 
name: sys-proctable
version: !ruby/object:Gem::Version 
  hash: 57
  prerelease: 
  segments: 
  - 0
  - 9
  - 1
  version: 0.9.1
platform: x86-darwin-10

Seems that Gem::Builder is keeping @original_platform and not using newer @platform? Gem::PackageTask works as expected.

Contributor

djberg96 commented Aug 19, 2011

But it should be using @platform, correct?

Member

luislavena commented Aug 19, 2011

I've tried to replicate in my own projects and is not failing, but I'm not playing with the specification like you do.

In theory Builder should be using @platform too.

@ghost ghost assigned luislavena Nov 24, 2011

Owner

drbrain commented Nov 28, 2012

In Gem::Specification, @platform is the parsed version while @original_platform is the unparsed version (for legacy gems).

It seems that Gem::Specification#platform= sets both versions, so this should end up OK. If you build a gem, do you still have this problem?

nobu pushed a commit to nobu/rubygems that referenced this issue Jan 12, 2014

Merge pull request #147 from flavio/fix_ascii_inspect_ruby_19
Fix spec covering the encoding of Array#inspect with 1.9
Contributor

djberg96 commented Oct 11, 2014

Either this was fixed, or switching to the two argument array form fixed it, or both. Doesn't seem to be an issue any longer.

@djberg96 djberg96 closed this Oct 11, 2014

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