From 73500d2a456023ca36172f5af896d0b1f10853b7 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Tue, 26 Sep 2017 13:25:50 +0200 Subject: Do not load .erlang from current dir It may be confusing that "hidden" .erlang is loaded from the current working directory. Use c:erlangrc([Dir1,..]) to search and load .erlang from other places than "$HOME/.erlang". Implies that c:erlangrc() needs to be documented. --- erts/doc/src/erl.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'erts') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 71fe08d4e6..ae52d92a89 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -1633,8 +1633,7 @@ The .erlang startup file

When Erlang/OTP is started, the system searches for a file named - .erlang in the directory where Erlang/OTP is started. If not - found, the user's home directory is searched for an .erlang + .erlang in the user's home directory is searched for an .erlang file.

If an .erlang file is found, it is assumed to contain valid Erlang expressions. These expressions are evaluated as if they were -- cgit v1.2.3 From ee0da31d00a7bd3375b66cf905cb2811d868f21b Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Tue, 26 Sep 2017 15:32:56 +0200 Subject: Enable usage of no_dot_erlang in bootstrap --- erts/start_scripts/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'erts') diff --git a/erts/start_scripts/Makefile b/erts/start_scripts/Makefile index 20fea99016..e730422ed8 100644 --- a/erts/start_scripts/Makefile +++ b/erts/start_scripts/Makefile @@ -171,7 +171,6 @@ $(ERL_TOP)/bin/no_dot_erlang.script: $(ERLC) $(SCRIPT_PATH) +no_warn_sasl +otp_build +no_dot_erlang -o $@ $(SS_ROOT)/no_dot_erlang.rel ) ## Special target used from system/build/Makefile for source code release bootstrap. -## Add no_dot_erlang after next release bootstrap_scripts: $(SS_ROOT)/start_clean.rel $(V_at)$(INSTALL_DIR) $(TESTROOT)/bin $(V_at)$(INSTALL_DIR) $(SS_TMP) @@ -181,6 +180,10 @@ bootstrap_scripts: $(SS_ROOT)/start_clean.rel $(V_at)( cd $(SS_TMP) && \ $(ERLC) $(BOOTSTRAP_SCRIPT_PATH) +otp_build +no_module_tests \ -o $(TESTROOT)/bin/start_clean.script $(SS_ROOT)/start_clean.rel ) + $(V_at)( cd $(SS_TMP) && \ + $(ERLC) $(BOOTSTRAP_SCRIPT_PATH) +otp_build +no_module_tests \ + -o $(TESTROOT)/bin/no_dot_erlang.script $(SS_ROOT)/no_dot_erlang.rel ) + clean: $(V_at)$(RM) $(REL_SCRIPTS) $(INSTALL_SCRIPTS) -- cgit v1.2.3 From c4015fbe39a2b76f9746f91eb705a59ac59b06f4 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Tue, 26 Sep 2017 14:05:12 +0200 Subject: dialyzer: Do not load .erlang Use 'no_dot_erlang' start script for tools. Options and paths should be stated on the command line. --- erts/etc/common/dialyzer.c | 2 +- erts/etc/common/typer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'erts') diff --git a/erts/etc/common/dialyzer.c b/erts/etc/common/dialyzer.c index 0e74eb065b..b45d5c7ca7 100644 --- a/erts/etc/common/dialyzer.c +++ b/erts/etc/common/dialyzer.c @@ -255,7 +255,7 @@ int main(int argc, char** argv) } PUSH("+B"); - PUSH2("-boot", "start_clean"); + PUSH2("-boot", "no_dot_erlang"); PUSH3("-run", "dialyzer", "plain_cl"); PUSH("-extra"); diff --git a/erts/etc/common/typer.c b/erts/etc/common/typer.c index b64cbb4a92..f13135d883 100644 --- a/erts/etc/common/typer.c +++ b/erts/etc/common/typer.c @@ -177,7 +177,7 @@ main(int argc, char** argv) } PUSH("+B"); - PUSH2("-boot", "start_clean"); + PUSH2("-boot", "no_dot_erlang"); PUSH3("-run", "typer", "start"); PUSH("-extra"); -- cgit v1.2.3 From 20824528602d921716ed373ee266175e62c09421 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Tue, 26 Sep 2017 13:55:57 +0200 Subject: escript: Do not load .erlang Previously you could not opt out on loading .erlang, change the default to not load the resource file. The escript author can invoke c:erlangrc(PathList) to find and load .erlang if needed. --- erts/etc/common/escript.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts') diff --git a/erts/etc/common/escript.c b/erts/etc/common/escript.c index 8241675200..d739d21f12 100644 --- a/erts/etc/common/escript.c +++ b/erts/etc/common/escript.c @@ -521,7 +521,7 @@ main(int argc, char** argv) free_env_val(env); PUSH("+B"); - PUSH2("-boot", "start_clean"); + PUSH2("-boot", "no_dot_erlang"); PUSH("-noshell"); /* -- cgit v1.2.3 From b93f1cd08c540c27ac49b8078fbb3102029979f8 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Tue, 26 Sep 2017 14:09:05 +0200 Subject: erlc: Do not load .erlang Use 'no_dot_erlang' start script for tools. Options and paths should be stated on the command line, via a Makefile, rebar.config etc. --- erts/etc/common/erlc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts') diff --git a/erts/etc/common/erlc.c b/erts/etc/common/erlc.c index 8cfd98bcc4..aa99c69100 100644 --- a/erts/etc/common/erlc.c +++ b/erts/etc/common/erlc.c @@ -234,7 +234,7 @@ int main(int argc, char** argv) PUSH("+A0"); PUSH("-noinput"); PUSH2("-mode", "minimal"); - PUSH2("-boot", "start_clean"); + PUSH2("-boot", "no_dot_erlang"); PUSH3("-s", "erl_compile", "compile_cmdline"); PUSH("-extra"); -- cgit v1.2.3 From baf53defc90c4aa8a4caa6b2c6ead6a1b58df199 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Mon, 2 Oct 2017 19:16:19 +0200 Subject: fixup! Do not load .erlang from current dir --- erts/doc/src/erl.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'erts') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index ae52d92a89..823ca9544f 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -1633,8 +1633,7 @@ The .erlang startup file

When Erlang/OTP is started, the system searches for a file named - .erlang in the user's home directory is searched for an .erlang - file.

+ .erlang in the user's home directory.

If an .erlang file is found, it is assumed to contain valid Erlang expressions. These expressions are evaluated as if they were input to the shell.

-- cgit v1.2.3