Project

General

Profile

Actions

Bug #14189

closed

Webrick 1.4.0. release requires unreleased ruby version 2.5.0dev

Added by tb@panorama9.com (Thomas Balsløv) over 6 years ago. Updated over 6 years ago.

Status:
Closed
Target version:
-
[ruby-core:84285]

Description

Hi Team!

We have just encountered a blocking bug in the Webrick gem version 1.4.0.
The gemspec is requiring an as yet unreleased version of ruby:

Gem::InstallError: webrick requires Ruby version >= 2.5.0dev.
An error occurred while installing webrick (1.4.0), and Bundler cannot continue.
Make sure that gem install webrick -v '1.4.0' succeeds before bundling.

https://github.com/ruby/ruby/blob/9cbb3bd1f2b05d59b6dd315ebdec295c2ced6c01/lib/webrick/webrick.gemspec#L13

It seems like a mixup happened between the branches with the 1.4.0 release.

Please fix ASAP.

Thanks!

Best regards, Thomas Balsløv.


Files

webrick_uplevel.patch (1.23 KB) webrick_uplevel.patch MSP-Greg (Greg L), 12/16/2017 03:22 PM

Updated by shevegen (Robert A. Heiler) over 6 years ago

Good catch.

I guess the japanese hackers all happily use ruby 2.5.x already. :)

2.4.3 was recently released. Guess it is a stable variant on the
2.4.x branch.

Webrick at https://rubygems.org/gems/webrick has the ">= 2.5.0dev"
tag, and presently 2.5.0dev is not available. If there are no
breaking changes, perhaps the 2.4.x branch works fine and webrick
could default to 2.4.x. for the time being - that should solve
the issue for now.

By the way, perhaps webrick should be added to "bundled_gems" too
like many other distributed gems:

https://github.com/ruby/ruby/blob/trunk/gems/bundled_gems

I do not know if this is easily possible though, there is also
lib/webrick/ in default MRI ruby.

Updated by normalperson (Eric Wong) over 6 years ago

wrote:

Good catch.

I guess the japanese hackers all happily use ruby 2.5.x already. :)

/me is not Japanese, but yes, I mainly use 2.5.x

2.4.3 was recently released. Guess it is a stable variant on the
2.4.x branch.

Webrick at https://rubygems.org/gems/webrick has the ">= 2.5.0dev"
tag, and presently 2.5.0dev is not available. If there are no
breaking changes, perhaps the 2.4.x branch works fine and webrick
could default to 2.4.x. for the time being - that should solve
the issue for now.

Oops, I inherited this from hsbt. I'm not sure about the
versioning, but it looks like we started using 2.5.0dev
features recently in:

r61155  Add uplevel keyword to Kernel#warn and use it

I suppose we could revert that change and see how it does
on 2.4...

Thomas: do you actually need to install or declare webrick
as a dependency somewhere? It's always been bundled with Ruby
so I don't think you need to worry about declaring it as a
dependency (and the 1.3.1 on rubygems.org was way out of date).

If you're on ruby 2.4 or earlier, use the bundled one instead
what's on rubygems.org

By the way, perhaps webrick should be added to "bundled_gems" too
like many other distributed gems:

https://github.com/ruby/ruby/blob/trunk/gems/bundled_gems

shrug I'll let hsbt answer this; can't say I know too much
about gem bundling stuff.


Bug #14189: Webrick 1.4.0. release requires unreleased ruby version 2.5.0dev
https://bugs.ruby-lang.org/issues/14189#change-68449

Updated by MSP-Greg (Greg L) over 6 years ago

Eric,

Looking over 61155, it does seem rather odd to constrain updates to WEBrick to ruby >= 2.5 for two warnings. I believe WEBrick is the only gem affected by it. Don't know what your thoughts are...

Also, re users not needing to install WEBrick, from over in the RubyInstaller repos, the first thing many people do with a Ruby install is gem update (which is why I asked a while ago about a digest gem). If WEBrick can maintain compatibility with 2.3 forward, it would probably help a lot of support people...

shevegen (Robert A. Heiler) wrote:

By the way, perhaps webrick should be added to "bundled_gems" too like many other distributed gems:

I believe it's a default gem, which basically means it can't be uninstalled with RubyGems, but it can be updated. FYI, default gems have their code in the ruby repo, bundled gems are added by the build process.

Thanks, Greg

Updated by normalperson (Eric Wong) over 6 years ago

wrote:

Eric,

Looking over 61155, it does seem rather odd to constrain updates to WEBrick to ruby >= 2.5 for two warnings. Also, I believe WEBrick is the only gem affected by it. Don't know what your thoughts are...

I am of two minds; for my projects which were never in ruby-core,
I still support 1.9.3 (even if ruby-core does not).

But one appeal of working on stdlib is being able to use (and
test) new Ruby features right away.

Also, re users not needing to install WEBrick, from over in the RubyInstaller repo, the first thing many people do with a Ruby install is gem update (which is why I asked a while ago about a digest gem). If WEBrick can maintain compatibility with 2.3 forward, it would probably help a lot of support people...

