ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:103088] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`?
@ 2021-03-30  0:50 muraken
  2021-03-30  0:51 ` [ruby-core:103089] " muraken
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: muraken @ 2021-03-30  0:50 UTC (permalink / raw)
  To: ruby-core

Issue #17760 has been reported by mrkn (Kenta Murata).

----------------------------------------
Feature #17760: Where we should install a header file when `gem install --user`?
https://bugs.ruby-lang.org/issues/17760

* Author: mrkn (Kenta Murata)
* Status: Open
* Priority: Normal
----------------------------------------
As `digest` have been made a default gem at Ruby 3.0,  it can be installed by `gem install` command.

When we install `digest`, `digest.h` is installed at the same directory as `ruby.h`.  But when we use `gem install --user` for installing it, where should `digest.h` is installed in?

Now, the location of `digest.h` is always the same directory as `ruby.h` regardless of whether we use `gem install --user`.  It occurs permission error when non-root user uses `gem install --user` for installing `digest` on the system-ruby.



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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:103089] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`?
  2021-03-30  0:50 [ruby-core:103088] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`? muraken
@ 2021-03-30  0:51 ` muraken
  2021-03-30 14:20 ` [ruby-core:103101] " nobu
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: muraken @ 2021-03-30  0:51 UTC (permalink / raw)
  To: ruby-core

Issue #17760 has been updated by mrkn (Kenta Murata).


The permission error was reported at https://github.com/ruby/digest/issues/14.

----------------------------------------
Feature #17760: Where we should install a header file when `gem install --user`?
https://bugs.ruby-lang.org/issues/17760#change-91153

* Author: mrkn (Kenta Murata)
* Status: Open
* Priority: Normal
----------------------------------------
As `digest` have been made a default gem at Ruby 3.0,  it can be installed by `gem install` command.

When we install `digest`, `digest.h` is installed at the same directory as `ruby.h`.  But when we use `gem install --user` for installing it, where should `digest.h` is installed in?

