crispinb

crispinb

Override default installed Mix with HEAD version?

I want to use a recent fix in Mix (specifically Another attempt at fixing opening in browser on Windows · hexpm/hex@dd9c62b · GitHub) before the next elixir release arrives. I’ve looked through my installation directories (.asdf/installs/elixir/current/ on linux and ~\scoop\apps\elixir\current\ on windows) and have confused myself. I’ve browsed and ripgrepped and can’t find the relevant source. I realise I don’t have a good handle on how the default packages work so wouldn’t be sure what to do even if I do find it. So some questions from the general to the specific:

  • is there a good general doc or description somewhere of how elixir packages relate to modules, and how module discovery and loading works? (in which case I might be able to answer the below questions myself).
  • what are the source files (in [installdir]/lib) used for? I’m guessing they’re not locally compiled, given the presence of the presumably preinstalled *.beam files in [installdir]/lib/**/ebin?
  • either way, can a preinstalled package be overriden locally? (eg. is there an equivalent of the order in a java classpath I can rely on, or can I edit and recompile one of the preinstalled modules in place?)
  • how would I do this (whatever ‘this’ may turn out to be) for the Mix.Tasks.Hex.Docs in the quoted commit?

Answers to any or all alike much appreciated!

Most Liked

eksperimental

eksperimental

Create a simbolic link in the install folder , that points to the git repo, I call mine “main” which is the name of the Elixir branch it is running on.

crispinb

crispinb

After a bit of digging, the TLDR is just to delete my ~/.mix folder, and then reinstall the mix archive from HEAD with mix install github hexpm/hex. I hadn’t entirely grokked that the Mix.Tasks.Hex.Docs package isn’t part of the Elixir installation, but comes with Hex.

In case anyone else comes across this and wonders, here are my rube-ish answers to those of my own questions I’ve managed to answer myself (corrections/additions very welcome):

I haven’t found a single comprehensive source, but reading this Erlang doc (code — OTP 29.0.2 (kernel 11.0.2)), and playing around in iex with the :code functions was pretty enlightening.

Perhaps but I haven’t tried it as it turned out not to be relevant to my situation after all. There is of course a code path from which BEAM files are loaded, and you can add to it :code.add_paths/1 or via an $ERL_LIBS env var. In Erlang you can override anything other than the Kernel and StdLib modules, but I’m not sure about Elixir.

Remove the hex-installed archives from ~/.mix, and reinstall from the hexpm/hex github repo HEAD with mix archive.install.

Where Next?

Popular in Questions Top

Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
vac
Hi, I’m quite new in Elixir and I’m trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and I...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
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
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New

Other popular topics Top

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42920 311
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36128 110
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New

We're in Beta

About us Mission Statement