Skip to content

Commit 31bcf3f

Browse files
committed
Build spawn-helper in its own project
* So it can be added to TRUFFLERUBY_BOOTSTRAP_HOME. * It is notably used for `system`/`spawn`/etc with `chdir:`, which is used e.g. in src/main/c/psych/extconf.rb.
1 parent 04794cd commit 31bcf3f

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

mx.truffleruby/suite.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,13 @@
238238
},
239239
},
240240

241+
"org.truffleruby.spawnhelper": {
242+
"dir": "src/main/c/spawn-helper",
243+
"native": "executable",
244+
"deliverable": "spawn-helper",
245+
"cflags": ["-g", "-O3", "-std=c99", "-Wall", "-Werror"],
246+
},
247+
241248
"org.prism.libprism": {
242249
"class": "YARPNativeProject",
243250
"dir": "src/main/c/yarp",
@@ -422,7 +429,6 @@
422429
},
423430
"output": ".",
424431
"results": [
425-
"src/main/c/spawn-helper/spawn-helper",
426432
"src/main/c/cext/<lib:truffleruby>",
427433
"src/main/c/cext-trampoline/<lib:trufflerubytrampoline>",
428434
"src/main/c/bigdecimal/<extsuffix:bigdecimal>",
@@ -773,6 +779,9 @@
773779
"lib/cext/include/": [
774780
"file:lib/cext/include/*",
775781
],
782+
"lib/truffle/": [
783+
"dependency:org.truffleruby.spawnhelper",
784+
],
776785
},
777786
"maven": False,
778787
},
@@ -855,7 +864,7 @@
855864
"dependency:org.truffleruby.cext/src/main/c/rbconfig-sizeof/<extsuffix:sizeof>",
856865
],
857866
"lib/truffle/": [
858-
"dependency:org.truffleruby.cext/src/main/c/spawn-helper/spawn-helper",
867+
"dependency:org.truffleruby.spawnhelper",
859868
],
860869
},
861870
"license": [

src/main/c/Makefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@ endif
1717
ROOT := $(realpath ../../..)
1818
RUBY := $(TRUFFLERUBY_BOOTSTRAP_LAUNCHER)
1919

20-
SPAWN_HELPER := spawn-helper/spawn-helper
2120
TRAMPOLINE := cext-trampoline/libtrufflerubytrampoline.$(SOEXT)
2221

2322
RUBY_HEADERS := $(shell find $(ROOT)/lib/cext/include -name '*.h')
2423
CEXT_C_FILES := $(shell find cext -name '*.c')
2524
RBCONFIG := $(ROOT)/lib/truffle/rbconfig.rb
2625
MKMF := $(ROOT)/lib/mri/mkmf.rb
2726
LIBTRUFFLERUBY = cext/libtruffleruby.$(SOEXT)
28-
BASIC_DEPS := Makefile $(SPAWN_HELPER) $(RUBY_HEADERS)
27+
BASIC_DEPS := Makefile $(RUBY_HEADERS)
2928
BASIC_EXTCONF_DEPS := $(BASIC_DEPS) $(RBCONFIG) $(MKMF)
3029
# C extensions link against libtruffleruby (and might do have_func() checks against it), so it needs to be there before.
3130
# However, if libtruffleruby is recompiled, there is no need to rebuild C extensions, so it's a order-only-prerequisite.
@@ -62,10 +61,6 @@ clean_cexts:
6261
$(Q) rm -f debug/Makefile debug/*.o debug/debug.$(DLEXT)
6362
$(Q) rm -f rbs/Makefile rbs/*.o rbs/rbs_extension.$(DLEXT)
6463

65-
# spawn-helper
66-
$(SPAWN_HELPER): spawn-helper/Makefile spawn-helper/spawn-helper.c
67-
$(Q) cd spawn-helper && $(MAKE)
68-
6964
# cext-trampoline
7065
cext-trampoline/trampoline.c: $(CEXT_C_FILES) $(BASIC_DEPS) $(ROOT)/tool/generate-cext-trampoline.rb
7166
$(Q) cd $(ROOT) && $(RUBY) tool/generate-cext-trampoline.rb

src/main/c/spawn-helper/Makefile

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)