Now, the location of `digest.h` is always the same directory as `ruby.h` regardless of whether we use `gem install --user`.  It occurs permission error when non-root user uses `gem install --user` for installing `digest` on the system-ruby.



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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:103101] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`?
  2021-03-30  0:50 [ruby-core:103088] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`? muraken
  2021-03-30  0:51 ` [ruby-core:103089] " muraken
@ 2021-03-30 14:20 ` nobu
  2021-10-14 15:40 ` [ruby-core:105635] " Eregon (Benoit Daloze)
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: nobu @ 2021-03-30 14:20 UTC (permalink / raw)
  To: ruby-core

Issue #17760 has been updated by nobu (Nobuyoshi Nakada).

Backport deleted (2.5: REQUIRED, 2.6: REQUIRED, 2.7: REQUIRED, 3.0: REQUIRED)
Status changed from Open to Third Party's Issue
Tracker changed from Bug to Feature

This is because rubygems doesn't manage header files installed from gems, since no gems had installed headers until digest has been gemified.
Now rubygems needs to support such gems.

----------------------------------------
Feature #17760: Where we should install a header file when `gem install --user`?
https://bugs.ruby-lang.org/issues/17760#change-91167

* Author: mrkn (Kenta Murata)
* Status: Third Party's Issue
* Priority: Normal
----------------------------------------
As `digest` have been made a default gem at Ruby 3.0,  it can be installed by `gem install` command.

When we install `digest`, `digest.h` is installed at the same directory as `ruby.h`.  But when we use `gem install --user` for installing it, where should `digest.h` is installed in?

Now, the location of `digest.h` is always the same directory as `ruby.h` regardless of whether we use `gem install --user`.  It occurs permission error when non-root user uses `gem install --user` for installing `digest` on the system-ruby.



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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:105635] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`?
  2021-03-30  0:50 [ruby-core:103088] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`? muraken
  2021-03-30  0:51 ` [ruby-core:103089] " muraken
  2021-03-30 14:20 ` [ruby-core:103101] " nobu
@ 2021-10-14 15:40 ` Eregon (Benoit Daloze)
  2021-10-15  7:44 ` [ruby-core:105639] " byroot (Jean Boussier)
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Eregon (Benoit Daloze) @ 2021-10-14 15:40 UTC (permalink / raw)
  To: ruby-core

Issue #17760 has been updated by Eregon (Benoit Daloze).


Is there a RubyGems issue tracking this?

----------------------------------------
Feature #17760: Where we should install a header file when `gem install --user`?
https://bugs.ruby-lang.org/issues/17760#change-94125

* Author: mrkn (Kenta Murata)
* Status: Third Party's Issue
* Priority: Normal
----------------------------------------
As `digest` have been made a default gem at Ruby 3.0,  it can be installed by `gem install` command.

When we install `digest`, `digest.h` is installed at the same directory as `ruby.h`.  But when we use `gem install --user` for installing it, where should `digest.h` is installed in?

Now, the location of `digest.h` is always the same directory as `ruby.h` regardless of whether we use `gem install --user`.  It occurs permission error when non-root user uses `gem install --user` for installing `digest` on the system-ruby.



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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:105639] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`?
  2021-03-30  0:50 [ruby-core:103088] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`? muraken
                   ` (2 preceding siblings ...)
  2021-10-14 15:40 ` [ruby-core:105635] " Eregon (Benoit Daloze)
@ 2021-10-15  7:44 ` byroot (Jean Boussier)
  2021-10-15  8:05 ` [ruby-core:105640] " deivid
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: byroot (Jean Boussier) @ 2021-10-15  7:44 UTC (permalink / raw)
  To: ruby-core

Issue #17760 has been updated by byroot (Jean Boussier).


@deivid are you aware of this issue? Any idea how we could fix this or what decision would need to be taken?

I fear that the `digest` extraction might cause major problem to people trying to upgrade to 3.1 next year, or trying to test `3.1.0-preview1` soon.

----------------------------------------
Feature #17760: Where we should install a header file when `gem install --user`?
https://bugs.ruby-lang.org/issues/17760#change-94129

* Author: mrkn (Kenta Murata)
* Status: Third Party's Issue
* Priority: Normal
----------------------------------------
As `digest` have been made a default gem at Ruby 3.0,  it can be installed by `gem install` command.

When we install `digest`, `digest.h` is installed at the same directory as `ruby.h`.  But when we use `gem install --user` for installing it, where should `digest.h` is installed in?

Now, the location of `digest.h` is always the same directory as `ruby.h` regardless of whether we use `gem install --user`.  It occurs permission error when non-root user uses `gem install --user` for installing `digest` on the system-ruby.



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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:105640] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`?
  2021-03-30  0:50 [ruby-core:103088] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`? muraken
                   ` (3 preceding siblings ...)
  2021-10-15  7:44 ` [ruby-core:105639] " byroot (Jean Boussier)
@ 2021-10-15  8:05 ` deivid
  2021-10-15 11:01 ` [ruby-core:105642] " byroot (Jean Boussier)
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: deivid @ 2021-10-15  8:05 UTC (permalink / raw)
  To: ruby-core

Issue #17760 has been updated by deivid (David Rodríguez).


Hi, no I wasn't, and I'm not sure how it should be fixed. If I understand correctly, this is about cases where rubygems does not have write access to the location where ruby itself is installed, while it does have write access to the location where gems are installed, correct?

----------------------------------------
Feature #17760: Where we should install a header file when `gem install --user`?
https://bugs.ruby-lang.org/issues/17760#change-94130

* Author: mrkn (Kenta Murata)
* Status: Third Party's Issue
* Priority: Normal
----------------------------------------
As `digest` have been made a default gem at Ruby 3.0,  it can be installed by `gem install` command.

When we install `digest`, `digest.h` is installed at the same directory as `ruby.h`.  But when we use `gem install --user` for installing it, where should `digest.h` is installed in?

Now, the location of `digest.h` is always the same directory as `ruby.h` regardless of whether we use `gem install --user`.  It occurs permission error when non-root user uses `gem install --user` for installing `digest` on the system-ruby.



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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:105642] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`?
  2021-03-30  0:50 [ruby-core:103088] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`? muraken
                   ` (4 preceding siblings ...)
  2021-10-15  8:05 ` [ruby-core:105640] " deivid
@ 2021-10-15 11:01 ` byroot (Jean Boussier)
  2021-10-15 16:25 ` [ruby-core:105645] " Eregon (Benoit Daloze)
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: byroot (Jean Boussier) @ 2021-10-15 11:01 UTC (permalink / raw)
  To: ruby-core

Issue #17760 has been updated by byroot (Jean Boussier).


Kind of yes. From my understanding the problem is that $INSTALL_FILES always install files in `site_ruby` https://github.com/ruby/digest/blob/1cb6bac1a6732a1415278b94fad2fdc695477dec/ext/digest/extconf.rb#L7-L9

So from my limited understanding I see two ways out of this:

  - Require that `site_ruby` is user writable (sounds weird)
  - Have a location defined by rubygems that acts as "user" site ruby.

But then I suppose them that compile against `digest.h` would also need to know where to look, I'm really unsure how it's supposed to work. If I have 5 different versions of digest, which one should I compile against?

e.g. I have `app1` with `digest 3.0.0` and `app2` with `digest 3.2.0`, both have `somegem-that-link-to-digest`, this means we'd need to compile that gem twice and link against different headers?

Seems complicated. Maybe I should put this to the next developers meeting agenda.

----------------------------------------
Feature #17760: Where we should install a header file when `gem install --user`?
https://bugs.ruby-lang.org/issues/17760#change-94132

* Author: mrkn (Kenta Murata)
* Status: Third Party's Issue
* Priority: Normal
----------------------------------------
As `digest` have been made a default gem at Ruby 3.0,  it can be installed by `gem install` command.

When we install `digest`, `digest.h` is installed at the same directory as `ruby.h`.  But when we use `gem install --user` for installing it, where should `digest.h` is installed in?

Now, the location of `digest.h` is always the same directory as `ruby.h` regardless of whether we use `gem install --user`.  It occurs permission error when non-root user uses `gem install --user` for installing `digest` on the system-ruby.



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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:105645] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`?
  2021-03-30  0:50 [ruby-core:103088] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`? muraken
                   ` (5 preceding siblings ...)
  2021-10-15 11:01 ` [ruby-core:105642] " byroot (Jean Boussier)
@ 2021-10-15 16:25 ` Eregon (Benoit Daloze)
  2021-10-15 16:30 ` [ruby-core:105646] " Eregon (Benoit Daloze)
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Eregon (Benoit Daloze) @ 2021-10-15 16:25 UTC (permalink / raw)
  To: ruby-core

Issue #17760 has been updated by Eregon (Benoit Daloze).


byroot (Jean Boussier) wrote in #note-8:
> But then I suppose them that compile against `digest.h` would also need to know where to look, I'm really unsure how it's supposed to work. If I have 5 different versions of digest, which one should I compile against?

Because digest is a default gem, I think there is a simple answer here: latest version wins.
That's the behavior of default gems, if you `gem install some_default_gem`, RubyGems will then always use that version (instead of the version shipped with Ruby).

When using bundler, I'd think it's possible to choose an explicit version, and bundler would resolve which one is used.
Probably RubyGems and/or Bundler need to set CPATH to the header is found (seems better), or we need some explicit API in RubyGems and/or mkmf for a gem to ask headers for another gem (seems bad as then we have the version problem).

----------------------------------------
Feature #17760: Where we should install a header file when `gem install --user`?
https://bugs.ruby-lang.org/issues/17760#change-94135

* Author: mrkn (Kenta Murata)
* Status: Third Party's Issue
* Priority: Normal
----------------------------------------
As `digest` have been made a default gem at Ruby 3.0,  it can be installed by `gem install` command.

When we install `digest`, `digest.h` is installed at the same directory as `ruby.h`.  But when we use `gem install --user` for installing it, where should `digest.h` is installed in?

Now, the location of `digest.h` is always the same directory as `ruby.h` regardless of whether we use `gem install --user`.  It occurs permission error when non-root user uses `gem install --user` for installing `digest` on the system-ruby.



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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:105646] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`?
  2021-03-30  0:50 [ruby-core:103088] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`? muraken
                   ` (6 preceding siblings ...)
  2021-10-15 16:25 ` [ruby-core:105645] " Eregon (Benoit Daloze)
@ 2021-10-15 16:30 ` Eregon (Benoit Daloze)
  2021-10-15 17:16 ` [ruby-core:105647] " byroot (Jean Boussier)
  2021-10-21  9:41 ` [ruby-core:105725] " knu (Akinori MUSHA)
  9 siblings, 0 replies; 11+ messages in thread
