anchor.diff:  find_and_remove(ExcludeName, [H | Rest]) ->
       [H | find_and_remove(ExcludeName, Rest)].
   
  -find_app(Name, _Vsn, []) ->
  -    error(?RLX_ERROR({app_not_found, Name}));
  +find_app(Name, Vsn, []) ->
  +    case code:lib_dir(Name) of
  +        {error, bad_name} ->
  +            erlang:error(?RLX_ERROR({app_not_found, Name}));
  +        Dir ->
  +            to_app(Name, Vsn, Dir)
  +    end;
   find_app(Name, Vsn, [App | Rest]) ->
       case check_app(Name, Vsn, App) of
           true ->
  
positive.code:     rlx_app_info:name(App) =:= Name
          andalso rlx_app_info:vsn(App) =:= Vsn.
  
  
  %% TODO: Support overriding the dirs to search
  %% precedence: apps > deps > erl_libs > system
  
negative.code:     io_lib:format("No applications configured to be included in release ~s-~s", [RelName, RelVsn]);
  format_error({release_erts_error, Dir}) ->
      io_lib:format("Unable to find erts in ~s", [Dir]);
  format_error({app_not_found, AppName, AppVsn}) ->
      io_lib:format("Application needed for release not found: ~p-~s", [AppName, AppVsn]);
  format_error({app_not_found, AppName}) ->
      io_lib:format("Application needed for release not found: ~p", [AppName]).
  
  solve_release(Release, State0) ->
      RelName = rlx_release:name(Release),
      RelVsn = rlx_release:vsn(Release),
      ?log_debug("Solving Release ~p-~s", [RelName, RelVsn]),
      AllApps = rlx_state:available_apps(State0),
  
      %% get per release config values and override the State with them
      Config = rlx_release:config(Release),
      {ok, State1} = lists:foldl(fun rlx_config:load/2, {ok, State0}, Config),
      case rlx_release:goals(Release) of
          Goals when map_size(Goals) =:= 0 ->
              erlang:error(?RLX_ERROR({no_goals_specified, {RelName, RelVsn}}));
          Goals ->
              Pkgs = subset(maps:to_list(Goals), AllApps),
              Pkgs1 = remove_exclude_apps(Pkgs, State1),
              set_resolved(Release, Pkgs1, State1)
      end.
  
  %% find the app_info records for each application and its deps needed for the release
  