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
[BUG] Can not install digest libraries #14
Comments
|
I'm getting the same issue when trying to do a |
|
We're also running into this at GitLab, resulting in builds errors such as the following: I'm a bit surprised this Gem is even trying to mess with system files. I can see that breaking all sorts of things. In addition, it seems that rolling back would require you to:
|
|
As announced in https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/, Ruby v3.0.0 promoted a number of stdlib libraries, including this one, into a default gem. I think the error above happens because if Ruby 2.7 attempts to use these gems, the gem will attempt to overwrite the system Should this gem be disallowed with Ruby v2 versions, or can these header files be installed locally with the gem? |
|
I think the problem would also arise with Ruby 3.0.0, though. The reason it isn't right now is because Ruby 3.0.0 has digest 3.0.0 as a default gem. If digest were to, for some reason, release a 3.0.1 version, installing that gem with a system Ruby of 3.0.0 would try to update the digest.h file and run in to this issue. Do default gems not get released out-of-cycle with Ruby versions like that? Similarly, Ruby updating to 3.0.1 would presumably produce a digest 3.0.1, which Ruby 3.0.0 installations would try to install if one does a gem update, and they would then start running in to this issue. Finally, if one is using Bundler and included digest 3.0.0 in the bundle, but (hypothetical) digest 3.0.1 had been installed alongside digest 3.0.0 (and didn't run in to this issue), the digest.h that extensions built for that bundle would see would be the one for digest 3.0.1, since Rubygems doesn't manage header files, so far as I know. Because of the fact that it depends on a header file that others can depend on (in my cursory looking, it appears that only https://rubygems.org/gems/digest-sha3 actually does use it), either it shouldn't be a gem or else Rubygems should offer some facility to manage header files. |
|
Good point, I realized the same after I wrote my comment. It seems that https://github.com/ruby/digest/blob/master/ext/digest/extconf.rb will always install this header because I wonder if Ruby has a good way to handle this. Gems that need to link against a specific |
|
@mrkn What do you think about this issue? |
|
@stanhu I don't have any idea about this issue right now because I've never touched |
|
@stanhu As my understanding, this issue is occurred with the following conditions:
RIght? |
|
@mrkn Yes, I believe that's correct. |
|
I guess we need to discuss where should we install a header file when |
|
I opened the ticket for further discussion for the header install location at https://bugs.ruby-lang.org/issues/17760. And please run |
|
It looks like ruby/ruby@5cdf99f (from https://bugs.ruby-lang.org/issues/17761) will fix this issue. |
|
I wonder, if there might be similar case already handled in https://github.com/ruby-gnome/ruby-gnome, which is quite complex system of gems. @kou any insights please? |
|
How about the following? diff --git a/ext/digest/depend b/ext/digest/depend
new file mode 100644
index 0000000..a454e12
--- /dev/null
+++ b/ext/digest/depend
@@ -0,0 +1,3 @@
+install-so: install-headers
+install-headers:
+ $(INSTALL_DATA) $(srcdir)/digest.h $(RUBYARCHDIR)
diff --git a/ext/digest/extconf.rb b/ext/digest/extconf.rb
index a8c6885..ba2c7b6 100644
--- a/ext/digest/extconf.rb
+++ b/ext/digest/extconf.rb
@@ -4,8 +4,4 @@
require "mkmf"
-$INSTALLFILES = {
- "digest.h" => "$(HDRDIR)"
-}
-
create_makefile("digest") |
|
I've just released v3.1.0.pre3 which should fix this issue. (0e1e672) |
|
@knu setting up an unprivileged user: Proving the user can install other gems and compile their extensions: Cannot install v3.0.0: Cannot install v3.1.0.pre3: What do you think? |
Hello,
in net-pop version 0.1.1 ( https://github.com/ruby/net-pop/releases/tag/v0.1.1 ) digest was added as a dependency, since then it tries to install it for me when I want to update my gems with "gem update".
I want to update the gems in my HOME directory as an unprivileged user. What I notice at first glance is that it tries to delete a file from my system, which of course fails due to lack of permissions.
I am sorry if I am wrong here with my request, maybe it is a net-pop issue? I am wondering why it is trying to install digest as a user when it should be installed under the system context.
Thank you.
gem_environment.txt
gem_update_output.txt
The text was updated successfully, but these errors were encountered: