pkgx icon indicating copy to clipboard operation
pkgx copied to clipboard

error message for platform not available is misleading

Open YellowApple opened this issue 1 year ago • 10 comments

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

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

YellowApple avatar Feb 19 '24 17:02 YellowApple

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

mxcl avatar Feb 19 '24 17:02 mxcl

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.

YellowApple avatar Feb 19 '24 22:02 YellowApple

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.

mxcl avatar Feb 19 '24 22:02 mxcl

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.

jhheider avatar Feb 19 '24 22:02 jhheider

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 :)

YellowApple avatar Feb 19 '24 22:02 YellowApple

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

jhheider avatar Feb 19 '24 22:02 jhheider

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).

YellowApple avatar Feb 19 '24 23:02 YellowApple

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

jhheider avatar Feb 19 '24 23:02 jhheider

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?)

YellowApple avatar Feb 20 '24 00:02 YellowApple

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.

mxcl avatar Feb 20 '24 13:02 mxcl