vonH

vonH

When you compile a package yourself where is stored?

I couldn’t get sqlite_ecto2 to work in a project so I downloaded the package fron its github repo and compiled it.

After compiling it does it get automatically stored for global use in some directory managed by Erlang/elixir package system, or do I need to run some mix command to set how it will be available for other projects and packages?

Marked As Solved

NobbZ

NobbZ

You can do, but you shouldn’t. It would either mean, that you have to copy your locally build stuff manually into the _build-tree of your actual app. Hex might complain about this and try to compile again from what it sees in its deps-tree.

Another way to use the locally compiled stuff is to use it as a :path dependency, which basically does the following:

  • Copy the sources from the given path into your deps-tree
  • Compile it using MIX_ENV=prod into your _build-tree
  • Use it as a proper dependency

So it would roughly do the same what you had to do, but less error-prone.

Still, what you really wan’t is to use a :git-dependency. This is the easiest way to make your application available to others and make contributions free of any hurdles.


The way to check the version of a package that you pulled/cloned from git is often refered to as the version specified in the mix-file plus the actual commit-SHA you compiled from.

Also Liked

NobbZ

NobbZ

The compiled package is stored in _build/<mix_env>/<package>, and you shouldn’t use that one anywhere but for developing it. If you want to use the git version of a dependency then specify it as such. That’s what the :git key in the dependencies options is about.

OvermindDL1

OvermindDL1

Because configurations and macro’s and such can entirely change how that library is compiled based on the various usages and configs and such of each individual project, so each project, and indeed each environment inside even a single project, needs to be compiled uniquely.

You really want to use the :git option dependency in the mix.exs file.

Where Next?

Popular in Questions Top

itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
New
Kagamiiiii
Student &amp; New to elixir. Nice language. I want to convert a english character, e.g. “a”, which is stored in a variable, to it’s asci...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
wernerlaude
In AR this is so simple @articles = current_user.articles How to do in Ecto? def index(conn, _params) do current_user = conn.assig...
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

Other popular topics Top

peerreynders
Manning 2016 Halloween weekend sale via Deal of the Day Friday, October 28 - Half off all MEAPs - code WM102816LT Saturday, October 29 ...
326 29600 154
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
AstonJ
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
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
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
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

We're in Beta

About us Mission Statement