VanCoding / nix-prisma-utils

A nix library to make [prisma](https://www.prisma.io/) work in your nix shell
11 stars 3 forks source link

Fetching Prisma Binary Fails due to an extra ' in the URL #5

Open wxyangf opened 1 month ago

wxyangf commented 1 month ago

I'm trying to get a local dev enviroment for rx-resume which uses pnpm and when i run the flake with

nix shell .#devShells.x86_64-linux.default

I get this error message

error: builder for '/nix/store/rap6s8g8yqqsaamyjmi74zy5nz1yqviy-https-binaries.prisma.sh-all_commits-b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b-debian-openssl-3.0.x-query-engine.gz.drv' failed with exit code 1;
       last 7 log lines:
       >
       > trying https://binaries.prisma.sh/all_commits/b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b'/debian-openssl-3.0.x/query-engine.gz
       >   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
       >                                  Dload  Upload   Total   Spent    Left  Speed
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 404
       > error: cannot download https-binaries.prisma.sh-all_commits-b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b-debian-openssl-3.0.x-query-engine.gz from any mirror
       For full logs, run 'nix log /nix/store/rap6s8g8yqqsaamyjmi74zy5nz1yqviy-https-binaries.prisma.sh-all_commits-b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b-debian-openssl-3.0.x-query-engine.gz.drv'.
error: 1 dependencies of derivation '/nix/store/mi5gr0i0hmsv8smxs1g9xdp3j68zcqx4-prisma-bin-b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b-.drv' failed to build
error: 1 dependencies of derivation '/nix/store/62ciw4fhaclka49b8zka2bbsp5hhyx3d-nix-shell.drv' failed to build

here's the pnpm-lock.yml https://github.com/AmruthPillai/Reactive-Resume/blob/main/pnpm-lock.yaml

It seems when parsing out the prisma version it's getting an extra ' character appended to the commit hash.

I'm new to nixos so sorry if I'm missing anything obvious :P

Thanks in advance for looking at this.

VanCoding commented 1 month ago

@wxyangf Thanks for reporting this. It seems PNPM has a new Lockfile-Version 9, which stores the prisma version a bit differently from the previous version 6 that was used until PNPM 8.x. I'll have to add support for the new version first, which should be pretty simple.

wxyangf commented 1 month ago

https://github.com/pnpm/spec/issues/6 It's unfortunate that they haven't gotten around to writing the official spec page for it yet. I'll do some more research to try to discover if there's some well documented example files to test against at least.

VanCoding commented 1 month ago

@wxyangf I don't think an official spec is necessary, it should be pretty simple to make a fix for PNPM 9. I'm not in a hurry with it, though, since PNPM9 seems not to be in nixpkgs yet. There's already an issue for this, though: https://github.com/NixOS/nixpkgs/issues/312134

wxyangf commented 1 month ago

made a patch here, but only tested against lockfile v9 so far, will make a proper PR once i fully test

https://github.com/wxyangf/nix-prisma-utils/tree/pnpm9

VanCoding commented 1 week ago

@wxyangf I've made an update to support PNPM 9 Lockfiles. Can you check if it works for you? Thanks :)