nekowinston / nix-deno

😳 Nix + Deno?
MIT License
15 stars 5 forks source link

Unable to build a binary #17

Open Piecuuu opened 6 hours ago

Piecuuu commented 6 hours ago

I'm unable to build a deno binary, due to some dependency error? Error message:

error: builder for '/nix/store/1dbmg0n7qyb95q107xa4yh5sg32kaf53-denobot.drv' failed with exit code 1;
       last 25 log lines:
       > Download https://registry.npmjs.org/magic-bytes.js
       > Download https://registry.npmjs.org/minimatch
       > Download https://registry.npmjs.org/minipass
       > Download https://registry.npmjs.org/package-json-from-dist
       > Download https://registry.npmjs.org/path-scurry
       > Download https://registry.npmjs.org/path-key
       > Download https://registry.npmjs.org/prisma
       > Download https://registry.npmjs.org/shebang-command
       > Download https://registry.npmjs.org/signal-exit
       > Download https://registry.npmjs.org/shebang-regex
       > Download https://registry.npmjs.org/string-width
       > Download https://registry.npmjs.org/ts-mixer
       > Download https://registry.npmjs.org/strip-ansi
       > Download https://registry.npmjs.org/tslib
       > Download https://registry.npmjs.org/tsyringe
       > Download https://registry.npmjs.org/typedi
       > Download https://registry.npmjs.org/undici-types
       > Download https://registry.npmjs.org/which
       > Download https://registry.npmjs.org/undici
       > Download https://registry.npmjs.org/wrap-ansi
       > Download https://registry.npmjs.org/ws
       > error: failed reading lockfile '/build/i1bdxmvn9jic4myxvrfvcc840006krfh-source/deno.lock'
       >
       > Caused by:
       >     Error getting response at https://registry.npmjs.org/@discordjs/builders for package "@discordjs/builders": error sending request for url (https://registry.npmjs.org/@discordjs/builders): client error (Connect): dns error: failed to lookup address information: Temporary failure in name resolution: failed to lookup address information: Temporary failure in name resolution
       For full logs, run 'nix log /nix/store/1dbmg0n7qyb95q107xa4yh5sg32kaf53-denobot.drv'.

flake.nix (also fails with the example flake):

{
  description = "A very basic flake";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
    prisma-utils.url = "github:VanCoding/nix-prisma-utils";
    flake-utils.url = "github:numtide/flake-utils";
    nix-deno.url = "github:nekowinston/nix-deno";
  };

  outputs = { self, nixpkgs, flake-utils, ... }@inputs: 
    flake-utils.lib.eachDefaultSystem (system: let
      pkgs = import nixpkgs {
        inherit system;
        overlays = [ inputs.nix-deno.overlays.default ];
      };
    prisma = (
      (inputs.prisma-utils.lib.prisma-factory {
        inherit pkgs;
        prisma-fmt-hash = "sha256-4zsJv0PW8FkGfiiv/9g0y5xWNjmRWD8Q2l2blSSBY3s="; # just copy these hashes for now, and then change them when nix complains about the mismatch
        query-engine-hash = "sha256-6ILWB6ZmK4ac6SgAtqCkZKHbQANmcqpWO92U8CfkFzw=";
        libquery-engine-hash = "sha256-n9IimBruqpDJStlEbCJ8nsk8L9dDW95ug+gz9DHS1Lc=";
        schema-engine-hash = "sha256-j38xSXOBwAjIdIpbSTkFJijby6OGWCoAx+xZyms/34Q=";
      }).fromCommit
        "bf0e5e8a04cada8225617067eaa03d041e2bba36"
    );
    in
    {
      devShells.x86_64-linux.default = pkgs.mkShell { shellHook = prisma.shellHook; };
      packages.denobot = pkgs.denoPlatform.mkDenoBinary {
        name = "denobot";
        version = "0.0.1";
        src = ./.;
        buildInputs = [ ];
        permissions.allow.all = true;
      };
      defaultPackage = self.packages.${system}.denobot;
    }
  );
}

deno.json:

{
  "tasks": {
    "dev": "deno run --watch main.ts"
  },
  "imports": {
    "@discordx/importer": "npm:@discordx/importer@^1.3.1",
    "@prisma/client": "npm:@prisma/client@^5.21.1",
    "discord.js": "npm:discord.js@^14.16.3",
    "discordx": "npm:discordx@^11.12.1",
    "prisma": "npm:prisma@^5.21.1"
  },
  "fmt": {
    "useTabs": false,
    "lineWidth": 80,
    "indentWidth": 2,
    "semiColons": true,
    "singleQuote": false,
    "proseWrap": "preserve",
    "include": ["src/"],
    "exclude": []
  }
}
nekowinston commented 6 hours ago

did you populate deno.lock and check it into VCS before? or is /build/i1bdxmvn9jic4myxvrfvcc840006krfh-source some dependency that your lockfile tries to pull in?

Piecuuu commented 6 hours ago

did you populate deno.lock and check it into VCS before?

I don't have any VCS' in this project.

nekowinston commented 6 hours ago

Right - that's not a dependency but just making sure its not missing in the git stage area, since that's a common gotcha with Nix.

Piecuuu commented 6 hours ago

It just..... magically disappeared now......????