@@ -67,6 +67,14 @@ def wasi_exec_model
6767 use_js_gem ? "reactor" : "command"
6868 end
6969
70+ def with_unbundled_env ( &block )
71+ __skip__ = if defined? ( Bundler )
72+ Bundler . with_unbundled_env ( &block )
73+ else
74+ block . call
75+ end
76+ end
77+
7078 def cache_key ( digest )
7179 raise NotImplementedError
7280 end
@@ -87,27 +95,22 @@ def build(executor, options)
8795 end
8896 build . crossruby . clean ( executor ) if options [ :clean ]
8997
90- do_build =
91- proc do
92- build . crossruby . build (
93- executor ,
94- remake : options [ :remake ] ,
95- reconfigure : options [ :reconfigure ]
96- )
97- end
98+ self . with_unbundled_env do
99+ build . crossruby . build (
100+ executor ,
101+ remake : options [ :remake ] ,
102+ reconfigure : options [ :reconfigure ]
103+ )
104+ end
98105
99- __skip__ =
100- if defined? ( Bundler )
101- Bundler . with_unbundled_env ( &do_build )
102- else
103- do_build . call
104- end
105106 build . crossruby . artifact
106107 end
107108
108109 def build_gem_exts ( executor , gem_home )
109110 build = derive_build
110- self . _build_gem_exts ( executor , build , gem_home )
111+ self . with_unbundled_env do
112+ self . _build_gem_exts ( executor , build , gem_home )
113+ end
111114 end
112115
113116 def link_gem_exts ( executor , ruby_root , gem_home , module_bytes )
@@ -269,21 +272,14 @@ def build(executor, options)
269272 end
270273 build . crossruby . clean ( executor ) if options [ :clean ]
271274
272- do_build =
273- proc do
274- build . crossruby . build (
275- executor ,
276- remake : options [ :remake ] ,
277- reconfigure : options [ :reconfigure ]
278- )
279- end
275+ self . with_unbundled_env do
276+ build . crossruby . build (
277+ executor ,
278+ remake : options [ :remake ] ,
279+ reconfigure : options [ :reconfigure ]
280+ )
281+ end
280282
281- __skip__ =
282- if defined? ( Bundler )
283- Bundler . with_unbundled_env ( &do_build )
284- else
285- do_build . call
286- end
287283 build . crossruby . artifact
288284 end
289285
0 commit comments