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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>It’s “should” afaik. In the end elixir becomes precompiled beam files, which are forward compatible to newer OTP versions.</p>
<p>I also don’t think the issue here is due to the elixir installation being used. If you use OTP 25 and elixir compiled with otp 24, both won’t magically use a new opcode introduced in OTP 26. It’s more likely a mess either with switching OTP versions or even more with switching otp versions and having dependencies, which keep build artifacts within <code>deps/</code> instead of only within <code>_build/</code>. That happens with some erlang dependencies (more likely on old ones though).</p>
<p>The stated cleaning of <code>deps/</code> and <code>_build</code> resolving the issue would certainly favor that theory. Generally clearing <code>_build</code> should already be enough.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="314772" 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/erlang-dependency-compiled-with-wrong-erlang-version/61028/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-314772" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="314772"
                     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="314774" data-post-id="314774">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="LostKobrakai" data-post="12" data-topic="61028">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lostkobrakai/48/3072_2.png" class="avatar"> LostKobrakai:</div>
<blockquote>
<p>Generally clearing <code>_build</code> should already be enough.</p>
</blockquote>
</aside>
<p>Some Erlang libraries have pre-compilation phases where they generate files inside their own directories. That’s why deleting <code>deps</code> is also generally recommended.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="314774" 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/erlang-dependency-compiled-with-wrong-erlang-version/61028/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-314774" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="314774"
                     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="314794" data-post-id="314794">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><img src="https://forum.elixirforum.com/images/emoji/apple/thinking.png?v=15" title=":thinking:" class="emoji" alt=":thinking:" loading="lazy" width="20" height="20"> Could be you had a out-of-date <code>comp_opts.mk</code> file in <code>deps/luerl</code> - it’s generated when the package is installed and contains the Erlang version:</p>
<p><a href="https://github.com/rvirding/luerl/blob/develop/get_comp_opts.escript#L13" class="onebox" target="_blank" rel="noopener nofollow">https://github.com/rvirding/luerl/blob/develop/get_comp_opts.escript#L13</a></p>
<p>Installing a higher version will naturally generate a new file in <em>its</em> directory in <code>deps</code></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="314794" 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/erlang-dependency-compiled-with-wrong-erlang-version/61028/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-314794" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="314794"
                     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="314836" data-post-id="314836">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="nahoj" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  nahoj
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I had this thought also, but I never got further with it and if I compile with DEBUG=1 it suggests that the options is correct, see below.</p>
<p>To emphasize, I’m aware that it might be strange to recompile one dependency, this is only done in order to reproduce the “issue”.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">rm -rf _build/ deps &amp;&amp; mix deps.get &amp;&amp; mix compile --force &amp;&amp; DEBUG=1 mix deps.compile luerl --force &amp;&amp; mix compile --force

Resolving Hex dependencies...
Resolution completed in 0.013s
Unchanged:
  luerl 1.1.1
* Getting luerl (Hex package)
===&gt; Analyzing applications...
===&gt; Compiling luerl
Compiling 1 file (.ex)
Generated foo app
===&gt; Expanded command sequence to be run: []
===&gt; Running provider: do
===&gt; Expanded command sequence to be run: [app_discovery,{bare,compile}]
===&gt; Running provider: app_discovery
===&gt; Found top-level apps: [luerl]
	using config: [{src_dirs,["src"]},{lib_dirs,["apps/*","lib/*","."]}]
===&gt; Running provider: {bare,compile}
===&gt; Compile (untagged)
===&gt; Running hooks for compile in app luerl (/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl) with configuration:
===&gt; 	{pre_hooks, []}.
===&gt; Running hooks for erlc_compile in app luerl (/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl) with configuration:
===&gt; 	{pre_hooks, []}.
===&gt; Analyzing applications...
===&gt; Compiling luerl
===&gt; compile options: {erl_opts, [debug_info,
                                  {d,'ERLANG_VERSION',"25.3.2.6"},
                                  {d,'HAS_MAPS',true},
                                  {d,'HAS_FULL_KEYS',true},
                                  {d,'NEW_REC_CORE',true},
                                  {d,'NEW_RAND',true},
                                  {d,'NEW_BOOL_GUARD',true},
                                  {d,'HAS_FLOOR',true},
                                  {d,'HAS_CEIL',true},
                                  {d,'NEW_STACKTRACE',true},
                                  {d,'EEP48',true}]}.
===&gt; files to analyze ["/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_sandbox.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_comp_lint.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_comp_env.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_heap.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_comp.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_lib_math.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_lib_utf8.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_init.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_comp_peep.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_anno.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_lib_os.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/ttdict.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_lib_string.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_old.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/Elixir.Luerl.New.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_comp_vars.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_lib_basic.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_util.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_new.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_lib_os_date.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_comp_locf.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_lib_bit32.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_lib_package.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_lib_io.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_comp_normalise.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_lib.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_shell.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_parse_exp.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_lib_debug.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_emul.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_scan.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_lib_table.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/ttsets.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_parse.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/Elixir.Luerl.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_app.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_comp_cg.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_sup.erl",
                       "/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl/src/luerl_lib_string_format.erl"]
===&gt; Running hooks for erlc_compile in app luerl (/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl) with configuration:
===&gt; 	{post_hooks, []}.
===&gt; Running hooks for app_compile in app luerl (/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl) with configuration:
===&gt; 	{pre_hooks, []}.
===&gt; Running hooks for app_compile in app luerl (/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl) with configuration:
===&gt; 	{post_hooks, []}.
===&gt; Running hooks for compile in app luerl (/home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/deps/luerl) with configuration:
===&gt; 	{post_hooks, []}.
Compiling 1 file (.ex)

08:09:22.501 [error] beam/beam_load.c(184): Error loading module luerl:
  This BEAM file was compiled for a later version of the runtime system than the current (Erlang/OTP 25).
  To fix this, please re-compile this module with an Erlang/OTP 25 compiler.
  (Use of opcode 181; this emulator supports only up to 180.)



08:09:22.501 [error] Loading of /home/01e3c763592bbc85568a28a81ae6f5f732d8d183f7f533080a0998e7229127fe/_build/dev/lib/luerl/ebin/luerl.beam failed: :badfile

warning: :luerl.dofile/2 is undefined (module :luerl is not available or is yet to be defined)
  lib/foo.ex:3: Foo.bar/0

warning: :luerl.init/0 is undefined (module :luerl is not available or is yet to be defined)
  lib/foo.ex:3: Foo.bar/0

Generated foo app
</code></pre>
<p>If I instead only run the command below, which doesn’t recompile luerl it works as expected. It also works if I instead use luerl version 1.1.0 as previously pointed out.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">rm -rf _build/ deps &amp;&amp; mix deps.get &amp;&amp; mix compile --force &amp;&amp; mix compile --force
</code></pre>
<p>Versions</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">mix -v
Erlang/OTP 25 [erts-13.2.2.3] [source] [64-bit] [smp:20:20] [ds:20:20:10] [async-threads:1] [jit:ns]

Mix 1.15.7 (compiled with Erlang/OTP 25)
</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="314836" 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/erlang-dependency-compiled-with-wrong-erlang-version/61028/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-314836" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="314836"
                     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>