pkgxdev / pkgx

the last thing you’ll install
https://pkgx.sh
Apache License 2.0
8.81k stars 1.36k forks source link

error message for platform not available is misleading #975

Open YellowApple opened 4 months ago

YellowApple commented 4 months ago

When running pkgx ollama (on Ubuntu 23.10 x86-64):

× unexpected error invalid version: 
│ Error: invalid version: 
│     at https://deno.land/x/libpkgx@v0.17.0/src/utils/semver.ts:44:17
│     at Array.flatMap (<anonymous>)
│     at new SemVer (https://deno.land/x/libpkgx@v0.17.0/src/utils/semver.ts:25:31)
│     at https://deno.land/x/libpkgx@v0.17.0/src/hooks/useInventory.ts:24:55
│     at Array.map (<anonymous>)
│     at Object.get (https://deno.land/x/libpkgx@v0.17.0/src/hooks/useInventory.ts:24:46)
│     at eventLoopTick (ext:core/01_core.js:182:7)
│     at async Object.select (https://deno.land/x/libpkgx@v0.17.0/src/hooks/useInventory.ts:7:20)
│     at async Promise.all (index 0)
│     at async resolve (https://deno.land/x/libpkgx@v0.17.0/src/plumbing/resolve.ts:55:3)
╰─➤ https://github.com/pkgxdev/pkgx/issues/new
mxcl commented 4 months ago

worksforme, does this happen every time? It's possible there was an API error. If so then I'll improve the error.

Screenshot 2024-02-19 at 12 48 42 PM

YellowApple commented 4 months ago

Happens every time for me, yeah. First tried it last week, and tried it again today. Other packages work fine (tested pkgx julia and pkgx zig zen, both of which work as expected); it's just ollama that's giving me trouble.

mxcl commented 4 months ago

I don't think this is likely something fixed, but please check your pkgx is the latest version.

After that try getting rid of the http cache: rm -rf ~/.cache/pkgx or XDG_ equivalent. If that fixes it then we have a cache bug.

jhheider commented 4 months ago
platforms:
  - darwin # Available for macOS Windows & Linux support coming soon. <= from https://ollama.ai/

if it works on linux, we need to remove this and get it built.

YellowApple commented 4 months ago

I don't think this is likely something fixed, but please check your pkgx is the latest version.

pkgx --version reports pkgx 1.1.6 (latest AFAICT).

After that try getting rid of the http cache: rm -rf ~/.cache/pkgx or XDG_ equivalent. If that fixes it then we have a cache bug.

Same behavior after running rm -rf ~/.cache/pkgx && pkgx ollama. Also tried rm -rf ~/.cache/pkgx && pkgx --sync && pkgx ollama for good measure, to no avail.

if it works on linux, we need to remove this and get it built.

Ah, then that'd explain it. Yes, it does indeed work on Linux (and I was able to install it manually on this machine, i.e. outside of pkgx). There's allegedly a preview version for Windows nowadays as well (but I haven't tested it).

Is it as simple as removing the platforms: key entirely? Or adding linux to the list? I'd be happy to kick off the PR either way :)

jhheider commented 4 months ago

removing the platforms key, assuming that builds cleanly. it might need tweaks, but we won't know until we try. ;)

YellowApple commented 4 months ago

Seems to build cleanly, but ollama serve and ollama create mario -f ./Modelfile throw segfaults in CI (only for *nix64; *nix-ARM64 seems to be okay).

jhheider commented 4 months ago

yeah, go required a -buildmode=pie flag. just wrestling with platform-specific testing foibles now.

YellowApple commented 4 months ago

Yeah, I think pkill is matching on the test runner; using pkill -x instead should behave more like killall. Hopefully that's the last piece to get the tests passing (we'll find out in a few minutes; fingers crossed :crossed_fingers: ).

(Though I'm surprised that killall ain't available; is that not a standard Linux command?)

mxcl commented 4 months ago

ugh, I'm sorry. That I should have checked for rather than have you jump through hoops.

I will reopen to improve the error message.