[Nix#8811] default output is no longer built by default, unless it's named "out" #125

Open
opened 2024-03-16 06:45:02 +00:00 by lix-bot · 3 comments
Member

Upstream-Issue: https://github.com/NixOS/nix/issues/8811

Describe the bug

It's no longer possible to nix build outputs other than out:

{
  outputs = { self, nixpkgs }:
    let pkgs = import nixpkgs { system = "x86_64-linux"; };
    in {
      packages.x86_64-linux = {
        test = builtins.derivation {
          system = "x86_64-linux";
          name = "test-0";
          outputs = [ "main" "alt" ];
          builder = "${pkgs.busybox}/bin/ash";
          args = [ "-c" "echo main > $main; echo alt > $alt" ];
        };
      };
    };
}

Steps To Reproduce

$ nix build '.#test'  # broken
error: derivation '/nix/store/nz97m53ivjay0vk6spcr2pdzw3xg68if-test-0.drv' does not have wanted outputs 'out'
$ nix build '.#test^main'  # works

Expected behavior

As with Nix 2.12:

$ nix build '.#test'  # works
$ nix build '.#test^main'  # works

nix-env --version output

nix-env (Nix) 2.15.1

Additional context

Seems to be a regression in between 2.12 and 2.13.

Priorities

Add 👍 to issues you find important.

Upstream-Issue: https://github.com/NixOS/nix/issues/8811 **Describe the bug** It's no longer possible to `nix build` outputs other than `out`: ``` { outputs = { self, nixpkgs }: let pkgs = import nixpkgs { system = "x86_64-linux"; }; in { packages.x86_64-linux = { test = builtins.derivation { system = "x86_64-linux"; name = "test-0"; outputs = [ "main" "alt" ]; builder = "${pkgs.busybox}/bin/ash"; args = [ "-c" "echo main > $main; echo alt > $alt" ]; }; }; }; } ``` **Steps To Reproduce** ``` $ nix build '.#test' # broken error: derivation '/nix/store/nz97m53ivjay0vk6spcr2pdzw3xg68if-test-0.drv' does not have wanted outputs 'out' $ nix build '.#test^main' # works ``` **Expected behavior** As with Nix 2.12: ``` $ nix build '.#test' # works $ nix build '.#test^main' # works ``` **`nix-env --version` output** `nix-env (Nix) 2.15.1` **Additional context** Seems to be a regression in between 2.12 and 2.13. **Priorities** Add :+1: to [issues you find important](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
raito added this to the 2.95 milestone 2026-01-04 13:36:12 +00:00
Owner

It seems to be introduced by 1ddabe1a01 ("nix: Respect meta.outputsToInstall, and use all outputs by default") which is very ironic.

It seems to be introduced by 1ddabe1a0120787ff5bbdba5383222a6eb59c219 ("nix: Respect meta.outputsToInstall, and use all outputs by default") which is very ironic.
Owner

Actually, I lied: ce2f91d356 broke it by dropping the iteration over sOutputs.

Actually, I lied: ce2f91d356438297fd795bd3edb8f9f4536db7da broke it by dropping the iteration over sOutputs.
Author
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/5284 ("libcmd/installable-flake: build all outputs by default")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/5284", "number": 5284, "kind": "commit message"}], "cl_meta": {"5284": {"change_title": "libcmd/installable-flake: build all outputs by default"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/5284](https://gerrit.lix.systems/c/lix/+/5284) ("libcmd/installable-flake: build all outputs by default")
raito self-assigned this 2026-03-01 15:20:05 +00:00
raito modified the milestone from 2.95 to 2.96 2026-03-02 23:15:16 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#125
No description provided.