[#97536] [Ruby master Bug#16694] JIT vs hardened GCC with PCH — v.ondruch@...
Issue #16694 has been reported by vo.x (Vit Ondruch).
11 messages
2020/03/18
[ruby-core:97646] [Ruby master Feature#16744] Flag to load current bundle without using bundle exec
From:
headius@...
Date:
2020-03-31 17:29:31 UTC
List:
ruby-core #97646
Issue #16744 has been updated by headius (Charles Nutter).
> Given that latest Bundler no longer creates a subprocess for bundle exec
Your example is incorrect. `exec` reuses process ID.
```
$ jruby -e 'puts $$; exec %{jruby -e "puts $$"}'
85727
85727
```
----------------------------------------
Feature #16744: Flag to load current bundle without using bundle exec
https://bugs.ruby-lang.org/issues/16744#change-84845
* Author: headius (Charles Nutter)
* Status: Open
* Priority: Normal
----------------------------------------
The `bundle exec` command is used by Ruby users primarily to start up a Ruby command or application with only its specific locked dependencies wired up. Unfortunately to do this it currently double-launches, executing a second Ruby command and doubling the base startup time for these use cases. With Bundler becoming part of the standard library, it seems a good time to add support for doing what `bundle exec` does without requiring a relaunch.
For many years, JRuby has implemented the `-G`/`--gemfile` flag which requires in `bundler/setup` before user code starts, eliminating the need to bundle exec in these situations.
https://github.com/jruby/jruby/commit/ea0eed02b4eb57c2198afa9fd47f94bc46cfc69f
This is based on the same flags in Rubinius:
https://github.com/rubinius/rubinius/commit/edc94f2e3a61d8c94031a942b2024c6c5aa3ea94
There's at least one more commit later on in Rubinius that fixes some interations between `-G` and `-S`.
Obviously this does not eliminate `bundle exec` use cases where the target command is not a Ruby command, but that is a very specific (and rather strange to me) feature. The majority of use cases are booting up a Ruby command, for which this implementation of `-G` would be sufficient (I think).
There may be different or additional ways that `bundle exec` attempts to isolate the subcommand's environment and dependencies, but I believe requiring `bundler/setup` at boot comes pretty close.
See also this bug report where I suggest using JRuby's embedding APIs to do `bundle exec`. We very much want to help eliminate this double-launching, one way or another.
https://github.com/rubygems/rubygems/issues/3246
--
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>