Skip to content

Commit d003544

Browse files
committed
erts: escript and tools should not read boot file from CWD
1 parent 868d75c commit d003544

File tree

6 files changed

+8
-5
lines changed

6 files changed

+8
-5
lines changed

erts/etc/common/dialyzer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ int main(int argc, char** argv)
252252
}
253253

254254
PUSH("+B");
255-
PUSH2("-boot", "no_dot_erlang");
255+
PUSH2("-boot", "$ROOT/no_dot_erlang");
256256
PUSH3("-run", "dialyzer", "plain_cl");
257257
PUSH("-extra");
258258

erts/etc/common/erlc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ start_compile_server(char* node_name, char** argv)
962962
while (strcmp(argv[0], "-mode") != 0) {
963963
eargv[eargc++] = *argv++;
964964
}
965-
PUSH2("-boot", "no_dot_erlang");
965+
PUSH2("-boot", "$ROOT/no_dot_erlang");
966966
PUSH2("-sname", node_name);
967967
PUSH2("-setcookie", "erlc_compile_server_cookie");
968968
PUSH("-hidden");

erts/etc/common/escript.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ main(int argc, char** argv)
513513

514514
PUSH("+B");
515515
PUSH("-noshell");
516-
PUSH2("-boot", "no_dot_erlang");
516+
PUSH2("-boot", "$ROOT/no_dot_erlang");
517517

518518
/*
519519
* Read options from the %%! row in the script and add them as args

erts/etc/common/typer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ main(int argc, char** argv)
179179
}
180180

181181
PUSH("+B");
182-
PUSH2("-boot", "no_dot_erlang");
182+
PUSH2("-boot", "$ROOT/no_dot_erlang");
183183
PUSH3("-run", "typer", "start");
184184
PUSH("-extra");
185185

erts/preloaded/ebin/init.beam

140 Bytes
Binary file not shown.

erts/preloaded/src/init.erl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,10 @@ path_flags(Flags) ->
12591259
{bs2ss(Pa),bs2ss(Pz)}.
12601260

12611261
get_boot(BootFile0,Root) ->
1262-
BootFile = BootFile0 ++ ".boot",
1262+
BootFile = case BootFile0 of
1263+
"$ROOT/" ++ BootFile1 -> Root ++ "/bin/" ++ BootFile1 ++ ".boot";
1264+
_ -> BootFile0 ++ ".boot"
1265+
end,
12631266

12641267
case get_boot(BootFile) of
12651268
{ok, CmdList} ->

0 commit comments

Comments
 (0)