Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mkDerivation error message not helpful when version isn't present ("error: derivation name missing") #113520

Open
toraritte opened this issue Feb 17, 2021 · 6 comments
Labels
0.kind: bug Something is broken

Comments

@toraritte
Copy link
Contributor

Describe the bug
Removed the version attribute from mkDerivation when hacking on a package, mistook pname for name, then tried to build it thinking all's fine when I received the error: derivation name missing.

Steps to reproduce the behavior:

# nixpkgs/pkgs/servers/sip/freeswitch/default.nix
stdenv.mkDerivation rec {
  pname = "freeswitch";
  # version = "0.1";
  src = fetchFromGitHub {
  # ...
~/clones/nixpkgs $ nix-shell . -A freeswitch
error: derivation name missing

Expected behavior
An error message that points out that mkDerivation's input attribute set has to have either a name attribute, or a pname and a version attribute (as per RFC-0035). The Nixpkgs manual entry is clear about this, but I though only name is present, and I missed the p so it took a while to track it down...

Additional context
The error message is coming from derivation but I understand that this should be handled probably in pkgs/stdenv/generic/make-derivation.nix.

Metadata

  • system: "x86_64-linux"
  • host os: Linux 5.4.89, NixOS, 20.09.2624.1eff582e7ea (Nightingale)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.3.10
  • channels(root): "nixos-20.09.2624.1eff582e7ea"
  • channels(toraritte): "nixos-20.09.3009.8e78c2cfbae"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: `mkDerivation` (?)
# a list of nixos modules affected by the problem
module: `stdenv`
@stale
Copy link

stale bot commented Aug 17, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 17, 2021
@syvb
Copy link
Member

syvb commented Nov 25, 2021

@Stale still relevant to me

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 25, 2021
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 19, 2022
@Skallwar
Copy link
Contributor

I encountered the same error today

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 31, 2023
@luisnquin
Copy link
Member

Same here

@Ashvith10
Copy link
Contributor

This issue still persists.

@bramtechs
Copy link

Can confirm it is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants