diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2017-11-22 09:35:17 -0500 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2017-11-22 09:41:36 -0500 |
commit | c550cf0c4c9df09ff1fe7eca0fbe8e26fa800502 (patch) | |
tree | a1cc32a9dff081a281b0e867c3fb7b3cf96fa07a /test/rebar_compile_SUITE.erl | |
parent | 07e19ba60dfd04b1d81e1d5764a814f06c9dbcb2 (diff) |
Fix compilation for custom resources dynamic vsn
The Erlang compiler runs based on a global state built from currently
loaded libraries and the configured code path that is available. For
this reason, the rebar3 compiler job unloads all plugin paths before
calling the Erlang compiler.
However, this causes a problem when an application uses a custom
resource handler with a dynamic version in their .app.src file since the
plugin that can be used to find the version has been unloaded.
Fortunately, the compile phase that runs the version handling is
distinct from the phase that uses the Erlang compiler. This patch fixes
the problem by re-loading the plugins' paths in memory before generating
the .app file, and before unloading them afterwards.
It appears that unloading them is unnecessary because the hooks after
that will re-load them, but it is likely better to play it safe with
that global state and clean up after ourselves. It offers better
protection for future changes.
Fixes #1657
Diffstat (limited to 'test/rebar_compile_SUITE.erl')
0 files changed, 0 insertions, 0 deletions