Skip to content

Commit 705952b

Browse files
josevalimJosé Valim
authored andcommitted
Ensure elixir_erl:debug_info/4 does not require elixir running (#6401)
1 parent 43b54f9 commit 705952b

11 files changed

+30
-15
lines changed

.travis.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@ matrix:
2323
- os: linux
2424
otp_release: 20.0
2525

26-
script: "make compile && rm -rf .git && make test"
26+
env:
27+
- ELIXIR_ASSERT_TIMEOUT=2000
28+
29+
script:
30+
- make compile
31+
- rm -rf .git
32+
- make test
33+
- dialyzer -pa lib/elixir/ebin --build_plt --output_plt elixir.plt --apps lib/elixir/ebin/elixir.beam lib/elixir/ebin/Elixir.Kernel.beam
2734

2835
notifications:
2936
recipients:

lib/elixir/lib/module.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ defmodule Module do
898898
"cannot make function #{function_name}/#{arity} overridable because it was not defined"
899899
clause ->
900900
neighbours =
901-
if :elixir_compiler.get_opt(:internal) do
901+
if :elixir_config.get(:bootstrap) do
902902
[]
903903
else
904904
Module.LocalsTracker.yank(module, tuple)

lib/elixir/src/elixir.erl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,10 @@ start(_Type, _Args) ->
102102
relative_paths => true},
103103
{ok, [[Home] | _]} = init:get_argument(home),
104104
Config = [{at_exit, []},
105-
{home, unicode:characters_to_binary(Home, Encoding, Encoding)},
105+
{argv, []},
106+
{bootstrap, false},
106107
{compiler_options, CompilerOpts},
108+
{home, unicode:characters_to_binary(Home, Encoding, Encoding)},
107109
{identifier_tokenizer, Tokenizer}
108110
| URIConfig],
109111
Tab = elixir_config:new(Config),

lib/elixir/src/elixir_aliases.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-include("elixir.hrl").
55

66
inspect(Atom) when is_atom(Atom) ->
7-
case elixir_compiler:get_opt(internal) of
7+
case elixir_config:get(bootstrap) of
88
true -> atom_to_binary(Atom, utf8);
99
false -> 'Elixir.Inspect.Atom':inspect(Atom)
1010
end.

lib/elixir/src/elixir_compiler.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ allows_fast_compilation(_) -> false.
125125

126126
bootstrap() ->
127127
{ok, _} = application:ensure_all_started(elixir),
128-
Update = fun(Old) -> maps:merge(Old, #{docs => false, internal => true,
129-
relative_paths => false}) end,
128+
Update = fun(Old) -> maps:merge(Old, #{docs => false, relative_paths => false}) end,
130129
_ = elixir_config:update(compiler_options, Update),
130+
_ = elixir_config:put(bootstrap, true),
131131
[bootstrap_file(File) || File <- bootstrap_main()].
132132

133133
bootstrap_file(File) ->

lib/elixir/src/elixir_erl.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ compile(#{module := Module} = Map) ->
153153
Data = elixir_module:data_table(Module),
154154
{Prefix, Forms, Defmacro, Unreachable} = dynamic_form(Map),
155155
Specs =
156-
case elixir_compiler:get_opt(internal) of
156+
case elixir_config:get(bootstrap) of
157157
true -> [];
158158
false -> specs_form(Data, Defmacro, Unreachable, types_form(Data, []))
159159
end,

lib/elixir/src/elixir_erl_compiler.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ handle_file_warning(_, _File, {_Line, erl_lint, {shadowed_var, _Var, _Where}}) -
5858
handle_file_warning(_, _File, {_Line, erl_lint, {exported_var, _Var, _Where}}) -> ok;
5959

6060
handle_file_warning(_, File, {Line, erl_lint, {undefined_behaviour, Module}}) ->
61-
case elixir_compiler:get_opt(internal) of
61+
case elixir_config:get(bootstrap) of
6262
true ->
6363
ok;
6464
false ->

lib/elixir/src/elixir_lexical.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
-define(tracker, 'Elixir.Kernel.LexicalTracker').
1212

1313
run(File, Dest, Callback) ->
14-
case elixir_compiler:get_opt(internal) of
14+
case elixir_config:get(bootstrap) of
1515
false ->
1616
{ok, Pid} = ?tracker:start_link(Dest),
1717
try Callback(Pid) of

lib/elixir/src/elixir_locals.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
-define(tracker, 'Elixir.Module.LocalsTracker').
1414

1515
setup(Module) ->
16-
case elixir_compiler:get_opt(internal) of
16+
case elixir_config:get(bootstrap) of
1717
false ->
1818
{ok, Pid} = ?tracker:start_link(),
1919
ets:insert(elixir_module:data_table(Module), {?attr, Pid}),

lib/elixir/src/elixir_module.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ compile(Line, Module, Block, Vars, E) ->
8686

8787
{AllDefinitions, Unreachable} = elixir_def:fetch_definitions(File, Module),
8888

89-
(not elixir_compiler:get_opt(internal)) andalso
89+
(not elixir_config:get(bootstrap)) andalso
9090
'Elixir.Module':check_behaviours_and_impls(E, Data, AllDefinitions, OverridablePairs),
9191

9292
CompileOpts = lists:flatten(ets:lookup_element(Data, compile, 2)),
@@ -186,7 +186,7 @@ build(Line, File, Module, Lexical) ->
186186
end,
187187

188188
ImplOnDefinition =
189-
case elixir_compiler:get_opt(internal) of
189+
case elixir_config:get(bootstrap) of
190190
true -> [{elixir_module, delete_impl}];
191191
_ -> [{'Elixir.Module', compile_impl}]
192192
end,

0 commit comments

Comments
 (0)