-
Notifications
You must be signed in to change notification settings - Fork 4k
Use YRL_ERLC_OPTS
instead of ERL_COMPILER_OPTIONS
#14326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use YRL_ERLC_OPTS
instead of ERL_COMPILER_OPTIONS
#14326
Conversation
Should we tweak |
|
1f0a1e6
to
8917544
Compare
YRL_ERLC_OPTS
instead of ERL_COMPILER_OPTIONS
8917544
to
9687d44
Compare
9687d44
to
2f03d11
Compare
I am not fully certain I understand the potential downsides of ignoring the generated SQL lexer/parser modules but an idea of doing the same thing (gitignoring them in the repository, since they are re-generated) did cross my mind. |
I think we just need to ensure that anytime a release is built, it re-generates these files, then compiles them. I don't see any reason why that wouldn't happen... |
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.
2f03d11
to
a87445c
Compare
Thank you @lukebakken. This is a great change!
@michaelklishin This approach is fine. In fact, this is what is done in by the Elixir parser. |
This is a follow-up to commit 93db480
erlang.mk
supports theYRL_ERLC_OPTS
variable to seterlc
-specific compiler options when processing.yrl
and.xrl
files. By using this variable, it allowsmake RMQ_ERLC_OPTS=
to disable the+deterministic
option. This allows usingc()
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
This commit also ignores those two files, as they will always be auto-generated.