fermyon / spin

Spin is the open source developer tool for building and running serverless applications powered by WebAssembly.
https://developer.fermyon.com/spin
Apache License 2.0
5.25k stars 249 forks source link

Unshackle Spin from Clap 3 #2885

Open rylev opened 3 weeks ago

rylev commented 3 weeks ago

We've had two failed attempts at updating our dependency on Clap from version 3 to version 4:

The issue is a breaking change from clap 3 to 4 which does not have a known work around. Clap 4 doesn't lazily evaluate args like Clap 3 did, and once it discovers an arg that can only go into the trigger_args bucket of otherwise unknown args, it starts slurping up everything else and putting it into trigger_args.

This means the following used to work but no longer does:

spin up --some-arg-meant-for-the-trigger --env "foo=bar"

This does not work because as soon as --some-arg-meant-for-the-trigger is seen, everything gets lumped into trigger_args. If --env is put first, than things work as expected.

itowlson commented 3 weeks ago

More related links:

lann commented 3 weeks ago

I was having a think about this and wondered to myself "how did this ever work in Clap 3?" Well reader, it doesn't:

$ spin up --listen --direct-mounts localhost:9876
...
Serving http://127.0.0.1:9876
lann commented 3 weeks ago

Some options: