instantiated: expose stderr output

This commit is contained in:
2025-07-14 04:34:53 +09:00
parent 826860697d
commit beff1e98d8
2 changed files with 11 additions and 4 deletions

View File

@@ -11,10 +11,6 @@ import (
"strings"
)
var (
Stdout io.Writer = nil
)
const (
instantiatedPrefix = "instantiated '"
instantiatedSeparator = " -> "
@@ -74,6 +70,9 @@ func DecodeInstantiated(stderr io.Reader) ([]string, error) {
v := scanner.Text()
if !strings.HasPrefix(v, instantiatedPrefix) {
if Stderr != nil {
_, _ = Stderr.Write([]byte(v + "\n"))
}
continue
}
f := strings.SplitN(v, instantiatedSeparator, instantiatedFields)

8
io.go Normal file
View File

@@ -0,0 +1,8 @@
package nixbuild
import "io"
var (
Stdout io.Writer = nil
Stderr io.Writer = nil
)