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

[RFC] add Proc/Proc::Async arg quoting modifiers #1306

Closed
zoffixznet opened this Issue Dec 12, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@zoffixznet
Contributor

zoffixznet commented Dec 12, 2017

The Problem

We basically have nearly no core way to specify alternate argument quoting when calling other processes.

While we currently use libuv's method of quoting that works in most places, the most prominent place where that fails is with Windows batch files go through cmd.exe, which requires alternative quoting.

Since on Windows perl6 is itself a batch file, this issue causes RT#132258 as well as a ton of Windows roast failures.

Proposal

I propose we add an alternate quoting method that will be requested with :arg-quoting named parameter to &run and Proc::Async.new. That will have values:

  • (default) auto. This is the "best way", whatever we decide is best to use for the OS in question. At the moment, this will be what we currently do and use libuv's quoting
  • cmd.exe. This will quote the arguments as auto on non-Windows ($*DISTRO.is-win === False) OSes and on Windows they will be quoted to be suitable for acceptance by Window's cmd.exe

There's also room for an arg that will do heuristic approach of trying one way and then another if the first one results in failure (IIRC Perl 5 does this sort of thing).

The cmd.exe quoting (on MoarVM) will be done by our own routine, so as I imagine this RFC is for most of the work to be done in MoarVM and the arg to be simply passed into it.

@zoffixznet zoffixznet added the RFC label Dec 12, 2017

@zoffixznet

This comment has been minimized.

Contributor

zoffixznet commented Dec 12, 2017

Actually, looking at guts of Test::Util that roast uses, it's the shell() routine that fails.

I rather first make a module that quotes for cmd.exe and uses shell and see how it works out...

Never mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment