bytecodealliance/wac

When using `wac` as a library, it interacts

Closed this issue ยท 7 comments

I am using wac (specifically, the wac_resolver crate) as a library in another program. As part of this, I call RegistryPackageResolver::resolve(). I am using the wa.dev registry for dev-test purposes, and when I try to resolve a package for the first time I get this:

? Package `fermyon:spin` is not in `warg.wa.dev` registry.
Registry recommends using `fermyon.wa.dev` registry for packages in `fermyon` namespace.
Accept recommendation y/N

These prompts come from warg_client, and I'd like to be able to opt out of them, e.g. in CI scenarios.

It seems like warg_client has a cli-interactive feature, which is on by default. Would it be possible for wac to surface a similar feature? (I'm happy to send a PR for this if you're open to it.)

Hmm, although it looks like Warg's behaviour if not allowed to interact might be to fail so whee.

This has to do with federation and explicitly accepting registry mappings. The behavior can be changed with configuration.

You can use the command to configure to always auto accept and not prompt :
warg config --auto-accept-federation-hints

We should be simplifying this behavior in the refactor to use wkg.

Let me know if this resolves the issue for you.

Thanks @calvinrp. I don't really want to rely on users installing and configuring warg - but if wkg is going to solve this then that's cool, I probably need to wait for wac to adopt wkg before I can ship my feature anyway! Closing!

We are getting closer on wkg updates. But I wanted to understand the change here that will help.

To confirm, you'd like wac configurable so that it doesn't ask for user input while running in a CI/CD process?

@calvinrp My specific context is that I am using wac_resolver as a library and I want my program to (have the option to) not interact. So yes to being able to configure the wac crates, and no opinion on the wac CLI tool. Hopefully that clarifies - I'm happy to go into more detail if that would be useful. Thanks!

@itowlson release 0.6.0 should fix, can you confirm?

That seems to be working fine. Thank you @calvinrp!