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

error: unexpected end-of-file #89

Closed
bbigras opened this issue Jun 19, 2021 · 6 comments
Closed

error: unexpected end-of-file #89

bbigras opened this issue Jun 19, 2021 · 6 comments

Comments

@bbigras
Copy link

bbigras commented Jun 19, 2021

It might have started to happen when I added ca-derivations ca-references to experimental-features. I'm already using nix-command flakes.

I have the same problem on my computer, but I'm only using flakes.

Run cachix/cachix-action@v10
Cachix: installing
  /usr/bin/bash -c nix-env --quiet -j8 -iA cachix -f https://cachix.org/api/v1/install
  error: unexpected end-of-file
  Error: Action failed with error: Error: The process '/usr/bin/bash' failed with exit code 1
@domenkozar
Copy link
Member

Hey @bbigras does it still happen?

@bbigras
Copy link
Author

bbigras commented Jun 20, 2021

Yes. On my computer and with github actions on 1 project:
https://github.com/bbigras/dendrite-demo-pinecone/runs/2869034346?check_suite_focus=true

Note that I don't have the problem on https://github.com/bbigras/nix-config/actions/runs/954487561 (I don't use ca-derivations ca-references for this one).

@bbigras
Copy link
Author

bbigras commented Jun 20, 2021

Also note that I can download and decompress https://cachix.org/api/v1/install just fine.

❯ curl https://cachix.org/api/v1/install > install
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10240  100 10240    0     0  74202      0 --:--:-- --:--:-- --:--:-- 74202

❯ tar xvf install
./
./default.nix

❯ sha256sum default.nix
0c5047f9857fb360c8ad9c61bac4eaef580a18983f3270cbf05ce50cf41fe093  default.nix

❯ nix-env --quiet -j8 -iA cachix -f default.nix
error: unexpected end-of-file

default.nix

{ system ? builtins.currentSystem
, onlyFromSource ? false
}:

let
  mkFakeDerivation = attrs: outputs:
    let
        outputNames = builtins.attrNames outputs;
        common = attrs // outputsSet //
            { type = "derivation";
            outputs = outputNames;
            # TODO: this has name/value pairs
            all = outputsList;
            };
        outputToAttrListElement = outputName:
            { name = outputName;
              value = common // {
                inherit outputName;
                outPath = builtins.storePath (builtins.getAttr outputName outputs);
                # TODO: we lie here so that Nix won't build it
                drvPath = builtins.storePath (builtins.getAttr outputName outputs);
              };
            };
        outputsList = map outputToAttrListElement outputNames;
        outputsSet = builtins.listToAttrs outputsList;
    in outputsSet;
  packages = {
    x86_64-linux.cachix = 
  (mkFakeDerivation 
    { name = "cachix-0.6.0";
      system = "x86_64-linux";
    }
    { out = "/nix/store/q0lqpbbxcn2y4f23nhms7ncj7gvwbid1-cachix-0.6.0";
    }).out;

  x86_64-darwin.cachix = 
  (mkFakeDerivation 
    { name = "cachix-0.6.0";
      system = "x86_64-darwin";
    }
    { out = "/nix/store/wdnz76l76pskfdlbbi74aqnaz0cmadi3-cachix-0.6.0";
    }).out;

  aarch64-linux.cachix = 
  (mkFakeDerivation 
    { name = "cachix-0.6.0";
      system = "aarch64-linux";
    }
    { out = "/nix/store/jh60c0caxfm6x3bl485kjss89ryk3rlz-cachix-0.6.0";
    }).out;

  };  
in if builtins.hasAttr system packages && (!onlyFromSource)
   then packages.${system}
   else import (fetchTarball "https://github.com/NixOS/nixpkgs/tarball/9ffd16b3850536094ca36bc31520bb15a6d5a9ef") { inherit system; }

@domenkozar
Copy link
Member

I'll look into this after lunch :)

@domenkozar
Copy link
Member

This could be related: NixOS/nix#4903

Note that content addressable derivations aren't supported yet: cachix/cachix#373

@domenkozar
Copy link
Member

Closing as it's a Nix issue: NixOS/nix#4977

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants