phobos
phobos copied to clipboard
std.process.browse should use internal functions for executing subprocess
schveiguy (@schveiguy) reported this on 2024-10-22T02:14:00Z
Transfered from https://issues.dlang.org/show_bug.cgi?id=24825
Description
The browse function predates std.process, and uses its own mechanisms to create a process. This resulted in at least one bug (issue 24824).
The internals should just call `spawnProcess` or whatever it takes to properly execute the browser process, instead of reimplementing most of it.
schveiguy (@schveiguy) commented on 2024-10-22T02:30:55Z
Note, this is a "reopening" of issue 6496. I think that was closed in error.
As noted in #10696, an implementation of this idea in Phobos v2 would have maintain its @nogc attribute for compatibility reasons. spawnProcess currently makes use of the GC.
Chances are this might be a better fit for Phobos v3.
As spawnProcess returns a class instance, the only option is to use private internal functions to do this. But likely those also are going to do some allocations.