arpan

arpan

Cross platform elixir releases with docker or buritto?

Hi everyone, I had built a tool that I distribute using elixir releases however recently my colleague faced an issue while running it

The release for the tool is currently built on ubuntu 20.4, when a user attempted to use it on ubuntu 18.0 it gave an error like

../csv2sqk_web/erts-12.0.3/bin/beam.smp: error while loading shared libraries: libtinfo.so.6: cannot open shared object file: No such file or directory`

From what I understand…

It seems the shared library libtinfo.so.6 might not be available on ubuntu-18.0.

Also, I read

Elixir release won’t just depend on your OS flavor. Instead, an Elixir release depends on your processor architecture and C library version (glibc package). This is because there are still system dependencies in place even though Erlang bytecode is platform-independent.

I want to support different operating systems like Linux, windows, and mac and the release should run independently of the user’s processor architecture.

Till now I have found two ways to achieve this:

  1. Use docker to build the release for different platforms and operating systems - We can have a docker setup that builds the release for all the different operating systems that we want to target, however, I am not sure if this can bypass the Target architecture limitation, also I am not sure how it will work out for windows-based docker containers(I don’t have any experience with this).

  2. The second approach is using something like buritto which uses bakeware

The tool here is an umbrella application with 2 apps - one a plain elixir app, the other is a phoenix app and there are no NIFs used.

  • Any ideas on which approach seems more viable? Is there any other way to deal with this problem?

  • What targets should I think about supporting if I want to add support for Linux, Mac, and windows?

  • Any help regarding a sample docker file to build releases for different targets would be very helpful.(I am currently just planning to edit this docker file to support building for multiple targets)?

  • Any help on using buritto which uses bakeware?

  • In the future, I want to be able to test the app in Github actions for different targets, any idea on this?

(Side note: I had previously asked this question here but had given up since I did not face any complaints due to this until now.)

Thanks for reading till the end, this forum’s always been a life savior for me :pray:

Most Liked

cmo

cmo

Burrito doesn’t use bakeware. They’re two similar but completely separate projects. Burrito handles cross compilation where bakeware does not. Burrito docs are great so you shouldn’t need much else to get started there.

You can look at bakeware’s GitHub actions to see how they test multiple OSes.

Recently, Burrito was modified to accept a custom build pipeline, which I use to build releases instead of a single binary. You can see my WIP here.

You might want to build for different operating systems in your CI/CD pipeline.

arpan

arpan

UPDATE:

I tried to build the release inside a docker container running Ubuntu 18.0.
After copying the releases to my host machine running Ubuntu 20.04 it still seemed to work fine.

So it looks like a release built on ubuntu 20.04 will fail when to run on ubuntu 18.04 due to the shared library issue however trying the opposite works fine.

arpan

arpan

Thanks a lot for replying.

Burrito doesn’t use bakeware.

Yup, thanks for clarifying.

look at bakeware’s GitHub actions

This is very useful thanks.

You might want to build for different operating systems in your CI/CD pipeline

I have some confusion regarding this, I tried using burrito and it worked however I still had the error error while loading shared libraries: libtinfo.so.6: cannot open shared object file when running on ubuntu-18.04.

From what I understand buritto helps us to build a release for different environments like Linux, macOS and windows however I still need to build to release for different Linux distributions and versions, for example, I have to build the release for both ubuntu 20.4 and ubuntu 18.04 since they are using different shared libraries like libtinfo.so.6 is not available for ubuntu-18.04.

So, this means I will probably have to write a separate docker script that does a mix release for every Linux distribution and version I want to support like a separate docker file to build release for ubuntu 20.04, ubuntu 18.0, etc.

So buritto only helps me to build releases for macOS or windows from a Linux machine but it does not help if the shared libraries are different.

If the above understanding is correct, then this looks like a difficult task to accomplish since I am not sure how many releases I need to build, and which distributions I need to support.

Do you know of any resources which can help me get started on this?

Where Next?

Popular in Questions Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
Werner
Hi, I’m using Ubuntu 18.04 and after updating to OTP-24.0 yesterday i have this warning when I run “mix local.hex”: 14:57:30.512 [warn] ...
New
logicmason
Hi there, I'm working through my first release with elixir/phoenix. I've built a release with distillery and found that it crashes when I...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
sacepums
Hey guys. I'm new to elixir and im really stocked about it. But I ran into a bit of problem - I need to convert a date sting, for examp...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
Phillipp
Hey, I have a NanoPi-M3 and try to install Elixir on their Ubuntu image. I followed the Raspberry Pi installation instructions from the ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Other popular topics Top

srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

We're in Beta

About us Mission Statement