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

CLI: --env should allow variables that contain = #2028

Closed
artlogic opened this issue Jan 17, 2021 · 5 comments · Fixed by #2042
Closed

CLI: --env should allow variables that contain = #2028

artlogic opened this issue Jan 17, 2021 · 5 comments · Fixed by #2042
Labels
bug Something isn't working

Comments

@artlogic
Copy link

Describe the bug

When passing environment variables into wasmer run via the --env flag, the program will fail if the environment variable contains an =. It's sometimes useful or necessary to include an = in an environment variable. I believe this should be allowed.

Versions: wasmer 1.0.0 | | x86_64

Steps to reproduce

  • Run: wasmer run --env=MYVAR=1+2=3 test.wasm
  • Output: error: Invalid value for '--env <KEY=VALUE>...': Env vars must be of the form <var_name>=<value>. Found MYVAR=1+2=3

Expected behavior

The value should be allowed and parsed correctly.

Actual behavior

An error message is displayed and the program stops.

@artlogic artlogic added the bug Something isn't working label Jan 17, 2021
@MarkMcCaskey
Copy link
Contributor

Thanks for the report! I thought we had this issue and the past and fixed it... I'll look into it later, just to clarify the expected behavior here is that the variable is parsed as:

name = MYVAR
value = 1+2=3

is that correct?

@artlogic
Copy link
Author

That's perfect @MarkMcCaskey!

@Hywan
Copy link
Contributor

Hywan commented Jan 21, 2021

@MarkMcCaskey Are you refering to #1762?

@MarkMcCaskey
Copy link
Contributor

@MarkMcCaskey Are you refering to #1762?

Yeah, I think so. I knew someone worked on this in the past, unsure if it's since been broken (and we're not testing it?) or if something else happened.

@Hywan
Copy link
Contributor

Hywan commented Jan 22, 2021

This error comes from the cli crate itself. I'm fixing it.

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
Development

Successfully merging a pull request may close this issue.

3 participants