Skip to content

Commit b408eb2

Browse files
committed
Merge branch 'frazze/erts/remove_cwd_reads/OTP-19819' into maint
* frazze/erts/remove_cwd_reads/OTP-19819: erts: escript and tools should not read boot files in CWD Update preloaded modules erts: Erlang/OTP tools should look for boot scripts in the ROOT dir kernel: don't look for a '..ez' archive
2 parents 248ef0a + 77f5635 commit b408eb2

File tree

9 files changed

+11
-5
lines changed

9 files changed

+11
-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
@@ -974,7 +974,7 @@ start_compile_server(char* node_name, char** argv)
974974
eargv[eargc++] = *argv++;
975975
}
976976
}
977-
PUSH2("-boot", "no_dot_erlang");
977+
PUSH2("-boot", "$ROOT/no_dot_erlang");
978978
PUSH2("-sname", node_name);
979979
PUSH2("-setcookie", "erlc_compile_server_cookie");
980980
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.
12 Bytes
Binary file not shown.

erts/preloaded/ebin/prim_zip.beam

24 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} ->

lib/kernel/src/code_server.erl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,9 @@ insert_name(Name, Dir, Db) ->
843843
AppDir = del_ebin(Dir),
844844
do_insert_name(Name, AppDir, Db).
845845

846+
do_insert_name(".", _, _) ->
847+
%% "." is most likely not an archive, avoid looking for subdirs
848+
true;
846849
do_insert_name(Name, AppDir, Db) ->
847850
{Base, SubDirs} = archive_subdirs(AppDir),
848851
ets:insert(Db, {Name, AppDir, Base, SubDirs}),

0 commit comments

Comments
 (0)