mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 12:31:07 +01:00
vmctl: fix build for solaris os (#2555)
* vmctl: fix build for solaris os * vmctl: updated dependency (using Syscall instead of Syscall6) * vmctl: updated dependency * vmctl: updated dependency
This commit is contained in:
parent
a7f18f8cb2
commit
c8af625bcc
@ -7,13 +7,12 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/cheggaaa/pb/v3"
|
||||
|
||||
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/config"
|
||||
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/datasource"
|
||||
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/remotewrite"
|
||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/logger"
|
||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal"
|
||||
"github.com/dmitryk-dk/pb/v3"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -3,7 +3,7 @@
|
||||
// altogether.
|
||||
package barpool
|
||||
|
||||
import "github.com/cheggaaa/pb/v3"
|
||||
import "github.com/dmitryk-dk/pb/v3"
|
||||
|
||||
var pool = pb.NewPool()
|
||||
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
|
||||
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmctl/opentsdb"
|
||||
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmctl/vm"
|
||||
"github.com/cheggaaa/pb/v3"
|
||||
"github.com/dmitryk-dk/pb/v3"
|
||||
)
|
||||
|
||||
type otsdbProcessor struct {
|
||||
|
@ -13,11 +13,10 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/cheggaaa/pb/v3"
|
||||
|
||||
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmctl/barpool"
|
||||
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmctl/limiter"
|
||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/decimal"
|
||||
"github.com/dmitryk-dk/pb/v3"
|
||||
)
|
||||
|
||||
// Config contains list of params to configure
|
||||
|
2
go.mod
2
go.mod
@ -13,7 +13,7 @@ require (
|
||||
github.com/VictoriaMetrics/metricsql v0.43.0
|
||||
github.com/aws/aws-sdk-go v1.44.9
|
||||
github.com/cespare/xxhash/v2 v2.1.2
|
||||
github.com/cheggaaa/pb/v3 v3.0.9-0.20211222075416-90c02fa07ea4
|
||||
github.com/dmitryk-dk/pb/v3 v3.0.9
|
||||
github.com/golang/snappy v0.0.4
|
||||
github.com/influxdata/influxdb v1.9.6
|
||||
github.com/klauspost/compress v1.15.3
|
||||
|
4
go.sum
4
go.sum
@ -198,8 +198,6 @@ github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tj
|
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
|
||||
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/cheggaaa/pb/v3 v3.0.9-0.20211222075416-90c02fa07ea4 h1:sbHAiGddrdLsd3i9/RYsm0OKOEh+UDFOONxai8YMMcw=
|
||||
github.com/cheggaaa/pb/v3 v3.0.9-0.20211222075416-90c02fa07ea4/go.mod h1:UICbiLec/XO6Hw6k+BHEtHeQFzzBH4i2/qk/ow1EJTA=
|
||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
||||
@ -244,6 +242,8 @@ github.com/dgryski/go-sip13 v0.0.0-20190329191031-25c5027a8c7b/go.mod h1:vAd38F8
|
||||
github.com/dgryski/go-sip13 v0.0.0-20200911182023-62edffca9245/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
|
||||
github.com/digitalocean/godo v1.52.0/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU=
|
||||
github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8=
|
||||
github.com/dmitryk-dk/pb/v3 v3.0.9 h1:wpWkldo8V6NeONVgmuCvsDIDjSRkJfbTbdoVigKYJ2I=
|
||||
github.com/dmitryk-dk/pb/v3 v3.0.9/go.mod h1:o9xpZcwYZHNdNaAlJVvWTA+YH+IlPciBs1myroBOxyM=
|
||||
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||
github.com/docker/docker v17.12.0-ce-rc1.0.20200706150819-a40b877fbb9e+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
||||
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
|
||||
|
15
vendor/github.com/cheggaaa/pb/v3/preset.go
generated
vendored
15
vendor/github.com/cheggaaa/pb/v3/preset.go
generated
vendored
@ -1,15 +0,0 @@
|
||||
package pb
|
||||
|
||||
var (
|
||||
// Full - preset with all default available elements
|
||||
// Example: 'Prefix 20/100 [-->______] 20% 1 p/s ETA 1m Suffix'
|
||||
Full ProgressBarTemplate = `{{string . "prefix"}}{{counters . }} {{bar . }} {{percent . }} {{speed . }} {{rtime . "ETA %s"}}{{string . "suffix"}}`
|
||||
|
||||
// Default - preset like Full but without elapsed time
|
||||
// Example: 'Prefix 20/100 [-->______] 20% 1 p/s ETA 1m Suffix'
|
||||
Default ProgressBarTemplate = `{{string . "prefix"}}{{counters . }} {{bar . }} {{percent . }} {{speed . }}{{string . "suffix"}}`
|
||||
|
||||
// Simple - preset without speed and any timers. Only counters, bar and percents
|
||||
// Example: 'Prefix 20/100 [-->______] 20% Suffix'
|
||||
Simple ProgressBarTemplate = `{{string . "prefix"}}{{counters . }} {{bar . }} {{percent . }}{{string . "suffix"}}`
|
||||
)
|
8
vendor/github.com/cheggaaa/pb/v3/termutil/term_nix.go
generated
vendored
8
vendor/github.com/cheggaaa/pb/v3/termutil/term_nix.go
generated
vendored
@ -1,8 +0,0 @@
|
||||
// +build linux darwin freebsd netbsd openbsd dragonfly
|
||||
// +build !appengine
|
||||
|
||||
package termutil
|
||||
|
||||
import "syscall"
|
||||
|
||||
const sysIoctl = syscall.SYS_IOCTL
|
0
vendor/github.com/cheggaaa/pb/v3/io.go → vendor/github.com/dmitryk-dk/pb/v3/io.go
generated
vendored
0
vendor/github.com/cheggaaa/pb/v3/io.go → vendor/github.com/dmitryk-dk/pb/v3/io.go
generated
vendored
2
vendor/github.com/cheggaaa/pb/v3/pb.go → vendor/github.com/dmitryk-dk/pb/v3/pb.go
generated
vendored
2
vendor/github.com/cheggaaa/pb/v3/pb.go → vendor/github.com/dmitryk-dk/pb/v3/pb.go
generated
vendored
@ -17,7 +17,7 @@ import (
|
||||
"github.com/mattn/go-colorable"
|
||||
"github.com/mattn/go-isatty"
|
||||
|
||||
"github.com/cheggaaa/pb/v3/termutil"
|
||||
"github.com/dmitryk-dk/pb/v3/termutil"
|
||||
)
|
||||
|
||||
// Version of ProgressBar library
|
@ -1,4 +1,4 @@
|
||||
// +build linux darwin freebsd netbsd openbsd solaris dragonfly windows plan9 aix
|
||||
//go:build linux || darwin || freebsd || netbsd || openbsd || solaris || dragonfly || windows || plan9 || aix
|
||||
|
||||
package pb
|
||||
|
||||
@ -7,7 +7,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/cheggaaa/pb/v3/termutil"
|
||||
"github.com/dmitryk-dk/pb/v3/termutil"
|
||||
)
|
||||
|
||||
// Create and start new pool with given bars
|
@ -1,4 +1,4 @@
|
||||
// +build windows
|
||||
//go:build windows
|
||||
|
||||
package pb
|
||||
|
||||
@ -6,7 +6,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/cheggaaa/pb/v3/termutil"
|
||||
"github.com/dmitryk-dk/pb/v3/termutil"
|
||||
)
|
||||
|
||||
func (p *Pool) print(first bool) bool {
|
||||
@ -24,7 +24,7 @@ func (p *Pool) print(first bool) bool {
|
||||
}
|
||||
coords.X = 0
|
||||
|
||||
err = termutil.SetCursorPos(coords)
|
||||
err = termutil.SetCursorPos(coords)
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
// +build linux darwin freebsd netbsd openbsd solaris dragonfly plan9 aix
|
||||
//go:build linux || darwin || freebsd || netbsd || openbsd || solaris || dragonfly || plan9 || aix
|
||||
|
||||
package pb
|
||||
|
||||
@ -6,7 +6,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/cheggaaa/pb/v3/termutil"
|
||||
"github.com/dmitryk-dk/pb/v3/termutil"
|
||||
)
|
||||
|
||||
func (p *Pool) print(first bool) bool {
|
15
vendor/github.com/dmitryk-dk/pb/v3/preset.go
generated
vendored
Normal file
15
vendor/github.com/dmitryk-dk/pb/v3/preset.go
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
package pb
|
||||
|
||||
var (
|
||||
// Full - preset with all default available elements
|
||||
// Example: 'Prefix 20/100 [-->______] 20% 1 p/s ETA 1m Suffix'
|
||||
Full ProgressBarTemplate = `{{with string . "prefix"}}{{.}} {{end}}{{counters . }} {{bar . }} {{percent . }} {{speed . }} {{rtime . "ETA %s"}}{{with string . "suffix"}} {{.}}{{end}}`
|
||||
|
||||
// Default - preset like Full but without elapsed time
|
||||
// Example: 'Prefix 20/100 [-->______] 20% 1 p/s Suffix'
|
||||
Default ProgressBarTemplate = `{{with string . "prefix"}}{{.}} {{end}}{{counters . }} {{bar . }} {{percent . }} {{speed . }}{{with string . "suffix"}} {{.}}{{end}}`
|
||||
|
||||
// Simple - preset without speed and any timers. Only counters, bar and percents
|
||||
// Example: 'Prefix 20/100 [-->______] 20% Suffix'
|
||||
Simple ProgressBarTemplate = `{{with string . "prefix"}}{{.}} {{end}}{{counters . }} {{bar . }} {{percent . }}{{with string . "suffix"}} {{.}}{{end}}`
|
||||
)
|
@ -1,4 +1,4 @@
|
||||
// +build appengine
|
||||
//go:build appengine
|
||||
|
||||
package termutil
|
||||
|
@ -1,5 +1,4 @@
|
||||
// +build darwin freebsd netbsd openbsd dragonfly
|
||||
// +build !appengine
|
||||
//go:build (darwin || freebsd || netbsd || openbsd || dragonfly) && !appengine
|
||||
|
||||
package termutil
|
||||
|
@ -1,5 +1,4 @@
|
||||
// +build linux
|
||||
// +build !appengine
|
||||
//go:build linux && !appengine
|
||||
|
||||
package termutil
|
||||
|
7
vendor/github.com/dmitryk-dk/pb/v3/termutil/term_nix.go
generated
vendored
Normal file
7
vendor/github.com/dmitryk-dk/pb/v3/termutil/term_nix.go
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
//go:build (linux || darwin || freebsd || netbsd || openbsd || dragonfly) && !appengine
|
||||
|
||||
package termutil
|
||||
|
||||
import "syscall"
|
||||
|
||||
const sysIoctl = syscall.SYS_IOCTL
|
@ -1,5 +1,4 @@
|
||||
// +build solaris
|
||||
// +build !appengine
|
||||
//go:build solaris && !appengine
|
||||
|
||||
package termutil
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build windows
|
||||
//go:build windows
|
||||
|
||||
package termutil
|
||||
|
@ -1,5 +1,4 @@
|
||||
// +build linux darwin freebsd netbsd openbsd solaris dragonfly
|
||||
// +build !appengine
|
||||
//go:build (linux || darwin || freebsd || netbsd || openbsd || solaris || dragonfly) && !appengine
|
||||
|
||||
package termutil
|
||||
|
||||
@ -16,6 +15,7 @@ var (
|
||||
unlockSignals = []os.Signal{
|
||||
os.Interrupt, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGKILL,
|
||||
}
|
||||
oldState syscall.Termios
|
||||
)
|
||||
|
||||
type window struct {
|
||||
@ -53,30 +53,27 @@ func TerminalSize() (rows, cols int, err error) {
|
||||
return int(w.Row), int(w.Col), nil
|
||||
}
|
||||
|
||||
var oldState syscall.Termios
|
||||
|
||||
func lockEcho() (err error) {
|
||||
func lockEcho() error {
|
||||
fd := tty.Fd()
|
||||
if _, _, e := syscall.Syscall6(sysIoctl, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&oldState)), 0, 0, 0); e != 0 {
|
||||
err = fmt.Errorf("Can't get terminal settings: %v", e)
|
||||
return
|
||||
|
||||
if _, _, err := syscall.Syscall(sysIoctl, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&oldState))); err != 0 {
|
||||
return fmt.Errorf("error when puts the terminal connected to the given file descriptor: %v", err)
|
||||
}
|
||||
|
||||
newState := oldState
|
||||
newState.Lflag &^= syscall.ECHO
|
||||
newState.Lflag |= syscall.ICANON | syscall.ISIG
|
||||
newState.Iflag |= syscall.ICRNL
|
||||
if _, _, e := syscall.Syscall6(sysIoctl, fd, ioctlWriteTermios, uintptr(unsafe.Pointer(&newState)), 0, 0, 0); e != 0 {
|
||||
err = fmt.Errorf("Can't set terminal settings: %v", e)
|
||||
return
|
||||
if _, _, e := syscall.Syscall(sysIoctl, fd, ioctlWriteTermios, uintptr(unsafe.Pointer(&newState))); e != 0 {
|
||||
return fmt.Errorf("error update terminal settings: %v", e)
|
||||
}
|
||||
return
|
||||
return nil
|
||||
}
|
||||
|
||||
func unlockEcho() (err error) {
|
||||
func unlockEcho() error {
|
||||
fd := tty.Fd()
|
||||
if _, _, e := syscall.Syscall6(sysIoctl, fd, ioctlWriteTermios, uintptr(unsafe.Pointer(&oldState)), 0, 0, 0); e != 0 {
|
||||
err = fmt.Errorf("Can't set terminal settings")
|
||||
if _, _, err := syscall.Syscall(sysIoctl, fd, ioctlWriteTermios, uintptr(unsafe.Pointer(&oldState))); err != 0 {
|
||||
return fmt.Errorf("error restores the terminal connected to the given file descriptor: %w", err)
|
||||
}
|
||||
return
|
||||
return nil
|
||||
}
|
8
vendor/modules.txt
vendored
8
vendor/modules.txt
vendored
@ -93,13 +93,13 @@ github.com/beorn7/perks/quantile
|
||||
# github.com/cespare/xxhash/v2 v2.1.2
|
||||
## explicit; go 1.11
|
||||
github.com/cespare/xxhash/v2
|
||||
# github.com/cheggaaa/pb/v3 v3.0.9-0.20211222075416-90c02fa07ea4
|
||||
## explicit; go 1.12
|
||||
github.com/cheggaaa/pb/v3
|
||||
github.com/cheggaaa/pb/v3/termutil
|
||||
# github.com/cpuguy83/go-md2man/v2 v2.0.2
|
||||
## explicit; go 1.11
|
||||
github.com/cpuguy83/go-md2man/v2/md2man
|
||||
# github.com/dmitryk-dk/pb/v3 v3.0.9
|
||||
## explicit; go 1.18
|
||||
github.com/dmitryk-dk/pb/v3
|
||||
github.com/dmitryk-dk/pb/v3/termutil
|
||||
# github.com/fatih/color v1.13.0
|
||||
## explicit; go 1.13
|
||||
github.com/fatih/color
|
||||
|
Loading…
Reference in New Issue
Block a user