ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:61158] RFC: some --with-static-linked-ext fixes
@ 2014-03-01  2:26 Eric Wong
  2014-03-02  1:02 ` [ruby-core:61208] " Nobuyoshi Nakada
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2014-03-01  2:26 UTC (permalink / raw
  To: ruby-core

(going on a tangent from https://bugs.ruby-lang.org/issues/9579)

git://80x24.org/ruby.git static-ext
http://bogomips.org/ruby.git/patch?id=a1c2758e2f742

 * ext/extmk.rb: requires the .rb if the .rb and .so have the
   same prefix (e.g. socket.rb vs socket.so).
   Use rb_provide(feature) if feature.so is loaded and feature.rb
   does not exist
 * ext/openssl/extconf.rb: preload stringio.so
 * ext/psych/extconf.rb: preload stringio.so
 * load.c (ruby_init_ext): check rb_provided and use rb_provide

Note: tests remain broken because mathn/complex and mathn/rational
are loaded by default.  I don't know what to do about this, define
a new, special API for hooking `require' on static-linked-ext?

Or define an internal (but accessible via Ruby) methods
to call nurat_canonicalization and nucomp_canonicalization
so there's no .so even in the dynamic case?

Part of me wants to avoid adding more .so for Init_ things like
this anyways (e.g. require "fiber").

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

* [ruby-core:61208] Re: RFC: some --with-static-linked-ext fixes
  2014-03-01  2:26 [ruby-core:61158] RFC: some --with-static-linked-ext fixes Eric Wong
@ 2014-03-02  1:02 ` Nobuyoshi Nakada
  2014-03-02  1:58   ` [ruby-core:61210] " Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Nobuyoshi Nakada @ 2014-03-02  1:02 UTC (permalink / raw
  To: Ruby developers

(2014/03/01 11:26), Eric Wong wrote:
>  * ext/extmk.rb: requires the .rb if the .rb and .so have the
>    same prefix (e.g. socket.rb vs socket.so).
>    Use rb_provide(feature) if feature.so is loaded and feature.rb
>    does not exist
>  * ext/openssl/extconf.rb: preload stringio.so
>  * ext/psych/extconf.rb: preload stringio.so
>  * load.c (ruby_init_ext): check rb_provided and use rb_provide

load.c seems necessary, please commit it only.
Others seem unnecessary.

-- 
Nobu Nakada

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

* [ruby-core:61210] Re: RFC: some --with-static-linked-ext fixes
  2014-03-02  1:02 ` [ruby-core:61208] " Nobuyoshi Nakada
@ 2014-03-02  1:58   ` Eric Wong
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Wong @ 2014-03-02  1:58 UTC (permalink / raw
  To: Ruby developers

Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
> load.c seems necessary, please commit it only.
> Others seem unnecessary.

You're right; it took me a while of testing to get it :x
r45232

Now, how to run the test suite using static-linked-ext...

How about introducing a new internal API:

	rb_require_hook_register("foo", Init_foo);

So any calls to `require "foo"' call Init_foo lazily?
It would make it easier to have consistent code between
static/dynamic-ext builds of Ruby.

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

end of thread, other threads:[~2014-03-02  3:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-01  2:26 [ruby-core:61158] RFC: some --with-static-linked-ext fixes Eric Wong
2014-03-02  1:02 ` [ruby-core:61208] " Nobuyoshi Nakada
2014-03-02  1:58   ` [ruby-core:61210] " Eric Wong

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).