[#98645] [Ruby master Misc#16933] DevelopersMeeting20200618Japan — mame@...

Issue #16933 has been reported by mame (Yusuke Endoh).

14 messages 2020/06/04

[#98663] [Ruby master Bug#16936] `make check TESTS="-n !/Foo#method/"` not skipping the test case — jaruga@...

Issue #16936 has been reported by jaruga (Jun Aruga).

13 messages 2020/06/05

[#98772] [Ruby master Bug#16959] Weakmap has specs and third-party usage despite being a private API — headius@...

Issue #16959 has been reported by headius (Charles Nutter).

13 messages 2020/06/12

[#98826] [Ruby master Feature#16963] Remove English.rb from Ruby 2.8/3.0 — hsbt@...

Issue #16963 has been reported by hsbt (Hiroshi SHIBATA).

9 messages 2020/06/16

[#98920] [Ruby master Bug#16978] Ruby should not use realpath for __FILE__ — v.ondruch@...

Issue #16978 has been reported by vo.x (Vit Ondruch).

24 messages 2020/06/23

[#98947] [Ruby master Feature#16986] Anonymous Struct literal — ko1@...

Issue #16986 has been reported by ko1 (Koichi Sasada).

66 messages 2020/06/26

[#98964] [Ruby master Feature#16989] Sets: need ♥️ — marcandre-ruby-core@...

Issue #16989 has been reported by marcandre (Marc-Andre Lafortune).

33 messages 2020/06/26

[#98965] [Ruby master Feature#16990] Sets: operators compatibility with Array — marcandre-ruby-core@...

Issue #16990 has been reported by marcandre (Marc-Andre Lafortune).

11 messages 2020/06/26

[#98968] [Ruby master Feature#16993] Sets: from hash keys using Hash#key_set — marcandre-ruby-core@...

Issue #16993 has been reported by marcandre (Marc-Andre Lafortune).

10 messages 2020/06/26

[#98997] [Ruby master Feature#17000] 2.7.2 turns off deprecation warnings by deafult — mame@...

Issue #17000 has been reported by mame (Yusuke Endoh).

16 messages 2020/06/30

[ruby-core:98794] [Ruby master Bug#16680] [Breaking Change] Ruby 2.7 not support symlinks folder in $LOAD_PATH to work with autoload.

From: nobu@...
Date: 2020-06-13 23:26:00 UTC
List: ruby-core #98794
Issue #16680 has been updated by nobu (Nobuyoshi Nakada).


I could reproduce it with 2.7.1 and 2.7 head.

----------------------------------------
Bug #16680: [Breaking Change] Ruby 2.7 not support  symlinks folder in $LOAD_PATH to work with autoload.
https://bugs.ruby-lang.org/issues/16680#change-86153

* Author: zw963 (Wei Zheng)
* Status: Open
* Priority: Normal
* ruby -v: 2.7.0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
Following is a full reproducible procees, i will use a gem named 'looksee' to reproduce this.

1. gem install looksee

2. goto gem folder, copy lib content into /tmp/tesst_looksee
so, for now, we have a folder like this:
```sh
 ╰─ $ tree /tmp/test_looksee
/tmp/test_looksee
└── lib
    ├── looksee
    │   ├── adapter
    │   │   ├── base.rb
    │   │   └── rubinius.rb
    │   ├── adapter.rb
    │   ├── clean.rb
    │   ├── columnizer.rb
    │   ├── core_ext.rb
    │   ├── editor.rb
    │   ├── help.rb
    │   ├── inspector.rb
    │   ├── lookup_path.rb
    │   ├── mri.so
    │   └── version.rb
    └── looksee.rb
```

3.  create a new symlinks to this folder.

```sh
 ╰─ $ln -s /tmp/test_looksee /tmp/test_looksee1

  ╰─ $ ls -alhd /tmp/test_looksee*
drwxr-xr-x 3 zw963 zw963 60 2020-03-08 01:39 /tmp/test_looksee/
lrwxrwxrwx 1 zw963 zw963 13 2020-03-08 02:08 /tmp/test_looksee1 -> test_looksee//
```

4. run following command to reproduce this issue.

```sh
 ╰─ $ ruby -I/tmp/test_looksee1/lib/ -rlooksee -e 'puts 100'
Traceback (most recent call last):
        10: from /home/zw963/others/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
         9: from /home/zw963/others/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
         8: from /tmp/test_looksee1/lib/looksee.rb:1:in `<top (required)>'
         7: from /home/zw963/others/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
         6: from /home/zw963/others/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
         5: from /tmp/test_looksee1/lib/looksee/clean.rb:4:in `<top (required)>'
         4: from /tmp/test_looksee1/lib/looksee/clean.rb:171:in `<module:Looksee>'
         3: from /home/zw963/others/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
         2: from /home/zw963/others/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
         1: from /tmp/test_looksee1/lib/looksee/adapter.rb:1:in `<top (required)>'
/tmp/test_looksee1/lib/looksee/adapter.rb:2:in `<module:Looksee>': uninitialized constant Looksee::Adapter (NameError)
```

So, maybe you want to ask why use symlinks folder in $LOAD_PATH, but, i think this should be a quite common case, 
many ruby developer have local gem not manager by `Rubygems` or `Bundler`,  it just use `$LOAD_PATH`
to require/load it, it hard to ensure everyone folder is not a symlink.

I think this is a ** breaking change** , becuase all those code is work quite well before 2.7, because old code always 
following symlinks,  following is a example from ruby 2.6.3, it working.

```sh
 ╰─ $ ruby -I/tmp/test_looksee1/lib/ -rlooksee -e 'puts 100'
Traceback (most recent call last):
        8: from /home/zw963/others/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        7: from /home/zw963/others/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        6: from /tmp/test_looksee/lib/looksee.rb:1:in `<top (required)>'
        5: from /home/zw963/others/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        4: from /home/zw963/others/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        3: from /tmp/test_looksee/lib/looksee/clean.rb:4:in `<top (required)>'
        2: from /tmp/test_looksee/lib/looksee/clean.rb:171:in `<module:Looksee>'
        1: from /home/zw963/others/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/home/zw963/others/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': incompatible library version - /tmp/test_looksee/lib/looksee/mri.so (LoadError)
```

As we can see, those breaking code come from `autoload :Adapter, 'looksee/adapter'`,  i suspect
maybe nested autoload cause this new issue, but only a guess, please check, thank you.

![](clipboard-202003080224-xglcq.png)




---Files--------------------------------
clipboard-202003080224-xglcq.png (183 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>

In This Thread