Issue #16738 has been updated by ihdadi.page / gmail.com ( ).

File network-2402637_640.jpg added

bjfish (Brandon Fish) wrote:
> The `RbConfig::CONFIG["SDKROOT"]` is not frozen on macOS when the `SDKROOT` environment variable is set which causes the kernel spec (https://github.com/ruby/ruby/blob/1b3339528c0804aa0e673bd3f15be8b087d17bd8/spec/ruby/library/rbconfig/rbconfig_spec.rb#L27) to fail.
> 
> **Spec Failure** 
> ```
> 1)
> RbConfig::CONFIG contains no frozen strings even with --enable-frozen-string-literal FAILED
> Expected "SDKROOT Failure\n" + "Done\n" == "Done\n"
> to be truthy but was false
> /Users/bfish/Documents/projects/spec/library/rbconfig/rbconfig_spec.rb:28:in `block (2 levels) in <top (required)>'
> /Users/bfish/Documents/projects/spec/library/rbconfig/rbconfig_spec.rb:4:in `<top (required)>'
> ```
> 
> **Example**
> ```
> % unset SDKROOT
> % ruby -e 'p RbConfig::CONFIG["SDKROOT"].frozen?'
> false
> % export SDKROOT="test"
> % ruby -e 'p RbConfig::CONFIG["SDKROOT"].frozen?'
> true
> 
> ```
> 
> **Environment**
> macOS
> 
> **Versions Tested**
> 2.6.5
> 2.7.0



----------------------------------------
Bug #16738: RbConfig::CONFIG["SDKROOT"] not frozen on macOS
https://bugs.ruby-lang.org/issues/16738#change-85505

* Author: bjfish (Brandon Fish)
* Status: Closed
* Priority: Normal
* ruby -v: 2.6.5, 2.7.0
* Backport: 2.5: DONE, 2.6: DONE, 2.7: DONE
----------------------------------------
The `RbConfig::CONFIG["SDKROOT"]` is not frozen on macOS when the `SDKROOT` environment variable is set which causes the kernel spec (https://github.com/ruby/ruby/blob/1b3339528c0804aa0e673bd3f15be8b087d17bd8/spec/ruby/library/rbconfig/rbconfig_spec.rb#L27) to fail.

**Spec Failure** 
```
1)
RbConfig::CONFIG contains no frozen strings even with --enable-frozen-string-literal FAILED
Expected "SDKROOT Failure\n" + "Done\n" == "Done\n"
to be truthy but was false
/Users/bfish/Documents/projects/spec/library/rbconfig/rbconfig_spec.rb:28:in `block (2 levels) in <top (required)>'
/Users/bfish/Documents/projects/spec/library/rbconfig/rbconfig_spec.rb:4:in `<top (required)>'
```

**Example**
```
% unset SDKROOT
% ruby -e 'p RbConfig::CONFIG["SDKROOT"].frozen?'
false
% export SDKROOT="test"
% ruby -e 'p RbConfig::CONFIG["SDKROOT"].frozen?'
true

```

**Environment**
macOS

**Versions Tested**
2.6.5
2.7.0


---Files--------------------------------
network-2402637_640.jpg (54.7 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>