From: ludo@gnu.org (Ludovic Courtès)
To: Eelco Dolstra <eelco.dolstra@logicblox.com>
Cc: guix-devel@gnu.org, nix-dev <nix-dev@cs.uu.nl>
Subject: Re: [PATCH Nix] Flush substituter output upon ‘\r’
Date: Tue, 24 Jun 2014 18:08:25 +0200 [thread overview]
Message-ID: <871tue1e9y.fsf@gnu.org> (raw)
In-Reply-To: <53A98315.1000800@logicblox.com> (Eelco Dolstra's message of "Tue, 24 Jun 2014 15:54:29 +0200")
[-- Attachment #1: Type: text/plain, Size: 864 bytes --]
Hi,
Please use reply-to-all.
Eelco Dolstra <eelco.dolstra@logicblox.com> skribis:
> On 17/06/14 17:50, Ludovic Courtès wrote:
>
>> The patch below changes the store so that it flushes what it reads from
>> the substituter’s stderr when it encounters either a newline or a
>> carriage return.
>>
>> The intent is to allow substituters to provide some kind of progress
>> report, where the status is updated by means of a ‘\r’.
>
> What kind of progress report do you mean, and why wouldn't '\n' work for that?
Progress reports:
0%\r
1%\r
2%\r
>> As a side effect, this patch removes the “substituter-name: ” prefix on
>> the lines that are printed. It can be reinstated if deemed appropriate.
>
> Please do, without it there is no indication where the error came from.
Here it is.
Thanks,
Ludo’.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 838 bytes --]
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 1293a6e..079972c 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -1141,8 +1141,10 @@ string LocalStore::getLineFromSubstituter(RunningSubstituter & run)
if (n == 0) throw EndOfFile(format("substituter `%1%' died unexpectedly") % run.program);
err.append(buf, n);
string::size_type p;
- while ((p = err.find('\n')) != string::npos) {
- printMsg(lvlError, run.program + ": " + string(err, 0, p));
+ while (((p = err.find('\n')) != string::npos)
+ || ((p = err.find('\r')) != string::npos)) {
+ string thing(err, 0, p + 1);
+ writeToStderr(run.program + ": " + thing);
err = string(err, p + 1);
}
}
[-- Attachment #3: Type: text/plain, Size: 149 bytes --]
_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev
next prev parent reply other threads:[~2014-06-24 16:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-17 15:50 [PATCH Nix] Flush substituter output upon ‘\r’ Ludovic Courtès
[not found] ` <53A98315.1000800@logicblox.com>
2014-06-24 16:08 ` Ludovic Courtès [this message]
2014-12-10 9:58 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871tue1e9y.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=eelco.dolstra@logicblox.com \
--cc=guix-devel@gnu.org \
--cc=nix-dev@cs.uu.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.