OpenFn / kit

The bits & pieces that make OpenFn work. (diagrammer, cli, compiler, runtime, runtime manager, logger, etc.)
8 stars 12 forks source link

Is asdf breaking openfnx? #650

Open josephjclark opened 3 months ago

josephjclark commented 3 months ago

If you run pnpm install:openfnx inside kit (and where else would you run it?) it'll install openfnx to the asdf context (version shim) associated with that folder.

If you then step out of kit and run openfnx, you MIGHT be calling the bin from a different asdf context, ifyou've got a global version set or a tool-versions or something.

Even worse, it might be that the different builds are reporting the same branch names. Certainly the output I just saw in mtuchi's log looked good. This is what he saw in his water-aid repo:

  water-aid git:(main) ✗ openfnx version
[CLI] ♦ Versions:
         ▸ node.js     18.12.1
         ▸ cli         branch/cli-cache
         ▸ runtime     ./openfn-runtime-1.1.1-local.tgz
         ▸ compiler    ./openfn-compiler-0.1.1-local.tgz

It looks fine! And yet behaved wrongly. I note that its using node 18.12 there, which is actually the same as what kit uses.

So I don't know. Maybe this is nothing. I need to do a few tests on my own machine and try to work this out.

I would like to ensure that install:openfnx registers the openfnx bin to some global place outside of asdf's reach. I want only one openfnx on the system. That may be impossible - the face is that asdf and any version manager is basically going to override whatever local config I set in kit. That's kind of the point.

josephjclark commented 2 months ago

Troubleshooting: installing openfnx from kit will install to whatever node version kit is set to (18 at the time of writing).

If you run openfnx from a different dir (and of course you will), it'll look in the global npm install for that local version. If it matches kit you're all good, if you've set the global or local verison differently, openfnx won't be available.

Possible solutions:

The idea of different openfnx verisons sitting in different node installs is frankly a bit scary.

Also how does any of this work in windows?

josephjclark commented 1 month ago

I am pretty sure that this is just that asdf has several global node versions and openfnx just installs to one of them. Dirs with different asdf contexts will use a different globals folder and may not find openfnx (or worse, the wrong one)

What we want is to somehow "breakout" the openfnx command so that it is not tracked by asdf. I want to use a global build of the openfnx bin against whatever node version is set in the working dir.