Home Explore Blog CI



nixpkgs

pkgs/development/compilers/elm/README.md
a6a6cd3e60aabca2653ff2e8d0c414d5462e4c3587264f6000000003000003cb
# 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
a129510c (1st chunk of `pkgs/development/compilers/elm/README.md`)
Title: Elm Build Process and Dependency Management
Summary
This section describes how to update Elm, and details the build process, focusing on how Elm embeds pre-compiled code and manages its dependencies. It explains how 'elm make' retrieves dependencies from package.elm-lang.org and handles caching, emphasizing the use of makeDotElm function for Nix integration. It also addresses the need to copy dependencies and the handling of versions.dat, along with setting ELM_HOME to ensure proper artifact usage during the build.