Skip to content

Remove ERL_OPTS#3880

Merged
nickva merged 1 commit intoapache:mainfrom
noahshaw11:remove-ERL_OPTS-main
Dec 17, 2021
Merged

Remove ERL_OPTS#3880
nickva merged 1 commit intoapache:mainfrom
noahshaw11:remove-ERL_OPTS-main

Conversation

@noahshaw11
Copy link
Copy Markdown
Contributor

@noahshaw11 noahshaw11 commented Dec 17, 2021

Overview

Since Erlang 19.0 there is an ERL_COMPILER_OPTIONS environment variable which the compiler will consult.

Testing recommendations

Run make clean && ERL_COMPILER_OPTIONS='[no_line_info,deterministic,no_debug_info]' make.
Capture module-info from some module (something like couch_db:module_info(compile). perhaps). Then, run make clean && make and see if the changes took effect. With no_debug_info there should be almost no extra info shown.

Related Issues or Pull Requests

Remove ERL_OPTS handling from rebar.config* scripts: #3841

Checklist

  • Code is written and works correctly
  • Changes are covered by tests
  • Any new configurable parameters are documented in rel/overlay/etc/default.ini
  • A PR for documentation changes has been made in https://github.com/apache/couchdb-documentation

@nickva
Copy link
Copy Markdown
Contributor

nickva commented Dec 17, 2021

To double-check if the compiler options work, try running

make clean && ERL_COMPILER_OPTIONS='[no_line_info,deterministic,no_debug_info]' make

Capture module info from some module (something like couch_db:module_info(compile). perhaps) then run make clean && make and see if the changes took effect. With no_debug_info there should be almost no extra info shown.

Also don't forget to update the Makefile{.win} files since reference ERL_OPTS there as well.

@noahshaw11 noahshaw11 force-pushed the remove-ERL_OPTS-main branch 2 times, most recently from 8bfb765 to 85a7ce9 Compare December 17, 2021 19:34
@noahshaw11
Copy link
Copy Markdown
Contributor Author

To double-check if the compiler options work, try running

make clean && ERL_COMPILER_OPTIONS='[no_line_info,deterministic,no_debug_info]' make

Capture module info from some module (something like couch_db:module_info(compile). perhaps) then run make clean && make and see if the changes took effect. With no_debug_info there should be almost no extra info shown.

Also don't forget to update the Makefile{.win} files since reference ERL_OPTS there as well.

The compiler options are taking effect.

With compiler options:

(node1@127.0.0.1)1> couch_db:module_info(compile).
[{version,"7.6.7"}]

Without compiler options:

(node1@127.0.0.1)1> couch_db:module_info(compile).
[{version,"7.6.7"},
 {options,[debug_info,
           {d,'COUCHDB_VERSION',"3.2.1-48bfdcf"},
           {d,'COUCHDB_GIT_SHA',"48bfdcf"},
           {d,'COUCHDB_SPIDERMONKEY_VERSION',"1.8.5"},
           {i,"../"},
           {d,'WITH_PROPER'},
           {i,"include"}]},
 {source,"/Users/ncshaw/src/couchdb/src/couch/src/couch_db.erl"}]

Copy link
Copy Markdown
Contributor

@nickva nickva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Works in main:

fabric2_db:module_info(compile).
[{version,"7.6.9.1"}]

@nickva nickva merged commit 7f63d93 into apache:main Dec 17, 2021
@noahshaw11 noahshaw11 deleted the remove-ERL_OPTS-main branch December 18, 2021 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants