New Versions Of Chocolatey NuGet Packages For Elixir and Erlang

Quite some time ago, I took over maintenance of the Chocolatey NuGet (CNG) packages for both Elixir and Erlang.  I did release new versions of both packages as new versions of Erlang and Elixir became available but I didn’t do a lot of work on either of them.  That changed a little bit today.

One thing that had always kind of annoyed me was the fact that I could take my pick; I could modify people’s paths on their machines without asking or I could tell people that after they installed Erlang and Elixir they’d need to fix up their paths to get Elixir to work “out of the box”.  Neither option seemed particularly good but I decided to go with the latter because I don’t believe in messing around with other people’s machines without explicit permission and I didn’t see anything in the CNG framework to prompt them.

Recently the question of why Elixir doesn’t work “out of the box” came up yet again.  I gave my standard answer and then one of the CNG mods mentioned an option that I’d not heard of before.  CNG now has the ability to create a small shim file to run another command. I say “now has” but this feature may have been in CNG all along; maybe I just never heard of it.

Regardless this is a great approach.  I can create these shims to point to the right bat files and the right exe’s, put the shims in the Chocolatey bin directory which is added to the path by Chocolatey and I get behavior much closer to the behavior that apt-get and homebrew users have been getting for a long time.

So today, I’m pushing up slightly modified CNG packages for both Elixir and Erlang.  Besides adding the shims I also removed some dead code that I had simply been too lazy to remove and I also modified the Erlang uninstall process to fix a long-standing issue.

One thing some people may take some issue with: I have called the shim to iex.bat ielixir. I did this because iex is a command in Powershell and if you’re on Windows, you should be using Powershell for your terminal.  Note that since this is simply a shim, iex.bat is still present and can still be called if anyone cares to.  I realize that on Mac and Linux it’s iex but I think this is important enough to allow this small divergence.  Maybe we could get Mac and Linux to add an ielixir alias to their packages.  After all iex is short for “interactive elixir” so ielixir isn’t totally unreasonable.

I would appreciate it if anyone who uses CNG to install Elixir would take a look at this new package and beat it up a bit.  If you find issues, please let me know via the Github repo. 1.0.5 and 18.0 will continue to be on CNG if you don’t care to make this change.

The packages are Elixir 1.0.5.20150709 and Erlang 18.0.20150709

Always the way; upload packages, let people know and then realize you forgot to test something.  The corrected packages are Elixir 1.0.5.20150710 and Erlang 18.0.20150709.2

Thanks to Gary Ewan Park and Rob Reynolds for their help in figuring out the problems I was having with creating the shim files I needed.

3 responses

  1. Installed and working through Jose’s example at https://howistart.org/posts/elixir/1.

    Using ielixir I get:

    C:\Users\jbriggs\Downloads\portal>ielixir -S mix
    ** (UnicodeConversionError) invalid encoding starting at <>
    (elixir) lib/string.ex:1351: String.to_char_list/1
    (elixir) lib/code.ex:307: Code.require_file/2

    Removing the chocolatey/bin directory and adding the path to the chocolatey elixir and erlang installs I can do:

    C:\Users\jbriggs.IIS\Downloads\portal>iex -S mix
    Interactive Elixir (1.0.5) – press Ctrl+C to exit (type h() ENTER for help)
    iex(1)> Portal.Door.start_link(:pink)
    {:ok, #PID}
    iex(2)>

    When I add the chocolatey/bin directory back into the PATH _before_ the other two I get the same error as before.

    When I add it _after_ the paths to the elixir and erlang bin directories it works:

    C:\Users\jbriggs.IIS\Downloads\portal>ielixir -S mix
    Interactive Elixir (1.0.5) – press Ctrl+C to exit (type h() ENTER for help)
    iex(1)> Portal.Door.start_link(:pink)
    {:ok, #PID}
    iex(2)>

    • By the way, the following works:

      ielixir -S mix.bat

      as does

      iex.bat -S mix.bat

      I’m guessing it’s something to do with specifying mix vs. mix.bat. “mix” without the extension is the bash shell script.

  2. Yes, I see that problem. One thing though; I’m assuming you’re working from a cmd prompt (not a powershell prompt). iex doesn’t work on powershell which is why I aliased the name as ielixir. I’ll investigate this and see if I can figure out what’s going on.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: