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 (Erlang -- code), 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

JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
Kagamiiiii
Student & 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
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New

Other popular topics Top

Tee
can someone please explain to me how Enum.reduce works with maps
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
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
hariharasudhan94
I would like to know what is the best IDE for elixir development?
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
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
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New

We're in Beta

About us Mission Statement