vagrant-hostsupdater icon indicating copy to clipboard operation
vagrant-hostsupdater copied to clipboard

`gem` installs an outdated version

Open kamazee opened this issue 6 years ago • 20 comments

Gem with spec version 1.1.1.160 actually contains version 1.0.2 of the plugin. Here's how to see the difference:

gem fetch vagrant-hostsupdater
gem unpack vagrant-hostsupdater-1.1.1.160.gem
curl -L -O https://github.com/cogitatio/vagrant-hostsupdater/releases/download/1.1.1/vagrant-hostsupdater.gem
gem unpack vagrant-hostsupdater.gem

The snippet above produces 2 directories:

.
├── vagrant-hostsupdater # From github
└── vagrant-hostsupdater-1.1.1.160 # gem fetch 

diff.txt is a difference between the two (diff -r vagrant-hostsupdater vagrant-hostsupdater-1.1.1.160; left side is github version, right side is from rubygems).

I expected that 1.1.1 from rubygems would match 1.1.1 from github. Could you update the gem on ruygems?

kamazee avatar Oct 05 '18 09:10 kamazee

ping @cogitatio @cgsmith 🙄 Could you slap rubygems.org to make it distribute a correct version?

kamazee avatar Oct 08 '18 10:10 kamazee

1.1.1.160 is the correct version

cgsmith avatar Oct 08 '18 12:10 cgsmith

@cgsmith it is; the thing is that what rubygems.org distributes as 1.1.1.160 appears to be 1.0.2. Please check the diff above between 1.1.1 from github and 1.1.1.160 from rubygems. Is that expected?

kamazee avatar Oct 08 '18 12:10 kamazee

That is strange.... It shows 1.1.1.160 on the rubygems interface

cgsmith avatar Oct 08 '18 12:10 cgsmith

Indeed: looks like something went wrong when building the gem that was pushed to rubygems.org. Version in gemspec is correct but actual content is outdated. Gem in releases on github is correct, though, and it would be cool if someone with permissions replaced one that is on rubygems.org with one from github.

kamazee avatar Oct 08 '18 13:10 kamazee

@cgsmith sorry to disturb you again but could you push gem that is published on releases page of github to rubygems.org so they are the same? It's a pity that vagrant (that uses rubygems.org) installs an outdated version: we wanted to use new structure of aliases in our team but we failed because even though rubygems thinks in distributes 1.1.1.160 but actually installs 1.0.2, and things like the following just fail:

config.hostsupdater.aliases = {
    '10.0.0.1' => ['foo.com', 'bar.com'],
    '10.0.0.2' => ['baz.com', 'bat.com']
}

Well, we can always install plugin manually but hey, it would be nicer to make the latest code easily accessible to everyone :)

kamazee avatar Oct 10 '18 09:10 kamazee

Hi guys. The problem reproduces on my env:

> gem --version
2.7.6
> ruby --version
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]

benbor avatar Oct 18 '18 09:10 benbor

@cogitatio @cgsmith could you please re-publish the latest release to rubygems (or cut a new one) to make it distribute the correct version of the plugin? I'd be really grateful; just using vagrant plugin is way more convenient than installing it manually and instructing people around to do so :)

Thanks for maintaining this great plugin!

kamazee avatar Nov 02 '18 16:11 kamazee

@cgsmith I've just stumbled upon https://github.com/cogitatio/vagrant-hostsupdater/issues/160#issuecomment-378456755 which revealed that 1.1.1.160 was an intentional retag of 1.0.2 to get rid of 1.1.1 that hadn't worked on Windows. I thought it was just a mistake. Sorry for the noise, then. I guess the only option to have 1.1.1 back is to fix Windows 10 issue; I'll see if I can do something with it.

Could you please confirm or deny that if Windows 10 issue is fixed, 1.1.1 will appear on rubygems.org (e.g. as 1.1.2)?

kamazee avatar Nov 15 '18 15:11 kamazee

@kamazee This probably explains why I can't get the example for setting up multiple adapters with separate IPs working:

