Skip to content

Commit 9687d44

Browse files
committed
Use YRL_ERLC_OPTS instead of ERL_COMPILER_OPTIONS
This is a follow-up to commit 93db480 `erlang.mk` supports the `YRL_ERLC_OPTS` variable to set `erlc`-specific compiler options when processing `.yrl` and `.xrl` files. By using this variable, it allows `make RMQ_ERLC_OPTS=` to disable the `+deterministic` option. This allows using `c()` in the erl shell to recompile modules on the fly when a cluster is running. You can see that, when `make RMQ_ERLC_OPTS=` is run, these generated files were produced with the `+deterministic` option, because their `-file` directives use only basenames. * `deps/rabbit/src/rabbit_amqp_sql_lexer.erl' * `deps/rabbit/src/rabbit_amqp_sql_parser.erl' ``` -file("rabbit_amqp_sql_parser.yrl", 0). -module(rabbit_amqp_sql_parser). -file("rabbit_amqp_sql_parser.erl", 3). -export([parse/1, parse_and_scan/1, format_error/1]). -file("rabbit_amqp_sql_parser.yrl", 122). ``` This commit also ignores those two files, as they will always be auto-generated.
1 parent c34c803 commit 9687d44

File tree

4 files changed

+4
-3523
lines changed

4 files changed

+4
-3523
lines changed

deps/rabbit/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44

55
[Bb]in/
66
[Oo]bj/
7+
8+
src/rabbit_amqp_sql_lexer.erl
9+
src/rabbit_amqp_sql_parser.erl

deps/rabbit/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ RMQ_ERLC_OPTS += -DTRACE_SUPERVISOR2=true
363363
endif
364364

365365
# https://www.erlang.org/doc/apps/parsetools/leex.html#file/2
366-
export ERL_COMPILER_OPTIONS := deterministic
366+
YRL_ERLC_OPTS ?= +deterministic
367367

368368
# --------------------------------------------------------------------
369369
# Documentation.

0 commit comments

Comments
 (0)