Home Explore Blog Models CI



nixpkgs

pkgs/development/compilers/elm/README.md
411e24dab36c299ceba78cadf6fde00354b584d8d7666b8400000003000003cb
# To update Elm:

Modify revision in ./update.sh and run it

# Notes about the build process:

The elm binary embeds a piece of pre-compiled elm code, used by 'elm
reactor'. This means that the build process for 'elm' effectively
executes 'elm make'. that in turn expects to retrieve the elm
dependencies of that code (elm/core, etc.) from
package.elm-lang.org, as well as a cached bit of metadata
(versions.dat).

The makeDotElm function lets us retrieve these dependencies in the
standard nix way. We have to copy them in (rather than symlink) and
make them writable because the elm compiler writes other .dat files
alongside the source code. versions.dat was produced during an
impure build of this same code; the build complains that it can't
update this cache, but continues past that warning.

Finally, we set ELM_HOME to point to these pre-fetched artifacts so
that the default of ~/.elm isn't used.

More: https://blog.hercules-ci.com/elm/2019/01/03/elm2nix-0.1/

Chunks
1839abfb (1st chunk of `pkgs/development/compilers/elm/README.md`)
Title: Elm Update and Build Process Details
Summary
This document outlines how to update Elm by modifying the revision in `update.sh`. It then details the Elm build process, explaining that the 'elm' binary embeds pre-compiled code for 'elm reactor', which requires 'elm make' to retrieve dependencies (like elm/core) and metadata (versions.dat) from `package.elm-lang.org`. The `makeDotElm` function is used to fetch these dependencies in a Nix-compatible way, copying them and making them writable for the compiler. `ELM_HOME` is set to point to these pre-fetched artifacts to bypass the default `~/.elm` location. A link to `elm2nix` for more information is also provided.