From: Eregon (Benoit Daloze) @ 2021-10-15 16:30 UTC (permalink / raw)
  To: ruby-core

Issue #17760 has been updated by Eregon (Benoit Daloze).


byroot (Jean Boussier) wrote in #note-8:
> e.g. I have `app1` with `digest 3.0.0` and `app2` with `digest 3.2.0`, both have `somegem-that-link-to-digest`, this means we'd need to compile that gem twice and link against different headers?

This is a good point.
Maybe it can be resolved by `somegem-that-link-to-digest` depending on an exact version (or small range of versions) of digest which have the same header and fully compatible (both forward and backward between all those versions)?
I.e., the header is also part of API (or technically ABI) so if `digest` changes the header in some incompatible way (including what gets generated by gems using it), then it should bump the major version (or some other well-documented scheme).

> Seems complicated. Maybe I should put this to the next developers meeting agenda.

Yes, I think that would be useful.


----------------------------------------
Feature #17760: Where we should install a header file when `gem install --user`?
https://bugs.ruby-lang.org/issues/17760#change-94136

* Author: mrkn (Kenta Murata)
* Status: Third Party's Issue
* Priority: Normal
----------------------------------------
As `digest` have been made a default gem at Ruby 3.0,  it can be installed by `gem install` command.

When we install `digest`, `digest.h` is installed at the same directory as `ruby.h`.  But when we use `gem install --user` for installing it, where should `digest.h` is installed in?