The thing is, ruby 2.4 and earlier do not have webrick installed as a
gem by default; it wasn't a default gem until 2.5. So "gem update"
for a 2.4 user should still never see this unless they willingly
had an ancient 1.3.1 installed.

I'm not sure what hsbt and the rest of ruby-core wants to do.
Personally, I do not like version guards, either.

Updated by MSP-Greg (Greg L) over 6 years ago

normalperson (Eric Wong) wrote:

The thing is, ruby 2.4 and earlier do not have webrick installed as a
gem by default; it wasn't a default gem until 2.5. So "gem update"
for a 2.4 user should still never see this unless they willingly
had an ancient 1.3.1 installed.

You're correct. Considering that I have Travis & Appveyor pages that show that info, I should have checked.

I tried the attached patch to remove the :uplevel parameter for ruby < 2.5, and it passed on Appveyor & Travis for Ruby 2.4. Assumes 2.10 never exists. Most Ruby 2.3 versions had one failure.

Thanks, Greg

Updated by normalperson (Eric Wong) over 6 years ago

  • Assignee set to hsbt (Hiroshi SHIBATA)

Updated by hsbt (Hiroshi SHIBATA) over 6 years ago

  • Status changed from Open to Assigned
  • Assignee changed from hsbt (Hiroshi SHIBATA) to normalperson (Eric Wong)

Personally, I do not like version guards, either.

A current implementation of webrick works with Ruby 2.3/2.4

https://api.travis-ci.org/v3/job/317931661/log.txt

But lib/webrick/util.rb is not supported Ruby 2.2. So, We could not guarantee to work webrick on Ruby 2.2 now.

https://bugs.ruby-lang.org/projects/ruby-trunk/repository/entry/lib/webrick/utils.rb#L199

The thing is, ruby 2.4 and earlier do not have webrick installed as a
gem by default; it wasn't a default gem until 2.5. So "gem update"
for a 2.4 user should still never see this unless they willingly
had an ancient 1.3.1 installed.

Yes, We can provide a webrick gem as default gems after Ruby 2.5.
I have a plan to promote feature for default gems at RubyGems 2.8 or 3.0.

like this: $ gem install webrick --default -v 1.4.0 with a Ruby 2.3 or 2.4

But it's still epic status.

Eric. How about a relaxing required_ruby_version of webrick to >= 2.3.0?
(and bump version to 1.4.1)

Updated by normalperson (Eric Wong) over 6 years ago

wrote:

Issue #14189 has been updated by hsbt (Hiroshi SHIBATA).

Status changed from Open to Assigned
Assignee changed from hsbt (Hiroshi SHIBATA) to normalperson (Eric Wong)

Personally, I do not like version guards, either.

A current implementation of webrick works with Ruby 2.3/2.4

https://api.travis-ci.org/v3/job/317931661/log.txt

But lib/webrick/util.rb is not supported Ruby 2.2. So, We could not guarantee to work webrick on Ruby 2.2 now.

https://bugs.ruby-lang.org/projects/ruby-trunk/repository/entry/lib/webrick/utils.rb#L199

Right. The incompatibility I was referring to was the
warn("...", uplevel: 1) in `su' method;

but it is only warning, and maybe printing "{:uplevel => 1}" for
non-*nix platforms w/o `su' support is fine...

The thing is, ruby 2.4 and earlier do not have webrick installed as a
gem by default; it wasn't a default gem until 2.5. So "gem update"
for a 2.4 user should still never see this unless they willingly
had an ancient 1.3.1 installed.

Yes, We can provide a webrick gem as default gems after Ruby 2.5.
I have a plan to promote feature for default gems at RubyGems 2.8 or 3.0.

like this: $ gem install webrick --default -v 1.4.0 with a Ruby 2.3 or 2.4

But it's still epic status.

Eric. How about a relaxing required_ruby_version of webrick to >= 2.3.0?
(and bump version to 1.4.1)

Sure. I'll leave the uplevel: keyword when people attempt `su';
but I guess it's a rarely-used method and nobody will care for the
noise on non-*nix...

Actions #9

Updated by Anonymous over 6 years ago

  • Status changed from Assigned to Closed

Applied in changeset trunk|r61322.


webrick 1.4.1 release

  • lib/webrick/version.rb: bump version
  • lib/webrick/webrick.gemspec: support Ruby 2.3+
    [Bug #14189]

Updated by normalperson (Eric Wong) over 6 years ago

wrote:

I tried the attached patch to remove the :uplevel parameter
for ruby < 2.5, and it passed on Appveyor & Travis for Ruby
2.4. Assumes 2.10 never exists. Most Ruby 2.3 versions had
one failure.

Thanks, but as I stated up the thread I don't like version
guards since they clutter up the code. Since `su' is never
called by default, I don't think it's worth the effort
(it'll only print out "{:uplevel => 1}" instead of raising).

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0