config.hostsupdater.aliases = {
    '10.0.0.1' => ['foo.com', 'bar.com'],
    '10.0.0.2' => ['baz.com', 'bat.com']
}

I keep getting this error /.vagrant.d/gems/2.4.4/gems/vagrant-hostsupdater-1.1.1.160/lib/vagrant-hostsupdater/HostsUpdater.rb:22:in 'concat': no implicit conversion of Hash into Array (TypeError). I think I saw somewhere this support was added in 1.1.1.

Enchiridion avatar Jan 03 '19 00:01 Enchiridion

@Enchiridion yes, right. I created this issue after debugging the very same symptom you're experiencing. At the end of the day, I built a custom version (based on 1.1.1 with changes from #173 ), published it in a corporate gems repository and pointed vagrant to the custom private repository I pushed the plugin into.

I hope to get rid of the custom version one day, though.

kamazee avatar Jan 03 '19 16:01 kamazee

I have repo access to write to the repo but would like to open this plugin up to be able to be managed by more in the community. Unfortunately @cogitatio is not responding to those requests.

I am thinking of creating a plugin and deprecating this plugin's URL and would like your feed back on this.

I don't want anyone to have custom versions and as many issues as have been popping up - that was the whole point why I wanted maintainer access to the repo.

cgsmith avatar Jan 03 '19 18:01 cgsmith

I am thinking of creating a plugin and deprecating this plugin's URL and would like your feed back on this

Do you basically mean forking it? Well, if @cogitatio doesn't respond to any requests related to this plugin, this might be the only option.

However, I don't think I follow the rest of the idea: what do you mean by "open this plugin up to be able to be managed by more in the community"?

As I see it, the project need people who are ready to review/merge pull requests and someone (or something) to publish releases on RubyGems (as I understand it's done manually at the moment but it's probably fairly easy to automate so likely having the former would be sufficient).

kamazee avatar Jan 04 '19 12:01 kamazee

Automating would be great. @cogitatio is the only one who can add people for reviewing/merging pull requests right now.

I'll fork it and start a transition to use a different path. I want to give enough notice to other users and companies that use vagrant-hostsupdater

cgsmith avatar Jan 04 '19 15:01 cgsmith

@cgsmith actually, forking should go smoothly as the gem should be installed from rubygems, and it doesn't seem to care where a gem being pushed originates from; you listed as an owner there, so you have permissions to push. Basically, you can just fork this, change url on rubygems so people go the new place when they want to discover the source and that's it. Are you still interested? If so, I can offer a hand if needed.

kamazee avatar Aug 14 '19 09:08 kamazee

What's the current status on this? I've been trying to use the new aliases functionality from 1.1.0 and get the error message no implicit conversion of Hash into Array. I'm using 1.1.1.160.

If it's not supported by the version that's installed by vagrant plugin install vagrant-hostsupdater then maybe you should remove it from the readme as it's very confusing.

alnorth avatar Feb 05 '20 16:02 alnorth

@alnorth , 1.1.1.160 is actuallly a 1.0.2, not 1.1.x. You can find reasons above in the thread; a maintainer (either current or a new one who's willing to fork it and maintain the fork) has to step in to resolve the issue.

kamazee avatar Feb 16 '20 07:02 kamazee

@kamazee Can this be highlighted in the readme without a maintainer stepping in? It's very frustrating to read about something in the docs and then not be able to use it on the version that's installed using the recommended installation method.

alnorth avatar Feb 17 '20 09:02 alnorth

I don't think so: even if one submits a pull request that removes the feature from the description or submits a fix that makes releasing of 1.1.x possible again, maintainer has to merge them. Yeah, it took me some debugging to understand what was going on but there's barely anything I can do.

kamazee avatar Feb 17 '20 09:02 kamazee

The alias array feature does not work for me either. It would be a very useful feature — especially considering that it's already in the documentation. Is this still priority and is there anything that can be done? Thanks!

jstnbr avatar Mar 19 '20 20:03 jstnbr