From 278cb43b65496512f337c929091b63f226068c95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zdyba=C5=82?= Date: Wed, 25 Apr 2018 13:33:34 +0200 Subject: [PATCH 1/2] problem: fatih/color: manually edited vendor files solution: temporary switch to forked branch with proposed PR with code that we require. After https://github.com/fatih/color/pull/87 is merged, we can switch to original repository. --- Gopkg.lock | 7 +++--- Gopkg.toml | 6 +++-- logger/glog/glog.go | 12 +++++----- vendor/github.com/fatih/color/Gopkg.lock | 27 --------------------- vendor/github.com/fatih/color/Gopkg.toml | 30 ------------------------ vendor/github.com/fatih/color/color.go | 4 +++- 6 files changed, 17 insertions(+), 69 deletions(-) delete mode 100644 vendor/github.com/fatih/color/Gopkg.lock delete mode 100644 vendor/github.com/fatih/color/Gopkg.toml diff --git a/Gopkg.lock b/Gopkg.lock index 568ad1e7d..a67c09bab 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -62,10 +62,11 @@ revision = "68bcac0a08ca8ed7d8f2ace4b4aca72176544770" [[projects]] + branch = "expose-colorised-stderr" name = "github.com/fatih/color" packages = ["."] - revision = "507f6050b8568533fb3f5504de8e5205fa62a114" - version = "v1.6.0" + revision = "fccafd9e876be44d0d7b380a3b03aeb661c1e231" + source = "github.com/achilleas-k/color" [[projects]] name = "github.com/gizak/termui" @@ -323,6 +324,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "2a159657f64d076ce0a2e9a184eda92d100ca9b1fa9dda0c003bdbd6079e3b26" + inputs-digest = "d90bcfb04efe9db8300a8faf7a1be7ee866ae66fcf289edf5e151954357b3cd1" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 2c4ba1e51..53263e328 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -118,5 +118,7 @@ name = "github.com/ethereumproject/benchmark" [[constraint]] - branch = "master" - name = "github.com/fatih/color" \ No newline at end of file + name = "github.com/fatih/color" + # TODO(tzdybal): monitor https://github.com/fatih/color/pull/87 + source = "github.com/achilleas-k/color" + branch = "expose-colorised-stderr" diff --git a/logger/glog/glog.go b/logger/glog/glog.go index 1cd34c1df..6d7869174 100644 --- a/logger/glog/glog.go +++ b/logger/glog/glog.go @@ -966,14 +966,14 @@ func (l *loggingT) output(s severity, buf *buffer, file string, line int, alsoTo } data := buf.Bytes() if l.toStderr { - color.StderrOutput.Write(data) + color.Error.Write(data) } else { if alsoToStderr || l.alsoToStderr || s >= l.stderrThreshold.get() { - color.StderrOutput.Write(data) + color.Error.Write(data) } if l.file[s] == nil { if err := l.createFiles(s); err != nil { - color.StderrOutput.Write(data) // Make sure the message appears somewhere. + color.Error.Write(data) // Make sure the message appears somewhere. l.exit(err) } } @@ -1003,7 +1003,7 @@ func (l *loggingT) output(s severity, buf *buffer, file string, line int, alsoTo // If -logtostderr has been specified, the loop below will do that anyway // as the first stack in the full dump. if !l.toStderr { - color.StderrOutput.Write(stacks(false)) + color.Error.Write(stacks(false)) } // Write the stack trace for all goroutines to the files. trace := stacks(true) @@ -1038,7 +1038,7 @@ func timeoutFlush(timeout time.Duration) { select { case <-done: case <-time.After(timeout): - fmt.Fprintln(color.StderrOutput, "glog: Flush took longer than", timeout) + fmt.Fprintln(color.Error, "glog: Flush took longer than", timeout) } } @@ -1071,7 +1071,7 @@ var logExitFunc func(error) // It flushes the logs and exits the program; there's no point in hanging around. // l.mu is held. func (l *loggingT) exit(err error) { - fmt.Fprintf(color.StderrOutput, "log: exiting because of error: %s\n", err) + fmt.Fprintf(color.Error, "log: exiting because of error: %s\n", err) // If logExitFunc is set, we do that instead of exiting. if logExitFunc != nil { logExitFunc(err) diff --git a/vendor/github.com/fatih/color/Gopkg.lock b/vendor/github.com/fatih/color/Gopkg.lock deleted file mode 100644 index 7d879e9ca..000000000 --- a/vendor/github.com/fatih/color/Gopkg.lock +++ /dev/null @@ -1,27 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - name = "github.com/mattn/go-colorable" - packages = ["."] - revision = "167de6bfdfba052fa6b2d3664c8f5272e23c9072" - version = "v0.0.9" - -[[projects]] - name = "github.com/mattn/go-isatty" - packages = ["."] - revision = "0360b2af4f38e8d38c7fce2a9f4e702702d73a39" - version = "v0.0.3" - -[[projects]] - branch = "master" - name = "golang.org/x/sys" - packages = ["unix"] - revision = "37707fdb30a5b38865cfb95e5aab41707daec7fd" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - inputs-digest = "e8a50671c3cb93ea935bf210b1cd20702876b9d9226129be581ef646d1565cdc" - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/vendor/github.com/fatih/color/Gopkg.toml b/vendor/github.com/fatih/color/Gopkg.toml deleted file mode 100644 index ff1617f71..000000000 --- a/vendor/github.com/fatih/color/Gopkg.toml +++ /dev/null @@ -1,30 +0,0 @@ - -# Gopkg.toml example -# -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. -# -# required = ["github.com/user/thing/cmd/thing"] -# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] -# -# [[constraint]] -# name = "github.com/user/project" -# version = "1.0.0" -# -# [[constraint]] -# name = "github.com/user/project2" -# branch = "dev" -# source = "github.com/myfork/project2" -# -# [[override]] -# name = "github.com/x/y" -# version = "2.4.0" - - -[[constraint]] - name = "github.com/mattn/go-colorable" - version = "0.0.9" - -[[constraint]] - name = "github.com/mattn/go-isatty" - version = "0.0.3" diff --git a/vendor/github.com/fatih/color/color.go b/vendor/github.com/fatih/color/color.go index e6998e92b..91c8e9f06 100644 --- a/vendor/github.com/fatih/color/color.go +++ b/vendor/github.com/fatih/color/color.go @@ -23,7 +23,9 @@ var ( // Output defines the standard output of the print functions. By default // os.Stdout is used. Output = colorable.NewColorableStdout() - StderrOutput = colorable.NewColorableStderr() + + // Error defines a color supporting writer for os.Stderr. + Error = colorable.NewColorableStderr() // colorsCache is used to reduce the count of created Color objects and // allows to reuse already created objects with required Attribute. From d0ec4d15749ceaf2c6718397df404c6350141ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zdyba=C5=82?= Date: Wed, 25 Apr 2018 14:19:57 +0200 Subject: [PATCH 2/2] problem: outdated sputnikvm-ffi version in Gopkg.lock --- Gopkg.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gopkg.lock b/Gopkg.lock index a67c09bab..0dfa4cc2b 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -59,7 +59,7 @@ branch = "master" name = "github.com/ethereumproject/sputnikvm-ffi" packages = ["go/sputnikvm"] - revision = "68bcac0a08ca8ed7d8f2ace4b4aca72176544770" + revision = "a6c914124a94151706443826c8124896ab1473bc" [[projects]] branch = "expose-colorised-stderr"