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

Swap the order of directories in --dir #7301

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

alexcrichton
Copy link
Member

This commit changes the --dir argument on the wasmtime CLI to be HOST::GUEST rather than GUEST::HOST. This matches Docker for example and is a little more consistent with only --dir path where the first argument is always treated as a host directory.

In terms of breaking-ness the movement from --mapdir to --dir hasn't been released with Wasmtime 14 yet so my hope is that this can land on both main and Wasmtime 14.0.0 before it's released to avoid any breakage other than existing scripts migrating from --mapdir to --dir.

This commit changes the `--dir` argument on the `wasmtime` CLI to be
`HOST::GUEST` rather than `GUEST::HOST`. This matches Docker for example
and is a little more consistent with only `--dir path` where the first
argument is always treated as a host directory.

In terms of breaking-ness the movement from `--mapdir` to `--dir` hasn't
been released with Wasmtime 14 yet so my hope is that this can land on
both `main` and Wasmtime 14.0.0 before it's released to avoid any
breakage other than existing scripts migrating from `--mapdir` to
`--dir`.
@alexcrichton alexcrichton requested review from a team as code owners October 19, 2023 22:41
@alexcrichton alexcrichton requested review from fitzgen and removed request for a team October 19, 2023 22:41
@github-actions github-actions bot added the wasmtime:docs Issues related to Wasmtime's documentation label Oct 19, 2023
@sunfishcode
Copy link
Member

Matching docker makes sense to me too. As a historical note, the original syntax here wasn't something anyone thought about deeply, it was just something simple to get basic use cases working, that ended up sticking around.

@jeffparsons
Copy link
Contributor

Is there a way this arg could be extended in future (in a backward-compatible way) to support an optional verbose form? E.g. --dir host=a;guest=b, or even --dir host=a guest=b, where you can put host and guest in whatever order you want?

I'm trying to think through how the delimiters/escaping would work, and I realised I don't understand how it works today — e.g. what happens if your path contains ::. Is the answer "don't have silly paths"? 😅

I ask this because these kinds of order-dependent syntaxes (Docker volume mounts, SSH port forwarding, etc.) have caused me seemingly endless confusion and suffering, and I'm not sure if I'm uniquely vulnerable to them or if this is something that lots of other people would like to be able to avoid as well.

Merged via the queue into bytecodealliance:main with commit 183cb0f Oct 20, 2023
18 checks passed
@alexcrichton alexcrichton deleted the swap-dir-args branch October 20, 2023 00:04
@alexcrichton
Copy link
Member Author

I personally agree with @jeffparsons, although it's a bit too late for Wasmtime 14/15 to change the syntax here that much. This at least makes things "no worse" on the understandability front hopefully.

I've opened #7309 to continue discussion here now that this is merged, since I think there are still improvements to be had!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasmtime:docs Issues related to Wasmtime's documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants