Skip to content

Vm cannot run programs with % in name #41914

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

Open
sigurdm opened this issue May 15, 2020 · 4 comments
Open

Vm cannot run programs with % in name #41914

sigurdm opened this issue May 15, 2020 · 4 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. P4 type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@sigurdm
Copy link
Contributor

sigurdm commented May 15, 2020

To reproduce reate bin/ab%22.dart with a small program, and run dart bin/ab%22.dart

prints:

Error: Error when reading 'bin/ab%22.dart': No such file or directory

The same happens for snapshots.

My motivation is that I would like to url-encode the sdk-version into the name of a snapshot(for pub run) to avoid running a bad snapshot.

@natebosch
Copy link
Member

My motivation is that I would like to url-encode the sdk-version into the name of a snapshot(for pub run) to avoid running a bad snapshot.

I feel strongly that we should not be trying to hack around a bug in the SDK, pub is not the only place we use this pattern and we should not go rewrite them all to encode the SDK version in a file name. Have we filed an issue for not getting the correct exception on a bad snapshot?

@jakemac53
Copy link
Contributor

This still seems like a valid bug though right?

@natebosch
Copy link
Member

This still seems like a valid bug though right?

Yes.

@srawlins srawlins added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels May 15, 2020
@a-siva a-siva added the P4 label May 15, 2020
@sigurdm
Copy link
Contributor Author

sigurdm commented May 18, 2020

My motivation is that I would like to url-encode the sdk-version into the name of a snapshot(for pub run) to avoid running a bad snapshot.

I feel strongly that we should not be trying to hack around a bug in the SDK, pub is not the only place we use this pattern and we should not go rewrite them all to encode the SDK version in a file name. Have we filed an issue for not getting the correct exception on a bad snapshot?

We should not work around a bug - true. But I find that encoding the sdk version in the filename actually it is nicer for pub run for the following reasons:

  • We are moving to using a subprocess instead of an isolate for pub run (Use subprocess for "pub run" and allow vm options pub#2492). Meaning that there is no exception to catch, we would have to interpret stdout and exitcode, which we can never ensure are not overlapping with what the program itself would return. Alternatively the VM would have a mode that only detected validity of the snapshot. But then that would require one more subprocess call before starting the program.
  • We can have one snapshot per installed SDK without conflict - maybe not a common use-case, but when you are testing a program with different sdks it works nicely.

For other use-cases we do want the VM to throw a known exception on Isolate.spawnUri, and it would also be nice to have a way to test a snapshot's validity before running it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. P4 type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

5 participants