Now, the location of `digest.h` is always the same directory as `ruby.h` regardless of whether we use `gem install --user`.  It occurs permission error when non-root user uses `gem install --user` for installing `digest` on the system-ruby.



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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:105647] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`?
  2021-03-30  0:50 [ruby-core:103088] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`? muraken
                   ` (7 preceding siblings ...)
  2021-10-15 16:30 ` [ruby-core:105646] " Eregon (Benoit Daloze)
@ 2021-10-15 17:16 ` byroot (Jean Boussier)
  2021-10-21  9:41 ` [ruby-core:105725] " knu (Akinori MUSHA)
  9 siblings, 0 replies; 11+ messages in thread
From: byroot (Jean Boussier) @ 2021-10-15 17:16 UTC (permalink / raw)
  To: ruby-core

Issue #17760 has been updated by byroot (Jean Boussier).


> then it should bump the major version (or some other well-documented scheme).

I can hardly see something like this working in practice. Maybe for digest it would work as realistically it won't change much in the future. But if Rubygems introduce this header file management, other gems will start using it, and I can foresee tons of problems.



----------------------------------------
Feature #17760: Where we should install a header file when `gem install --user`?
https://bugs.ruby-lang.org/issues/17760#change-94137

* Author: mrkn (Kenta Murata)
* Status: Third Party's Issue
* Priority: Normal
----------------------------------------
As `digest` have been made a default gem at Ruby 3.0,  it can be installed by `gem install` command.

When we install `digest`, `digest.h` is installed at the same directory as `ruby.h`.  But when we use `gem install --user` for installing it, where should `digest.h` is installed in?

Now, the location of `digest.h` is always the same directory as `ruby.h` regardless of whether we use `gem install --user`.  It occurs permission error when non-root user uses `gem install --user` for installing `digest` on the system-ruby.



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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:105725] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`?
  2021-03-30  0:50 [ruby-core:103088] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`? muraken
                   ` (8 preceding siblings ...)
  2021-10-15 17:16 ` [ruby-core:105647] " byroot (Jean Boussier)
@ 2021-10-21  9:41 ` knu (Akinori MUSHA)
  9 siblings, 0 replies; 11+ messages in thread
From: knu (Akinori MUSHA) @ 2021-10-21  9:41 UTC (permalink / raw)
  To: ruby-core

Issue #17760 has been updated by knu (Akinori MUSHA).


We have discussed this in today's developer meeting.

- As a tentative workaround, I'll fix the digest gem not to try to install `digest.h` to an unwritable directory so `gem install --user digest` succeeds.
- It is (technically) possible for RubyGems to specify where to install header files by passing `HDRDIR=destination` to `make install` for example, and to expose the installed header files of activated gems to a newly built gem by passing `CPPFLAGS` to `extconf.rb` that lists the header directories.


----------------------------------------
Feature #17760: Where we should install a header file when `gem install --user`?
https://bugs.ruby-lang.org/issues/17760#change-94224

* Author: mrkn (Kenta Murata)
* Status: Third Party's Issue
* Priority: Normal
----------------------------------------
As `digest` have been made a default gem at Ruby 3.0,  it can be installed by `gem install` command.

When we install `digest`, `digest.h` is installed at the same directory as `ruby.h`.  But when we use `gem install --user` for installing it, where should `digest.h` is installed in?

Now, the location of `digest.h` is always the same directory as `ruby.h` regardless of whether we use `gem install --user`.  It occurs permission error when non-root user uses `gem install --user` for installing `digest` on the system-ruby.



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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-10-21  9:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30  0:50 [ruby-core:103088] [Ruby master Feature#17760] Where we should install a header file when `gem install --user`? muraken
2021-03-30  0:51 ` [ruby-core:103089] " muraken
2021-03-30 14:20 ` [ruby-core:103101] " nobu
2021-10-14 15:40 ` [ruby-core:105635] " Eregon (Benoit Daloze)
2021-10-15  7:44 ` [ruby-core:105639] " byroot (Jean Boussier)
2021-10-15  8:05 ` [ruby-core:105640] " deivid
2021-10-15 11:01 ` [ruby-core:105642] " byroot (Jean Boussier)
2021-10-15 16:25 ` [ruby-core:105645] " Eregon (Benoit Daloze)
2021-10-15 16:30 ` [ruby-core:105646] " Eregon (Benoit Daloze)
2021-10-15 17:16 ` [ruby-core:105647] " byroot (Jean Boussier)
2021-10-21  9:41 ` [ruby-core:105725] " knu (Akinori MUSHA)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).