Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasmer run shows wrong message when a program path is not found #3404

Closed
syrusakbary opened this issue Dec 3, 2022 · 4 comments · Fixed by #3416
Closed

wasmer run shows wrong message when a program path is not found #3404

syrusakbary opened this issue Dec 3, 2022 · 4 comments · Fixed by #3416
Assignees
Labels
bug Something isn't working
Milestone

Comments

@syrusakbary
Copy link
Member

syrusakbary commented Dec 3, 2022

Wasmer run can't run absolute paths:

$ wasmer run /Users/syrusakbary/Development/abc/x/../program.wasm
error: Package abc/program.wasm not found in registries ["users"].

Errors:
  https:///Users/syrusakbary/Development/abc/program/x/../wapm/graphql: error sending query: Error sending GetPackagesQuery: error sending request for url (https://users/syrusakbary/Development/abc/x/../program)
@syrusakbary syrusakbary added the bug Something isn't working label Dec 3, 2022
@fschutt
Copy link
Contributor

fschutt commented Dec 3, 2022

Can't reproduce:

wasmer run /Users/fs/Development/wasmer/lib/c-api/examples/assets/../assets/qjs.wasm
QuickJS - Type "\h" for help
qjs > ^C

What does wasmer -vV say? Are you still on 3.0.1?

wasmer 3.0.2 (5287c 2022-11-27)
binary: wasmer-cli
commit-hash: 5287c4f1253f66f428066d35eef0825fe827cff3
commit-date: 2022-11-27
host: aarch64-apple-darwin
compiler: singlepass,cranelift

@syrusakbary
Copy link
Member Author

syrusakbary commented Dec 4, 2022

More information. I debugged more. The issue is not on the absolute paths.
The path provided was actually not existing, but the CLI returns something very cryptic in response.

$wasmer run ../asdfasdf
error: Package ../asdfasdf not found in registries ["registry.wapm.dev"].

Errors:

  https://registry.wapm.dev/graphql: error sending query: Invalid response for crate "../asdfasdf": no package version: ResponseData {
    package_version: None,
}

The ../asdfasdf is not an url-like thing. Basically its a simple path. I got super confused with the message.

Why is the CLI assuming this is an URL? Only proper names (PACKAGE | NAMESPACE/PACKAGE | PACKAGE@VERSION | NAMESPACE/PACKAGE@VERSION) should go "through the registry" (not even urls).

@syrusakbary syrusakbary changed the title wasmer run can't run absolute paths wasmer run shows wrong message when a program path is not found Dec 4, 2022
@fschutt
Copy link
Contributor

fschutt commented Dec 4, 2022

@syrusakbary ah okay, yeah if the path does not exist, it thinks it's a URL (since we allow something like wapm.io/namespace/package

@syrusakbary
Copy link
Member Author

syrusakbary commented Dec 4, 2022

since we allow something like wapm.io/namespace/package

wapm.io/namespace/package is not a url, we should not support this: wasmer run wapm.io/namespace/package.
A url is https://wapm.io/namespace/package, we should support wasmer run https://wapm.io/namespace/package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants