Skip to content

Commit ad52387

Browse files
committed
Fix race condition in quickjs build config (#251)
qjsc.com now has a -n do nothing flag so the makefile can create a localized binary. See also #267 where we have an exciting new change aiming to address this particular APE gotcha.
1 parent 6ad0602 commit ad52387

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

third_party/quickjs/qjsc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ int main(int argc, char **argv)
488488
BOOL bignum_ext = FALSE;
489489
#endif
490490
namelist_t dynamic_module_list;
491+
if (argc == 2 && !strcmp(argv[1], "-n")) return 0;
491492
out_filename = NULL;
492493
output_type = OUTPUT_EXECUTABLE;
493494
cname = NULL;

third_party/quickjs/quickjs.mk

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,23 @@ THIRD_PARTY_QUICKJS_CHECKS = \
127127
$(THIRD_PARTY_QUICKJS_A).pkg \
128128
$(THIRD_PARTY_QUICKJS_A_HDRS:%=o/$(MODE)/%.ok)
129129

130+
o/$(MODE)/third_party/quickjs/qjsc: \
131+
o/$(MODE)/third_party/quickjs/qjsc.com
132+
@cp -f $< $@
133+
@$@ -n
134+
130135
o/$(MODE)/third_party/quickjs/qjscalc.c: \
131-
third_party/quickjs/qjscalc.js \
132-
o/$(MODE)/third_party/quickjs/qjsc.com
133-
o/$(MODE)/third_party/quickjs/qjsc.com -fbignum -o $@ -c $<
136+
third_party/quickjs/qjscalc.js \
137+
o/$(MODE)/third_party/quickjs/qjsc
138+
o/$(MODE)/third_party/quickjs/qjsc -fbignum -o $@ -c $<
139+
134140
o/$(MODE)/third_party/quickjs/repl.c: \
135-
third_party/quickjs/repl.js \
136-
o/$(MODE)/third_party/quickjs/qjsc.com
137-
o/$(MODE)/third_party/quickjs/qjsc.com -o $@ -m -c $<
141+
third_party/quickjs/repl.js \
142+
o/$(MODE)/third_party/quickjs/qjsc.com
143+
o/$(MODE)/third_party/quickjs/qjsc -o $@ -m -c $<
138144

139145
o/$(MODE)/third_party/quickjs/qjs.com.dbg: \
140-
$(THIRD_PARTY_QUICKJS_A_DEPS) \
141-
$(THIRD_PARTY_QUICKJS_A) \
142-
$(THIRD_PARTY_QUICKJS_A).pkg \
146+
$(THIRD_PARTY_QUICKJS) \
143147
o/$(MODE)/third_party/quickjs/qjs.o \
144148
o/$(MODE)/third_party/quickjs/repl.o \
145149
o/$(MODE)/third_party/quickjs/qjscalc.o \
@@ -148,9 +152,7 @@ o/$(MODE)/third_party/quickjs/qjs.com.dbg: \
148152
-@$(APELINK)
149153

150154
o/$(MODE)/third_party/quickjs/qjsc.com.dbg: \
151-
$(THIRD_PARTY_QUICKJS_A_DEPS) \
152-
$(THIRD_PARTY_QUICKJS_A) \
153-
$(THIRD_PARTY_QUICKJS_A).pkg \
155+
$(THIRD_PARTY_QUICKJS) \
154156
o/$(MODE)/third_party/quickjs/qjsc.o \
155157
$(CRT) \
156158
$(APE)

0 commit comments

Comments
 (0)