Skip to content

_multioutPropagateDev(): can't set propagatedBuildOutputs with __structuredAttrs #323126

@SomeoneSerge

Description

@SomeoneSerge

Describe the bug

Steps To Reproduce

nix-build << \EOF

test-structured-multiple-outputs.nix
with import <nixpkgs> { };

stdenv.mkDerivation {
  pname = "structured-multiple-outputs";
  version = "0.0.1";
  __structuredAttrs = true;
  outputs = [
    "out"
    "a"
    "b"
    "c"
  ];
  dontUnpack = true;
  postInstall = ''
    for output in $(getAllOutputNames) ; do
      mkdir "''${!output}"
    done
  '';
  propagatedBuildOutputs = [
    "a"
    "b"
    "c"
  ];
}
EOFcat result/nix-support/propagated-build-inputs 
 /nix/store/c39a0kg4fazhc80zfrh8zq7ryc8hc577-structured-multiple-outputs-0.0.1-a

Expected behavior

cat result/nix-support/propagated-build-inputs 
 /nix/store/vj1xb9gm2miy36mkzhg5man4b0qfq48r-structured-multiple-outputs-0.0.1-a /nix/store/72h5ba19ln4awnsyjd2m0srhny4aqfcs-structured-multiple-outputs-0.0.1-b /nix/store/aifzdh9si8qr59rwx1g89z6z6yz5pvgq-structured-multiple-outputs-0.0.1-c

The above was obtained with:

  # _multioutPropagateDev() currently expects a space-separated string rather than an array
  preFixup = ''
    export propagatedBuildOutputs="''${propagatedBuildOutputs[@]}"
  '';

Notify maintainers

CC maybe @vcunat @Artturin ?

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

nix flake metadata nixpkgs
Resolved URL:  path:/nix/store/dydg48djlykksz8cxq0xjplyxpa9pvf4-source?lastModified=1718160348&narHash=sha256-9YrUjdztqi4Gz8n3mBuqvCkMo4ojrA6nASwyIKWMpus%3D&rev=57d6973abba7ea108bac64ae7629e7431e0199b6
Locked URL:    path:/nix/store/dydg48djlykksz8cxq0xjplyxpa9pvf4-source?lastModified=1718160348&narHash=sha256-9YrUjdztqi4Gz8n3mBuqvCkMo4ojrA6nASwyIKWMpus%3D&rev=57d6973abba7ea108bac64ae7629e7431e0199b6
Description:   A collection of packages for the Nix package manager
Path:          /nix/store/dydg48djlykksz8cxq0xjplyxpa9pvf4-source
Revision:      57d6973abba7ea108bac64ae7629e7431e0199b6
Last modified: 2024-06-12 02:45:48

Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions