Project

General

Profile

Actions

Bug #11798

closed

MkConfig breaks with frozen strings

Added by deepj (deepj #) almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-12-10 trunk 53014) [x86_64-darwin15]
[ruby-core:72006]

Description

It seems MkConfig(RbConfig) breaks frozen strings mode

/Users/deepj/.rubies/ruby-2.3.0-dev/lib/ruby/2.3.0/x86_64-darwin15/rbconfig.rb:249:in `replace': can't modify frozen String, created at /Users/deepj/.rubies/ruby-2.3.0-dev/lib/ruby/2.3.0/x86_64-darwin15/rbconfig.rb:21 (RuntimeError)
	from /Users/deepj/.rubies/ruby-2.3.0-dev/lib/ruby/2.3.0/x86_64-darwin15/rbconfig.rb:249:in `expand'
	from /Users/deepj/.rubies/ruby-2.3.0-dev/lib/ruby/2.3.0/x86_64-darwin15/rbconfig.rb:253:in `block in <module:RbConfig>'
	from /Users/deepj/.rubies/ruby-2.3.0-dev/lib/ruby/2.3.0/x86_64-darwin15/rbconfig.rb:252:in `each_value'
	from /Users/deepj/.rubies/ruby-2.3.0-dev/lib/ruby/2.3.0/x86_64-darwin15/rbconfig.rb:252:in `<module:RbConfig>'
	from /Users/deepj/.rubies/ruby-2.3.0-dev/lib/ruby/2.3.0/x86_64-darwin15/rbconfig.rb:6:in `<top (required)>'
	from /Users/deepj/dev/oss/rubygems/lib/rubygems.rb:8:in `require'
	from /Users/deepj/dev/oss/rubygems/lib/rubygems.rb:8:in `<top (required)>'
	from -e:1:in `require'
	from -e:1:in `<main>'
rake aborted!

The problem lies at https://github.com/ruby/ruby/blob/ce9b056c5d37ad7760049550b269139f72bdfcfb/tool/mkconfig.rb#L270


Files

mkconfig.patch (531 Bytes) mkconfig.patch deepj (deepj #), 12/09/2015 09:11 PM
Actions #1

Updated by nobu (Nobuyoshi Nakada) almost 9 years ago

  • Status changed from Open to Closed

Applied in changeset r53017.


mkconfig.rb: must not be frozen

  • tool/mkconfig.rb: rbconfig must not be fronzen-string-literal to
    expand CONFIG hash. [ruby-core:72006] [Bug #11798]

Updated by deepj (deepj #) almost 9 years ago

Hi Nobu, I offer this alternative patch. What do you think?

Updated by nobu (Nobuyoshi Nakada) almost 9 years ago

RbConfig.expand has to modify the argument destructively.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0