kmatsuyama
(Kmatsuyama)
December 6, 2018, 8:37am
1
I make the filebeat on a linux aarch machine.
My Environment:
$ go version
go version go1.11.2 linux/arm64
$ git rev-parse HEAD
79a6ff31aec8e371631661add2e52938f250ceba
I get make
failing with the following error:
$ make
go build -i -ldflags "-X github.com/elastic/beats/libbeat/version.buildTime=2018-12-06T08:20:44Z -X github.com/elastic/beats/libbeat/version.commit=79a6ff31aec8e371631661add2e52938f250ceba"
# github.com/elastic/beats/libbeat/common/file
../libbeat/common/file/stderr_other.go:30:9: undefined: syscall.Dup2
make: *** [filebeat] Error 2
How can I make this?
steffens
(Steffen Siering)
December 6, 2018, 1:46pm
2
This is weird. Looks like Dup2
is missing in the stdlib syscall
package on arm. Can you try to replace syscall.Dup2
with unix.Dup2
(package x/sys/unix
, it's vendored)?
kmatsuyama
(Kmatsuyama)
December 7, 2018, 1:20am
3
I can make with the following change:
diff --git a/libbeat/common/file/stderr_other.go b/libbeat/common/file/stderr_other.go
index 99ad24c..2731322 100644
--- a/libbeat/common/file/stderr_other.go
+++ b/libbeat/common/file/stderr_other.go
@@ -21,11 +21,11 @@ package file
import (
"os"
- "syscall"
+ "golang.org/x/sys/unix"
)
// RedirectStandardError causes all standard error output to be directed to the
// given file.
func RedirectStandardError(toFile *os.File) error {
- return syscall.Dup2(int(toFile.Fd()), 2)
+ return unix.Dup2(int(toFile.Fd()), 2)
}
Thank you!
steffens
(Steffen Siering)
December 11, 2018, 4:55pm
4
Thanks for confirming. Github PR fixing compilation upstream: https://github.com/elastic/beats/pull/9493
1 Like
system
(system)
Closed
January 8, 2019, 4:55pm
5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.