-
Notifications
You must be signed in to change notification settings - Fork 231
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
keep attributes when stripping beams #906
Conversation
release_handler:install_release/1 depends on the 'vsn' attribute in the beam files of the to-be-installed release. Without this, a release created with {debug_info, strip} (which is the default in rebar3 'prod' and 'minimal' modes) cannot be installed by the release_handler.
unfortunately i forgot to check for the presence of beam_lib:strip_release/2 in older OTP releases. i think the 'debug_info' 'strip' | 'keep' option is dangerously named (it does strip debug_info but also everything else). and i also think the fact that {debug_info, strip} makes the created release uninstallable by release_handler should be documented somewhere. |
Definitely should be documented, but we should only be supporting 22+ anyway, so you should reopen this PR and can remove anything older than 22 from CI. |
the inclusion of this change in a new rebar3 release would fix erlang/rebar3#2558 |
@tsloughter : is there anything i can do to bring this and #907 forward? |
Just poking me :). Sorry about that. I think it makes sense to merge this as is but I'm curious about why Also probably worth making it configurable so a user can configure a list of what to keep. But that can be a separate PR. |
there is a related work happening in reltool: erlang/otp#5936 (but otoh reltool does the debug_strip on file by file basis) |
Oh, thanks, I've also commented there about this now. |
- [Use `erlexec` directly in relx helper functions](erlware/relx#902) - [Make rlx_util:parse_vsn parse integer versions](erlware/relx#913) - [fix awk script check_name() in extended_bin](erlware/relx#915) - [avoid crash when overlay is malformed](erlware/relx#916) - [keep attributes when stripping beams](erlware/relx#906) - [Fix {include_erts,true} in Windows releases](erlware/relx#914) - [ensure the erl file is writable before copying dyn_erl to it](erlware/relx#903) - Various tests added
New features: - [Add --offline option and REBAR_OFFLINE environment variable](#2643) - [Add support for project-local plugins](#2697) - [Add eunit --test flag](#2684) Experimental features for which we promise no backwards compatibility in the near future: - [Experimental vendoring provider](#2689) - [Support plugins in experimental vendor provider](#2702) Other changes: - [Support OTP 23..25 inclusively](#2706) - [Bump Relx to 4.7.0](#2718) - [Use `erlexec` directly in relx helper functions](erlware/relx#902) - [Make rlx_util:parse_vsn parse integer versions](erlware/relx#913) - [fix awk script check_name() in extended_bin](erlware/relx#915) - [avoid crash when overlay is malformed](erlware/relx#916) - [keep attributes when stripping beams](erlware/relx#906) - [Fix {include_erts,true} in Windows releases](erlware/relx#914) - [ensure the erl file is writable before copying dyn_erl to it](erlware/relx#903) - Various tests added - [Properly carry overlay_vars settings for files in relx](#2711) - [Track mib compilation artifacts](#2709) - [Attempt to find apps in git subdirs (sparse checkouts)](#2687) - [Do not discard parameters --system_libs and --include-erts when duplicate values exist](#2695) - [Use default `depth` parameter for SSL](#2690) - [Fix global cache config overriding](#2683) - [Error out on unknown templates in 'new' command](#2676) - [Fix a typo](#2674) - [Bump certifi to 2.9.0](#2673) - [add a debug message in internal dependency fetching code](#2672) - [Use SPDX id for license in template and test](#2668) - [Use default branch for git and git_subdir resources with no revision](#2663) Signed-off-by: Fred Hebert <[email protected]>
Remove the 'stripped' profile from the Rebar3 configuration to avoid duplication and confusion. Just use the 'prod' profile for building release binaries instead. Compared to 'stripped', this adds the SASL application (400 KiB) to support hot release upgrades and the Recon application (120 KiB) for debugging purposes. Note that hot release upgrades no longer depend on keeping debug info, see: erlware/relx#906 Also not that the 'runtime_tools' application is now removed from all profiles, as it's probably overkill to include it in addition to Recon and the 'p1_prof' tools. For those who'd still like to build using the old 'stripped' configuration, the rebar.config.script file now auto-generates a 'prod_minimal' profile, which omits the SASL and Recon applications. However, we won't use nor document that profile.
Remove the 'stripped' profile from the Rebar3 configuration to avoid duplication and confusion. Just use the 'prod' profile for building release binaries instead. Compared to 'stripped', this adds the SASL application (150 KiB) to support hot release upgrades and the Recon application (50 KiB) for debugging purposes. Note that hot release upgrades no longer depend on keeping debug info, see: erlware/relx#906 Also not that the 'runtime_tools' application is now removed from all profiles, as it's probably overkill to include it in addition to Recon and the 'p1_prof' tools. For those who'd still like to build using the old 'stripped' configuration, the rebar.config.script file now auto-generates a 'prod_minimal' profile, which omits the SASL and Recon applications. However, we won't use nor document that profile.
Hot code upgrades no longer depend on keeping debug info, see: erlware/relx#906
release_handler:install_release/1 depends on the 'vsn' attribute in the beam
files of the to-be-installed release.
Without this, a release created with {debug_info, strip} (which is the default in
rebar3 'prod' and 'minimal' modes) cannot be installed by the release_handler.