Bug 98494 - libphobos: std.process Config.stderrPassThrough missing
Summary: libphobos: std.process Config.stderrPassThrough missing
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: d (show other bugs)
Version: 10.2.1
: P3 normal
Target Milestone: ---
Assignee: Iain Buclaw
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-01 03:07 UTC by Witold Baryluk
Modified: 2021-04-19 17:59 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Witold Baryluk 2021-01-01 03:07:26 UTC
It appears that gdc version of libphobos is somehow lagging in some aspects behind upstream.

One of the things I see missing, is `Config.stderrPassThrough` in std.process. I see it was added upstream about 12 months ago:

enum Config {
...
    /**
    By default, the $(LREF execute) and $(LREF executeShell) functions
    will capture child processes' both stdout and stderr. This can be
    undesirable if the standard output is to be processed or otherwise
    used by the invoking program, as `execute`'s result would then
    contain a mix of output and warning/error messages.

    Specify this flag when calling `execute` or `executeShell` to
    cause invoked processes' stderr stream to be sent to $(REF stderr,
    std,stdio), and only capture and return standard output.

    This flag has no effect on $(LREF spawnProcess) or $(LREF spawnShell).
    */
    stderrPassThrough = 128,
}

The implementation usage of this is relatively small and easy to backport:

in executeImpl:

-    auto p = pipeFunc(commandLine, Redirect.stdout | Redirect.stderrToStdout,
-                      env, config, workDir, extraArgs);
+    auto redirect = (config & Config.stderrPassThrough)
+        ? Redirect.stdout
+        : Redirect.stdout | Redirect.stderrToStdout;
+
+    auto p = pipeFunc(commandLine, redirect,
+                      env, config, workDir, extraArgs);



There are some other minor changes there, but nothing functionally significant. Mostly unittests and minor signature changes (adding `scope` to many input parameters).

Thank you.
Comment 1 GCC Commits 2021-04-19 17:29:07 UTC
The master branch has been updated by Iain Buclaw <ibuclaw@gcc.gnu.org>:

https://gcc.gnu.org/g:e19c6389966216af5925d2917a206cedc40540e8

commit r11-8249-ge19c6389966216af5925d2917a206cedc40540e8
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Mon Apr 19 13:51:02 2021 +0200

    libphobos: Merge upstream druntime 89f870b7, phobos e6907ff3e
    
    Phobos changes:
    
     - Synchronize C bindings with the latest port fixes in upstream
       druntime.
    
     - Add Config.stderrPassThrough to std.process (PR98494).
    
    Reviewed-on: https://github.com/dlang/druntime/pull/3448
                 https://github.com/dlang/phobos/pull/7984
    
    libphobos/ChangeLog:
    
            PR d/98494
            * libdruntime/MERGE: Merge upstream druntime 89f870b7.
            * src/MERGE: Merge upstream phobos e6907ff3e.
Comment 2 Iain Buclaw 2021-04-19 17:59:54 UTC
Added to phobos.