Skip to content

iets v0.3.0

Latest

Choose a tag to compare

@nixbot-numtide nixbot-numtide released this 02 Dec 21:31
264a6e8

iets is a re-implementation of the Nix client in Rust. It is mostly, but not
fully, compatible with Nix. This release follows v0.2.0 with more than 1150
commits.

The main changes:

  • iets fetches Git inputs itself. It no longer runs the real nix for them.
  • Evaluation of a NixOS configuration is about 20 % faster.
  • A hostile input, such as a Git server or an archive, can do less.
  • nix-eval-jobs works on a flake that has a __functor output.

Download

To run it with Nix: nix run github:numtide/iets/v0.3.0

For Linux, a static musl binary can be downloaded like this:

curl -Lo iets https://github.com/numtide/iets/releases/download/v0.3.0/iets-0.3.0-x86_64-linux
chmod +x iets
./iets version

The binary needs no /nix/store, no nix-daemon and no shared libraries.
For aarch64-linux, use iets-0.3.0-aarch64-linux. SHA256SUMS lists the
checksums.

Security

  • iets no longer opens a local file when a server sends a file:// URL.
    Before, a Git LFS server could make iets read a local file that way.
  • Reading a Git repository no longer runs the core.fsmonitor program
    that the config of the repository names.
  • The .lfsconfig of a repository can no longer give an option to ssh.
    iets refuses a Git LFS ssh host that starts with -, as Git does since
    CVE-2017-1000117.
  • A crafted archive can no longer use much more time or memory than its
    size. iets limits the depth of the paths, counts hard links and each
    compression layer toward fetch-max-size, and writes large files to
    disk in parts.
  • builtins.match and builtins.split stop with an error when a pattern
    such as (a|a)*b backtracks too much. Before, the evaluation did not
    end in a practical time.
  • In pure evaluation, symbolic links are no longer followed if they lead
    out of the project.
  • iets refuses a cache directory that is a symbolic link or that belongs
    to another user. Before, that user could put files into your cache.
  • With a grpc:// builder (nix-grpc-store), the remote store now checks
    the signature of each path that iets uploads. Before, a
    builtins.fetchClosure path from a binary cache could enter the remote
    store without a trusted signature.

New

  • iets fetches Git inputs itself, with the git program. Before, it ran
    the real nix for them. This includes remote repositories, submodules,
    Git LFS files and the check of signed commits (verifyCommit).
  • fetchTree:
    • support for zip archives
    • support for sourcehut URLs
    • support for forge inputs that have a rev but no narHash
  • Support for builtins.fetchClosure. Its toPath attribute, which
    rewrites an input-addressed path to a content-addressed one, is not
    supported yet.
  • import reads from a derivation output that is already in the store. The
    ifd-local-output lint reports it, and the IFD settings apply.
  • iets eval-jobs prints each job as soon as it is evaluated. Before, it
    waited for 256 jobs.
  • iets build takes -j and --cores, applies the daemon settings, sends
    timeout and max-silent-time to a gRPC builder, and builds a derivation
    only for the outputs that are necessary.
  • Classic mode: nix-fallback = auto, always or never chooses when the
    real nix runs. Each setting is also a flag.
  • A second nix-build of the same input skips the evaluation when no file
    changed.
  • --cache-dir moves the full cache to one directory. The daily cleanup
    also removes old Git clones and LFS objects.

Compatibility

  • eval-jobs gives a flake root to --select as it is, as nix-eval-jobs
    does. Before, a flake with a __functor output failed.
  • A set with __functor is auto-called, as nix-instantiate does.
  • "${pkgs.path}" gets the store path that Nix gives it.
  • The search path is split and classified as in Nix.
  • Flakes: a fragment is looked up under packages.<system> first, a local
    Git root can have submodules and shallow=1, inputs.self options apply
    to the root flake, and accept-flake-config warns only when the flake has
    a nixConfig.
  • __json is read as in Nix: the keys are sorted, and the last of two equal
    keys stays.
  • A command that stops at a feature that iets does not support exits with
    code 3, so a caller knows when to use Nix. In eval-jobs, such an error
    is the error of one job, and the exit code does not change. Classic mode
    runs the real nix then. Without a fallback, it exits with code 1, as
    Nix does.
  • Every experimental feature is on. The experimental-features setting and
    flags are ignored.
  • An hg input fails as unsupported. Before, it ran the real nix. iets
    now fetches every source itself.

Fixes

  • A long-running host no longer reaches the limit of open files. Before,
    the cache of fetched inputs could open too many files, and each
    evaluation then failed.
  • A parallel evaluation no longer stops with a false "all workers idle"
    error.
  • eval-jobs fails the run when a write fails or when a worker exits with
    an error. It also keeps the errors that a worker prints while it stops.
  • macOS: nix-eval-jobs in classic mode starts its workers. Before, it
    failed with "unknown flag '--'".
  • A download no longer fails with stalled-download-timeout after the
    process was stopped and continued.

Performance

Evaluation is about 20 % faster than v0.2.0. Measured with the release
binaries on x86_64-linux, with the default number of workers:

Workload v0.2.0 v0.3.0
bench/workloads/nixos-server.nix 616 ms 492 ms
bench/workloads/nixos-plasma.nix 795 ms 628 ms

Platforms

  • Linux: release binaries for x86_64 and aarch64.
  • macOS: no release binary. nix run github:numtide/iets/v0.3.0 works on
    aarch64-darwin.
  • Browser: on a Linux host, nix build .#wasi gives bin/iets.wasm,
    which evaluates Nix in a web worker. It has no network and runs no
    builds.
  • Windows: work in progress, with no release binary.