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

AIX/ppc64 support #353

Open
aklyachkin opened this issue Nov 18, 2020 · 15 comments
Open

AIX/ppc64 support #353

aklyachkin opened this issue Nov 18, 2020 · 15 comments

Comments

@aklyachkin
Copy link

aklyachkin commented Nov 18, 2020

Which operating system (GOOS) and version are you using?

AIX 7.2

Please describe the issue that occurred.

Compiling different packages on AIX breaks because there are no fsnotify primitives for AIX.

Are you able to reproduce the issue? Please provide steps to reproduce and a code sample if possible.

The easiest way to solve the problem is just to add the stub for AIX:

// ahafs.go
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// +build aix

package fsnotify

import (
	"errors"
)

// Watcher watches a set of files, delivering events to a channel.
type Watcher struct {
	Events chan Event
	Errors chan error
}

// NewWatcher establishes a new watcher with the underlying OS and begins waiting for events.
func NewWatcher() (*Watcher, error) {
	return nil, errors.New("AHAFS based watcher not yet supported for fsnotify\n")
}

// Close removes all watches and closes the events channel.
func (w *Watcher) Close() error {
	return nil
}

// Add starts watching the named file or directory (non-recursively).
func (w *Watcher) Add(name string) error {
	return nil
}

// Remove stops watching the the named file or directory (non-recursively).
func (w *Watcher) Remove(name string) error {
	return nil
}
@szydell
Copy link

szydell commented Oct 18, 2021

+1, AIX/PPC64 support would be much appreciated :)

@nathany
Copy link
Contributor

nathany commented Jan 19, 2022

#314

@arp242
Copy link
Member

arp242 commented Jul 21, 2022

It should compile on AIX now, although any functionality isn't supported. I'm not sure if AIX provides any facilities for this? If not, it can use the polling fallback when that gets added.

@arp242 arp242 closed this as completed Jul 21, 2022
@aklyachkin
Copy link
Author

Thank you! AIX has such functionality - see https://github.com/power-devops/ahafs

@arp242
Copy link
Member

arp242 commented Jul 21, 2022

Ah right. That could also be added here, but it's not something I can do as I don't have access to an AIX system. So someone else will have to pick that up and create a patch.

@leoncamel
Copy link

leoncamel commented Oct 17, 2022

@aklyachkin Any plan to integrate ahafs with fsnotify? Since some package may be pending on this feature on AIX.

@aklyachkin
Copy link
Author

@leoncamel In my lab I integrated them, but till now I didn't get it working stable. Sometimes it works, sometimes it doesn't. I didn't find the reason for it.

@arp242
Copy link
Member

arp242 commented Oct 17, 2022

The polling watcher should work on AIX regardless; I hope it'll get added relatively soon (still in 2022, maybe early 2023, although I promise nothing).

I'm a little bit hesitant to add AIX-specific support without the ability to test it somehow. It doesn't even need to be in the CI, just some way to run an AIX machine. I looked at this a few months ago, but I couldn't really find anything for it. Is there any way to get some sort of AIX machine (VM or the like)?

I'll be the one who will have to maintain this for the long term, and without the ability to run or test the code changing things, adding features, or debugging problems will be pretty much impossible.

@leoncamel
Copy link

@aklyachkin Cool. I have an AIX-7.2 machine. And can you share your working repository? We are also interested in this problem, and we can work together to make it work.

@leoncamel
Copy link

leoncamel commented Oct 17, 2022

@arp242 Surprisingly, I found @aklyachkin 's youtube channel. He can run an AIX-7.2 system on qemu. Maybe he can share some thoughts about building a CI environment on qemu?

@arp242
Copy link
Member

arp242 commented Oct 17, 2022

The problem is that you need a license from IBM to get the install media. As far as I know there isn't any option to get a free "developer license" or the like, and I'm not going to pay money for it.

@aklyachkin
Copy link
Author

I spoke to IBM several times about free access to AIX for open source projects but unfortunately the policy will not change in the nearest future. They are discussing it. Using QEMU is not an option - it is so slow, that you'd wait several years before golang compiles something.

I am still thinking and discussing what can be done to make it possible.

@aklyachkin
Copy link
Author

I posted my semi-working code in the gist - https://gist.github.com/aklyachkin/fad889d0b3f2d9fbe64eb59c8516418e
I think I made it too complicated :-) But if you have questions feel free to ask.

@arp242
Copy link
Member

arp242 commented Oct 19, 2022

I pushed that code to the aix branch in fsnotify: https://github.com/fsnotify/fsnotify/tree/aix – the code is in backend_aix.go, and is mostly the same as that Gist, with gofmt applied, a few very minor staticcheck fixes, and all the doc comments applied (with mkdoc.zsh). I confirmed it compiles with GOOS=aix GOARCH=ppc64, but that's all I can do.

This way the tests from fsnotify_test.go will be run with go test, and people can use go get github.com/fsnotify/fsnotify@aix or go mod edit -replace github.com/fsnotify/fsnotify=github.com/fsnotify/fsnotify@aix to override it in dependencies.

As I mentioned, I'm a bit hesitant to put this in the main branch for now as there isn't any way most people will be able to maintain that on account of not having access to an AIX system, but this seems like an okay compromise for now. You can create PRs based on that branch to update it. If we get it to a state where at least most of the tests pass and if you (or anyone else) is interested in maintaining it long-term we can maybe put it in main too.

@arp242 arp242 reopened this Jan 15, 2023
@cwansart
Copy link

Can you update the aix tree to include the 6 commits from main?

Also, do you need assistance or tests for AIX?

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

No branches or pull requests

6 participants