<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Krzysztof Kempiński</title>
    <description>The latest articles on Forem by Krzysztof Kempiński (@k_kempinski).</description>
    <link>https://forem.com/k_kempinski</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F517304%2F6acd50c8-19f7-4f83-bb9b-a39c5bbddf2c.jpg</url>
      <title>Forem: Krzysztof Kempiński</title>
      <link>https://forem.com/k_kempinski</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/k_kempinski"/>
    <language>en</language>
    <item>
      <title>Fix for Erlang installation with asdf on macOS 11 Big Sur</title>
      <dc:creator>Krzysztof Kempiński</dc:creator>
      <pubDate>Tue, 29 Dec 2020 13:32:17 +0000</pubDate>
      <link>https://forem.com/k_kempinski/fix-for-erlang-installation-with-asdf-on-macos-11-big-sur-16j4</link>
      <guid>https://forem.com/k_kempinski/fix-for-erlang-installation-with-asdf-on-macos-11-big-sur-16j4</guid>
      <description>&lt;h2&gt;
  
  
  Issue
&lt;/h2&gt;

&lt;p&gt;There is an open issue with installing Erlang on macOS 11 Big Sur - &lt;a href="https://github.com/erlang/otp/pull/2865"&gt;https://github.com/erlang/otp/pull/2865&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I use &lt;strong&gt;asdf&lt;/strong&gt; (&lt;a href="https://asdf-vm.com/#/"&gt;https://asdf-vm.com/#/&lt;/a&gt;) to manage versions of my local Elixir and Erlang applications. Recently I noticed that when I want to install (using asdf install ) Erlang version specified in .tool-versions file I see that error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are natively building Erlang/OTP for a later version of MacOSX
  than current version (11.1). You either need to
  cross-build Erlang/OTP, or set the environment variable
  MACOSX_DEPLOYMENT_TARGET to 11.1 (or a lower version).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;I manage to overcome this. My strategy was to install desired Erlang version with another tool to build and manage Erlang instances - &lt;strong&gt;kerl&lt;/strong&gt; (&lt;a href="https://github.com/kerl/kerl"&gt;https://github.com/kerl/kerl&lt;/a&gt;) - and inject that installation to asdf.&lt;/p&gt;

&lt;p&gt;Steps to solve the issue:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Install Kerl (I assume you use Homebrew).&lt;br&gt;
&lt;code&gt;$ brew install kerl&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set configuration options for Kerl.&lt;br&gt;
&lt;code&gt;$ export KERL_CONFIGURE_OPTIONS="--disable-debug --without-javac"&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Try to build your version of Erlang (it will fail!). In that example I'm installing version 21.3.8. If you want another version, just replace &lt;code&gt;21.3.8&lt;/code&gt; to a version you want in all following commands.&lt;br&gt;
&lt;code&gt;$ kerl build 21.3.8 21.3.8&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open OTP configuration file (I assume you use VSCode - that's why you can see &lt;code&gt;code&lt;/code&gt;. Replace with your editor.)&lt;br&gt;
&lt;code&gt;$ code ~/.kerl/builds/21.3.8/otp_src_21.3.8/configure.in&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Find that line &lt;br&gt;
&lt;code&gt;#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ &amp;gt; $int_macosx_version&lt;/code&gt;&lt;br&gt;
and replace it with that line: &lt;br&gt;
&lt;code&gt;#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ &amp;gt; $int_macosx_version &amp;amp;&amp;amp; false&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Try to build it again. Now it should work. Will take some time so be patient!&lt;br&gt;
&lt;code&gt;$ kerl build 21.3.8 21.3.8&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make a directory for a new version of Erlang in your asdf directory.&lt;br&gt;
&lt;code&gt;$ mkdir ~/.asdf/installs/erlang/21.3.8&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install (copy) Erlang installed via kerl to asdf.&lt;br&gt;
&lt;code&gt;$ kerl install 21.3.8 ~/.asdf/installs/erlang/21.3.8&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Close your console and open again (or open new window) and go to you project. Run asdf install to ensure you have your Elixir and Erlang versions installed.&lt;br&gt;
&lt;code&gt;$ asdf install&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Compile your Elixir app.&lt;br&gt;
&lt;code&gt;$ mix compile&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And that's it!&lt;/p&gt;

&lt;p&gt;If you have any comments or questions, find my on Twitter: &lt;a href="https://twitter.com/k_kempinski"&gt;https://twitter.com/k_kempinski&lt;/a&gt;&lt;/p&gt;

</description>
      <category>elixir</category>
      <category>erlang</category>
    </item>
  </channel>
</rss>
