The default command combines
esy install and
esy build and runs them in
Install dependencies declared in
% esy install
If the file
esy.lock (an analogue of
yarn.lock) exists then it will be used
to resolve dependencies' version constraints to concrete versions, otherwise
constraints resolution will be performed and saved to a fresh
This command is based on
yarn and accepts the same command line arguments and
Ensure all dependencies are built and then execute the project's build commands.
Note that esy tries to reuse built artifacts as much as possible, even across
different sandboxes. That means that usually
esy build executes only root
project's build process.
% esy build
Run commands in the specified environment
These commands allow to execute arbitrary commands in esy's managed environments. For more info about environment types see [corresponding docs][environment.md].
esy build <anycommand>
<anycommand> in the build environment.
For example, we can see which
ocamlfind libraries are available:
% esy build ocamlfind
Another example usage would be to execute a build process for some specific build target:
% esy build bin/hello.exe
This is useful when you want to perform a build just for a subset of build outputs.
esy build-shell [<path/to/package>]
Initialize shell with build environment.
% esy build-shell
<path/to/package> argument is passed then the build shell is initialied for
the specified package:
% esy build-shell ./node_modules/@opam/lwt
This command is useful for debugging failing builds.
<anycommand> in command environment.
% esy vim ./bin/hello.re
As command environment contains development time dependencies (like
vim program will have access to those.
Initialize shell with command environment.
% esy shell
esy x <anycommand>
<anycommand> in test environment.
esy x hello
This invocation puts root project's executables in
$PATH thus it's useful to
test the project as it was installed.
Prints a dependency tree with status of each package.
% esy ls-builds
Prints a dependency tree with all available libraries.
% esy ls-libs
Prints a dependency tree with all available libraries and modules.
% esy ls-modules
Prints build environment on stdout.
% esy build-env
Prints command environment on stdout.
% esy command-env
Adds a new dependency for a project.
% esy add @opam/lwt
Produce an npm package with pre built binaries for the current platform inside
See Building Releases for more info.
Export dependencies of the root project from a build store.
% esy export-dependencies
The invocation above produces a set of tarballs inside
Those tarballs can be shipped to another host and imported into build store with
esy import-build command.
Export a single build out of a build store.
% esy export-build ~/.esy/3/i/ocaml-4.6.0-abcdef90
This commands produces
_export/ocaml-4.6.0-abcdef90.tar.gz tarball which can
be imported into another build store with
esy import-build command.
Import a single build into a build store.
Import from a previously exported build:
% esy import-build ./_export/ocaml-4.6.0-abcdef90.tar.gz
Import from a build store:
% esy import-build /path/to/build/store/3/i/ocaml-4.6.0-abcdef90