Arp-G / csv2sql

A blazing fast fully-automated CSV to database importer
MIT License
54 stars 4 forks source link

Cross platform elixir releases #16

Open Arp-G opened 2 years ago

Arp-G commented 2 years ago

The release for csv2sql 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`

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

More insights

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.

Ideally, we 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.

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

Some Helpful References I have found:

Mix release docs about release requirements This discussion on elixirforum This blog