State of the BEAM Ecosystem in Nix

Nice, thanks @hauleth and @anon31783435 for this. But… but fetchMixDeps still has to be run in non-sandboxed mode, am I right or I’m missing some key things?

You are missing to provide the sha256 in the attribute set to make fetchMixDeps create a FOD.

FOD? Please explain yourself thinking that I’m totally dumb

Fixed Output Derivation.

A derivation of which you tell nix in advance that it has “side effects” but promise that those side effects will lead to content that has a certain hash.

You have to pass this hash to to fetchMixDeps.

You can use lib.fakeSha256 as an initial value and then copy the got from the error message you see during build.

This is called “trust on first use”.


Small Update.

  • No more hermetic rebar3
  • No more snapshot/package set
  • updated the documentation
  • Got rid of Riak-CS and Stanchion. Not maintained anymore. One less dep on R16Basho

Now on the new problems

  • Still no decision forward on how to handle mix/rebar lockfiles. I am still in favour of a FOD tool but well still problematic
  • Riak-3.0.1 have shown that problem even better, they moved to rebar3 which means that now i have to find a nice way to bring the packages and the whole dependencies properly. I have not done the work so far which means
  • R16-Basho still live. But in progress
  • The whole beampackages library and organisation is still a mess, that should be able to clean up better
  • Some work on cross compiling has been done, but this is stale due to bootstrapping problems. Still searching for someone that understand how the splicing is done to help there
  • The doubling of erl/libs in the path is still there, noone has taken the time to test things there.
  • It seems that buildMix is broken now ?

Hey BEAMers.

I’ll use this thread for a question.
Should we really include all of the docs in the Erlang build (HTML, PDF, chunks)?
Wouldn’t it be enough to include the chunks only for most of our usecases?
(Note: install-docs / environment variable DOC_TARGETS=chunks)

I encountered this while in need to deliver a Docker image to one of my clients.
The image is much larger then it should be, caused by the massive amount of docs.
I don’t understand why Erlang lands in the image anyway.
Theoretically the included ERTS of my mix release should already be enough.?

Thanks everybody improving BEAMland in Nixpkgs.
Thanks for erlang_nox / beam_nox (we still need to mention this better in the docs).

Thanks DianaOlympos for your effort in cross compiling.
I still hope someone with experience will help out getting this foreward.
I still find Nix will give the best expierince for cross compiling Erlang…

1 Like

Depending on how you built the docker image, especially when doing an embedded release, there might be a reference to the original erlang used at build time. This was at least the case when building releases for some elixir application I started in a toy project.

In that project I used the following in the fixupPhase to mitigate the problem.

for f in $(${pkgs.findutils}/bin/find $out -name start); do
  substituteInPlace $f \
    --replace 'ROOTDIR=${packages.erlang}/lib/erlang' 'ROOTDIR=""'

On top of that I was able to further reduce image sizes by building erlang without wx and systemd.


Thanks NobbZ. Your snippet seems to be the right pice.
Finally building Erlang happens nowadays in an acceptable amount of time (10 minutes).
Former I needed to wait an hour - never found out why.

But I ran into another trouble.
Building on my Alpine (musl) a wrong OpenSSL path get’s linked in my build crypto lib (lib/crypto/
I don’t know yet how to patch this…

My question to all Erlang maintainers or BEAM team members is still open.
Should we really include all docs (HTML, PDF) in the Erlang builds?

In my oppinion the chunks could be enough!?
I could fill a PR if anybody is in the same oppinion.
(finally as building happens fast enough :wink: