Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support AIX build and polling #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

jtroy
Copy link

@jtroy jtroy commented Sep 25, 2024

This PR enables building for the aix/ppc64 target, which is needed to build telegraf for AIX. Changes made:

  • Update fsnotify to the latest, which allows building on unsupported platforms. This does not add proper AIX support, so fsnotify will not actually work for AIX. Polling does work however, which is good enough for me for now.
  • Add the aix build tag for the POSIX flavor.
  • Print fsnotify's error in the panic message so it's obvious to the caller that their platform is unsupported, e.g.:
-bash-5.2$ go version
go version go1.23.1 aix/ppc64
-bash-5.2$ go run cmd/gotail/gotail.go -f /var/log/dnf.log 
2024/09/25 09:54:06 FATAL -- failed to create Watcher: fsnotify not supported on the current platform
goroutine 20 [running]:
runtime/debug.Stack()
        /home/jtroy/go1.23.1/src/runtime/debug/stack.go:26 +0x6c
github.com/influxdata/tail/util.Fatal({0x1000f0cde?, 0x1010100000070?}, {0xa0001000006ef88, 0x1, 0x1})
        /home/jtroy/src/tail/util/util.go:22 +0x9c
github.com/influxdata/tail/watch.(*InotifyTracker).run(0xa000100000bc040)
        /home/jtroy/src/tail/watch/inotify_tracker.go:231 +0x90
created by github.com/influxdata/tail/watch.init.func1 in goroutine 4
        /home/jtroy/src/tail/watch/inotify_tracker.go:53 +0x16c
exit status 1

Note that the above command does work with the -p (poll) flag.

  • Remove the vendored fsnotify since it's unused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant