Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to version 1.2.0 results in undefined symbol: rb_deprecate_constant error #12

Closed
mvz opened this issue Dec 23, 2020 · 13 comments · Fixed by #15
Closed

Update to version 1.2.0 results in undefined symbol: rb_deprecate_constant error #12

mvz opened this issue Dec 23, 2020 · 13 comments · Fixed by #15

Comments

@mvz
Copy link

mvz commented Dec 23, 2020

On Ruby 2.7.2, if I update etc from version 1.1.0 to 1.2.0, all gem commands stop working:

$ gem outdated
cucumber-cucumber-expressions (10.3.0 < 11.0.0)
cucumber-gherkin (15.0.2 < 16.0.0)
cucumber-html-formatter (9.0.0 < 11.0.2)
date (3.0.1 < 3.1.1)
etc (1.1.0 < 1.2.0)
faraday (1.1.0 < 1.2.0)
fiddle (1.0.5 < 1.0.6)
mini_portile2 (2.4.0 < 2.5.0)
psych (3.2.1 < 3.3.0)
$ gem update etc
Updating installed gems
Updating etc
Building native extensions. This could take a while...
Successfully installed etc-1.2.0
Parsing documentation for etc-1.2.0
Done installing documentation for etc after 0 seconds
Parsing documentation for etc-1.2.0
Done installing documentation for etc after 0 seconds
Gems updated: etc
$ gem outdated
/home/matijs/.rbenv/versions/2.7.2/bin/ruby: symbol lookup error:
  /home/matijs/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/etc-1.2.0/lib/etc.so:
  undefined symbol: rb_deprecate_constant
$ ruby --version
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
@KitaitiMakoto
Copy link

I have encountered the same problem. My environment is:

  • Intel Core i7
  • WSL2
  • Ubuntu 20.04
  • ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]

@pistolfly
Copy link

I have encountered the same problem.

$ gem list
/opt/ruby-2.7.1/bin/ruby: symbol lookup error: /opt/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/etc-1.2.0/lib/etc.so: undefined symbol: rb_deprecate_constant
  • Amazon Linux release 2 (Karoo)
  • ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]

@hsbt
Copy link
Member

hsbt commented Dec 25, 2020

I will investigate it.

Basically, you don't need to update etc now because 1.2.0 is only added Ractor support.

@KitaitiMakoto
Copy link

Thank you!

@hermanndetz
Copy link

Same problem here. Is there a workaround how to downgrade the gem again? This causes gem and irb to crash.

/usr/local/bin/ruby: symbol lookup error: /usr/local/lib/ruby/gems/2.7.0/gems/etc-1.2.0/lib/etc.so: undefined symbol: rb_deprecate_constant

Moreover, I tried to compile ruby 3 from source. Actually before I was aware of that problem. But it seems, I can't even run make install for the ruby 3 codebase.

Any help, how to resolve this would be greatly appreciated!

@mvz
Copy link
Author

mvz commented Dec 26, 2020

@hermanndetz you have to manually remove the files for etc version 1.2.0:

  • /usr/local/lib/ruby/gems/2.7.0/gems/etc-1.2.0/
  • /usr/local/lib/ruby/gems/2.7.0/specifications/etc-1.2.0.gemspec
  • Optionally, /usr/local/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0-static/etc-1.2.0/

@hermanndetz
Copy link

Thanks a lot! This saved my day

@shirts
Copy link

shirts commented Jan 13, 2021

👋 Any updates on this for those that don't want to take the downgrade path?

@abdelmegahed-rdccaa
Copy link

Any updates on this.

@oz
Copy link

oz commented Mar 25, 2021

I guess this commit breaks with 2.7 (or other versions w/o deprecate_constant ?): 25c5381

... but I don't know how to fix it. 😬

@svoop
Copy link

svoop commented Apr 6, 2021

@hsbt Did your investigation reveal any findings? While downgrading etc to 1.1.0 helps, I'm falling into this pit every now and then e.g. when a passenger update makes me check outdated global (non-app) gems. Maybe fail to install version 1.2.0 if the current Ruby doesn't know deprecate_constant?

@ViralSeq
Copy link

ViralSeq commented Jun 4, 2021

have the same issue with Ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]

@ioquatix
Copy link
Member

ioquatix commented Jun 4, 2021

My guess is the check for rb_deprecate_constant is wrong and causing rb_deprecate_constant to be declared even if the implementation is never defined anywhere, thus when you load the compiled code, it tries to resolve the symbol and fails.

void rb_deprecate_constant(VALUE mod, const char *name);

It should be this line which is causing the problem.

After reviewing the code in more detail, it seems like maybe the declaration is not publicly visible:

https://github.com/ioquatix/ruby/blame/93be7a4c6bda8269b3d82ce4cfde6b2bde3b9718/internal/variable.h#L47

It's in internal which I don't believe is public interface. @nobu you worked on this last, do you know what is going on? Should we move this to public include directory?

nobu added a commit that referenced this issue Oct 18, 2021
@nobu nobu closed this as completed in #15 Oct 19, 2021
nobu added a commit that referenced this issue Oct 19, 2021
matzbot pushed a commit to ruby/ruby that referenced this issue Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.