<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="332123" data-post-id="332123">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="zachdaniel" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachdaniel/120/31980_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  zachdaniel
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Ash</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="mayel" data-post="11" data-topic="12114">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mayel/48/26431_2.png" class="avatar"> mayel:</div>
<blockquote>
<p><code>mix deps.clean --build dep1 dep2</code></p>
</blockquote>
</aside>
<p>It looks like it may not do anything because it doesn’t know about these deps yet?</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">warning: the dependency spark is not present in the build directory
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="332123" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/mix-task-run-deps-compile-dep-name-force-not-compiling/12114/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-332123" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="332123"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="332162" data-post-id="332162">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="shahryarjb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/shahryarjb/120/39485_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  shahryarjb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I have a question, why you do not compile the dependencies in another folder and move all <code>ebin</code> file to your project?</p>
<p>for example using: <code>Code.prepend_path()</code></p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def prepend_compiled_apps(files_list) do
    files_list
    |&gt; Enum.map(
      &amp;{String.to_atom(&amp;1),
       Path.join(get_build_path() &lt;&gt; "/" &lt;&gt; &amp;1, "ebin") |&gt; Code.prepend_path()}
    )
    |&gt; Enum.filter(fn {_app, status} -&gt; status == {:error, :bad_directory} end)
    |&gt; case do
      [] -&gt; {:ok, :prepend_compiled_apps}
      list -&gt; {:error, :prepend_compiled_apps, :bad_directory, list}
    end
  end

  defp application_ensure({:ok, :prepend_compiled_apps}, app, :add) do
    with {:load, :ok} &lt;- {:load, Application.load(app)},
         {:sure_all_started, {:ok, _apps}} &lt;-
           {:sure_all_started, Application.ensure_all_started(app)} do
      {:ok, :application_ensure}
    else
      {:load, {:error, term}} -&gt;
        {:error, :application_ensure, :load, term}

      {:sure_all_started, {:error, {app, term}}} -&gt;
        {:error, :application_ensure, :sure_all_started, {app, term}}
    end
  end
</code></pre>
<h3><a name="p-332162-for-updating-1" class="anchor" href="#p-332162-for-updating-1" aria-label="Heading link" rel="nofollow"></a>for updating</h3>
<pre data-code-wrap="elixir"><code class="lang-elixir">  defp application_ensure({:ok, :prepend_compiled_apps}, app, :force_update) do
    Application.stop(app)

    with {:unload, :ok} &lt;- {:unload, Application.unload(app)},
         {:load, :ok} &lt;- {:load, Application.load(app)},
         {:sure_all_started, {:ok, _apps}} &lt;-
           {:sure_all_started, Application.ensure_all_started(app)} do
      {:ok, :application_ensure}
    else
      {:unload, {:error, term}} -&gt;
        {:error, :application_ensure, :unload, term}

      {:load, {:error, term}} -&gt;
        {:error, :application_ensure, :load, term}

      {:sure_all_started, {:error, {app, term}}} -&gt;
        {:error, :application_ensure, :sure_all_started, {app, term}}
    end
  end
</code></pre>
<h3><a name="p-332162-for-scanning-project-version-2" class="anchor" href="#p-332162-for-scanning-project-version-2" aria-label="Heading link" rel="nofollow"></a>for scanning project version</h3>
<pre data-code-wrap="elixir"><code class="lang-elixir">with {:ok, tokens, _} &lt;- :erl_scan.string(String.to_charlist(bin)) do
      :erl_parse.parse_term(tokens)
    end
</code></pre>
<h3><a name="p-332162-for-phoenix-in-runtime-3" class="anchor" href="#p-332162-for-phoenix-in-runtime-3" aria-label="Heading link" rel="nofollow"></a>for phoenix in runtime</h3>
<blockquote>
<p>If you are using Phoenix as developer mode, please disable <code>live_reload</code> in <code>dev.exs</code> . Please add <code>reloadable_apps: [:mishka_installer]</code> to your endpoint config in <code>config.exs</code> file.</p>
</blockquote>
<p><a href="https://github.com/mishka-group/mishka_installer/blob/2813e7593ed10bbe7a437045705f44e30461caa7/lib/installer/run_time_sourcing.ex" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/mishka-group/mishka_installer/blob/2813e7593ed10bbe7a437045705f44e30461caa7/lib/installer/run_time_sourcing.ex</a></p>
<p>And with Port you can monitor the command line real time! I think it can fix your problem? Am I wrong?</p>
<h3><a name="p-332162-update-4" class="anchor" href="#p-332162-update-4" aria-label="Heading link" rel="nofollow"></a>Update</h3>
<p>I just do not know, this commit effects on my way or not<br>
<a href="https://github.com/elixir-lang/elixir/commit/7890e56c3ca006b4d96fb40f2a00d69c895f99ba" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/elixir-lang/elixir/commit/7890e56c3ca006b4d96fb40f2a00d69c895f99ba</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="332162" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/mix-task-run-deps-compile-dep-name-force-not-compiling/12114/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-332162" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="332162"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="332180" data-post-id="332180">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="zachdaniel" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachdaniel/120/31980_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  zachdaniel
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Ash</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Was just about to post back here with my current solution which is probably a very very ugly hack, but it does work:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">      case Mix.shell().cmd("mix deps.get") do
        0 -&gt;
          Mix.Task.reenable("compile")
          Mix.Task.run("compile")

          Mix.Project.clear_deps_cache()
          Mix.Project.pop()

          "mix.exs"
          |&gt; File.read!()
          |&gt; Code.eval_string([], file: Path.expand("mix.exs"))

          Mix.Task.run("deps.compile", Enum.map(install_list, &amp;to_string/1))

          Mix.Task.reenable("compile")
          Mix.Task.run("compile")

        exit_code -&gt;
          Mix.shell().info("""
          mix deps.get returned exited with code: `#{exit_code}`
          """)
      end
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="332180" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/mix-task-run-deps-compile-dep-name-force-not-compiling/12114/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-332180" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="332180"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="332183" data-post-id="332183">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="shahryarjb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/shahryarjb/120/39485_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  shahryarjb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-Ash-Core-Team" data-username="zachdaniel" data-post="14" data-topic="12114">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachdaniel/48/31980_2.png" class="avatar"> zachdaniel:</div>
<blockquote>
<pre data-code-wrap="elixir"><code class="lang-elixir">Mix.Project.pop()

          "mix.exs"
          |&gt; File.read!()
