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

🔨 Populate the guest cli args #393

Merged
merged 5 commits into from
Jun 26, 2024
Merged

🔨 Populate the guest cli args #393

merged 5 commits into from
Jun 26, 2024

Conversation

elliottt
Copy link
Contributor

Populate the guest cli args with the single value "compute-app". This should simplify adoption for languages that assume the args list is non-empty.

Fixes #376

jameysharp
jameysharp previously approved these changes Jun 26, 2024
Copy link
Contributor

@jameysharp jameysharp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I like that this makes viceroy serve closer to viceroy run, which uses the stem of the .wasm filename as the program name.

let mut store = create_store(&self, session, profiler, |_| {})
.map_err(ExecutionError::Context)?;
let mut store = create_store(&self, session, profiler, |ctx| {
ctx.arg("compute-app");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you also want to add this for the ComponentCtx::create_store case as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added this for components and enabled testing for it, but the adapter will need some changes to get the test passing. I'll put that on my TODO list for component parity, but don't think the adapter changes should block this PR.

@elliottt elliottt force-pushed the trevor/guest-args branch 2 times, most recently from 33c87ad to 7a8e4f3 Compare June 26, 2024 21:46
@elliottt elliottt changed the title Populate the guest cli args 🔨 Populate the guest cli args Jun 26, 2024
@elliottt elliottt requested a review from jameysharp June 26, 2024 22:10
@elliottt elliottt enabled auto-merge (squash) June 26, 2024 22:11
@elliottt elliottt merged commit c75ee9d into main Jun 26, 2024
7 checks passed
@elliottt elliottt deleted the trevor/guest-args branch June 26, 2024 22:13
GeeWee pushed a commit to GeeWee/Viceroy that referenced this pull request Jul 25, 2024
Populate the guest cli args with the single value "compute-app". This should simplify adoption for languages
that assume the args list is non-empty.

Fixes fastly#376
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Golang programs that import flag or httptest will panic due to uninitialized os.Args
2 participants