diff options
author | Rickard Green <[email protected]> | 2018-08-09 17:13:30 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2018-08-09 17:13:30 +0200 |
commit | f2c683c321baccc53b68fd4114b49ad4c72c90aa (patch) | |
tree | 960fce5723f0179c890a9fd3418bb5948755e99b /lib/compiler/src/compile.erl | |
parent | 74d0077a820ee09d41dd96e7f2a95e9906be448d (diff) | |
parent | a81f89796e439f672681ea21baaf9e87e0f1936b (diff) | |
download | otp-f2c683c321baccc53b68fd4114b49ad4c72c90aa.tar.gz otp-f2c683c321baccc53b68fd4114b49ad4c72c90aa.tar.bz2 otp-f2c683c321baccc53b68fd4114b49ad4c72c90aa.zip |
Merge branch 'maint'
* maint:
Omit include path debug info for +deterministic builds
Diffstat (limited to 'lib/compiler/src/compile.erl')
-rw-r--r-- | lib/compiler/src/compile.erl | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl index 5ef9611504..e1c1f7338e 100644 --- a/lib/compiler/src/compile.erl +++ b/lib/compiler/src/compile.erl @@ -1432,16 +1432,30 @@ encrypt_debug_info(DebugInfo, Key, Opts) -> end. cleanup_compile_options(Opts) -> - lists:filter(fun keep_compile_option/1, Opts). - + IsDeterministic = lists:member(deterministic, Opts), + lists:filter(fun(Opt) -> + keep_compile_option(Opt, IsDeterministic) + end, Opts). + +%% Include paths and current directory don't affect compilation, but they might +%% be helpful so we include them unless we're doing a deterministic build. +keep_compile_option({i, _}, Deterministic) -> + not Deterministic; +keep_compile_option({cwd, _}, Deterministic) -> + not Deterministic; %% We are storing abstract, not asm or core. -keep_compile_option(from_asm) -> false; -keep_compile_option(from_core) -> false; +keep_compile_option(from_asm, _Deterministic) -> + false; +keep_compile_option(from_core, _Deterministic) -> + false; %% Parse transform and macros have already been applied. -keep_compile_option({parse_transform, _}) -> false; -keep_compile_option({d, _, _}) -> false; +keep_compile_option({parse_transform, _}, _Deterministic) -> + false; +keep_compile_option({d, _, _}, _Deterministic) -> + false; %% Do not affect compilation result on future calls. -keep_compile_option(Option) -> effects_code_generation(Option). +keep_compile_option(Option, _Deterministic) -> + effects_code_generation(Option). start_crypto() -> try crypto:start() of @@ -1589,6 +1603,7 @@ effects_code_generation(Option) -> binary -> false; verbose -> false; {cwd,_} -> false; + {i,_} -> false; {outdir, _} -> false; _ -> true end. |