</code></pre>
</blockquote>
</aside>
<p>Thank you <a class="mention" href="/u/zachdaniel" rel="nofollow">@zachdaniel</a>, it is for runtime or need to reset the app? I think you totally change the mix and the phoenix returns alert and you need to do this.</p>
<p>I will try it. it is so much clear than my code it does for runtime</p>
<aside class="quote no-group quote-modified" data-username="shahryarjb" data-post="13" data-topic="12114">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/shahryarjb/48/39485_2.png" class="avatar"> shahryarjb:</div>
<blockquote>
<h3>for phoenix in runtime</h3>
<blockquote>
<p>If you are using Phoenix as developer mode, please disable <code>live_reload</code> in <code>dev.exs</code> . Please add <code>reloadable_apps: [:mishka_installer]</code> to your endpoint config in <code>config.exs</code> file.</p>
</blockquote>
</blockquote>
</aside> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="332183" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/mix-task-run-deps-compile-dep-name-force-not-compiling/12114/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-332183" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="332183"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="332187" data-post-id="332187">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="zachdaniel" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachdaniel/120/31980_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  zachdaniel
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Ash</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Not sure I fully understand the question, sorry.</p>
<p>A brief explanation of what I need to do is: I add a dependency to the <code>mix.exs</code> file, and I need to fetch it and look for a mix task defined by it. So I need to add a dep, get it with <code>mix deps.get</code> and then compile it with <code>mix deps.compile</code>. My use case is quite limited, as I know that the app will shut down after running my mix task, so it’s not really a problem if it ends up in a weird state. But this is happening at runtime, not at compile time (since its in a mix task.</p>
<p>Does that answer your question?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="332187" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/mix-task-run-deps-compile-dep-name-force-not-compiling/12114/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-332187" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="332187"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="332190" data-post-id="332190">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="shahryarjb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/shahryarjb/120/39485_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  shahryarjb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thank you for your time and efforts.</p>
<p>My lib downloads hex tar file (and extract it) or get from GitHub and after that I run a <code>Port.open</code> function and run system command(<code>mix deps.get</code> and etc), after building I move all <code>ebin</code> file  to my for example <code>build/prod</code> and do all the code I put above.</p>
<hr>
<p>Another way my lib can, he/she changes the mix file and your code can re-compile in runtime without any downtime? yes?</p>
<hr>
<p>Another way for my first option I can do your code in diffrent directory with diffrent project and build and move all the <code>ebin</code> to my current project again?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="332190" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/mix-task-run-deps-compile-dep-name-force-not-compiling/12114/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-332190" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="332190"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="332192" data-post-id="332192">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="zachdaniel" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachdaniel/120/31980_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  zachdaniel
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Ash</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m sorry, I’m having trouble understanding your question <img src="https://forum.elixirforum.com/images/emoji/apple/frowning.png?v=15" title=":frowning:" class="emoji" alt=":frowning:" loading="lazy" width="20" height="20"></p>
<blockquote>
<p>Another way my lib can, he/she changes the mix file and your code can re-compile in runtime without any downtime? yes?</p>
</blockquote>
<p>I believe the answer to this question is yes. You can run this to install any deps added to the <code>mix.exs</code> file without downtime. But if the app is <em>currently running</em> I’m not sure if there will be weird behavior from the <code>Mix.Project.pop/1</code> call. Hard to say.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="332192" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/mix-task-run-deps-compile-dep-name-force-not-compiling/12114/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-332192" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="332192"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="332193" data-post-id="332193">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="shahryarjb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/shahryarjb/120/39485_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  shahryarjb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-Ash-Core-Team" data-username="zachdaniel" data-post="18" data-topic="12114">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachdaniel/48/31980_2.png" class="avatar"> zachdaniel:</div>
<blockquote>
<p>But if the app is <em>currently running</em> I’m not sure if there will be weird behavior from the <code>Mix.Project.pop/1</code> call. Hard to say.</p>
</blockquote>
</aside>
<p>Thank you. Aha, this is the answer I need.</p>
<p>So I should re-check it. I do not care about state if lost! because hot coding is very hard for full project, hot coding just useful for one or 2 modules manually and it is very harder in release mode!</p>
<p>Thank you and sorry for my english I am not native, it wasted your time <img src="https://forum.elixirforum.com/images/emoji/apple/face_holding_back_tears.png?v=15" title=":face_holding_back_tears:" class="emoji" alt=":face_holding_back_tears:" loading="lazy" width="20" height="20"><img src="https://forum.elixirforum.com/images/emoji/apple/folded_hands/2.png?v=15" title=":folded_hands:t2:" class="emoji" alt=":folded_hands:t2:" loading="lazy" width="20" height="20"></p>
<p>Anyway, Ash means bear in my mother tongue lang <img src="https://forum.elixirforum.com/images/emoji/apple/joy.png?v=15" title=":joy:" class="emoji" alt=":joy:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="332193" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/mix-task-run-deps-compile-dep-name-force-not-compiling/12114/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-332193" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="332193"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>