Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Package build broken when using flakes #253

Open
emilazy opened this issue Jun 29, 2021 · 2 comments
Open

Package build broken when using flakes #253

emilazy opened this issue Jun 29, 2021 · 2 comments
Labels
bug Something isn't working needs triage

Comments

@emilazy
Copy link
Contributor

emilazy commented Jun 29, 2021

I'm not sure whether this is an issue with nixpkgs-fmt or an upstream https://github.com/nix-community/fenix issue, but since I don't understand it I figured I'd report here and let people who have actually used fenix figure out what's up :)

I'm also not sure whether this is Darwin-specific or not.

emily@yuyuko ~/nixpkgs-fmt-test> cat flake.nix
{
  inputs.nixpkgs-fmt.url = "github:nix-community/nixpkgs-fmt";
  # work around https://github.com/NixOS/nix/pull/4641
  inputs.naersk.url = "github:nmattia/naersk";

  outputs = { self, nixpkgs, nixpkgs-fmt, naersk }: {
    devShell."x86_64-darwin" = nixpkgs.legacyPackages."x86_64-darwin".mkShell {
      buildInputs = [ nixpkgs-fmt.defaultPackage."x86_64-darwin" ];
    };
  };
}
emily@yuyuko ~/nixpkgs-fmt-test> nix develop
error: in pure evaluation mode, 'fetchTarball' requires a 'sha256' argument

       … while evaluating the file '/nix/store/d28xpy5rjhvy20p0dfdbvl68way34yg0-source/packages.nix':

       … while evaluating anonymous lambda

       at /nix/store/d28xpy5rjhvy20p0dfdbvl68way34yg0-source/default.nix:1:27:

            1| import ./lib/overlay.nix (_: import ./packages.nix)
             |                           ^

       … from call site

       at /nix/store/d28xpy5rjhvy20p0dfdbvl68way34yg0-source/lib/overlay.nix:2:13:

            1| f: _: super:
            2| let fenix = f super;
             |             ^
            3| in {

       … while evaluating the attribute 'fenix'

       at /nix/store/d28xpy5rjhvy20p0dfdbvl68way34yg0-source/lib/overlay.nix:4:10:

            3| in {
            4|   inherit fenix;
             |          ^
            5|   rust-analyzer-nightly = fenix.rust-analyzer;

       … while evaluating the attribute 'RUSTC' of the derivation 'nixpkgs-fmt-1.2.0'

       at /nix/store/pkdq86iai1j0azkvhya33ldj0bvjqp9z-source/pkgs/stdenv/generic/make-derivation.nix:201:11:

          200|         // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          201|           name =
             |           ^
          202|             let

       … while evaluating the attribute 'buildInputs' of the derivation 'nix-shell'

       at /nix/store/y0s7h01713aa0zm22xw4xq3dl7ajjx4j-source/pkgs/stdenv/generic/make-derivation.nix:201:11:

          200|         // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          201|           name =
             |           ^
          202|             let

@emilazy emilazy added bug Something isn't working needs triage labels Jun 29, 2021
@zimbatm
Copy link
Member

zimbatm commented Jul 1, 2021

thanks for the report, I need to fix this. The last released version of the project should still be working fine if you are looking for a working version in the meantime.

@tnytown
Copy link

tnytown commented Aug 27, 2021

Ran into this issue while trying to poking at #257. I think (?) this is a fenix issue, tracing the error leads me here.
Evidently, flake-compat isn't fetched with a hash, so flake evaluation fails. nix-community/fenix#28 should fix it, as it eliminates that problematic usage of fetchTarball.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

3 participants