Skip to content
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

Fix compilation for custom resources dynamic vsn #1668

Merged
merged 1 commit into from
Nov 22, 2017

Commits on Nov 22, 2017

  1. 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 erlang#1657
    ferd committed Nov 22, 2017
    Configuration menu
    Copy the full SHA
    c550cf0 View commit details
    Browse the repository at this point in the history