I am trying to build rclone (latest if possible) on AIX 7.2 (powerpc).
It works pretty well when building on Red Hat Linux - however building on AIX fails with compiler errors:
root@xxxxxx\(xxxx\):/tmp/go/rclone $ go build -trimpath -ldflags -s
# github.com/atotto/clipboard
../pkg/mod/github.com/atotto/clipboard@v0.1.4/clipboard.go:10:9: undefined: readAll
../pkg/mod/github.com/atotto/clipboard@v0.1.4/clipboard.go:15:9: undefined: writeAll
# github.com/rclone/rclone/fs/log
fs/log/redirect_stderr_unix.go:17:6: redirectStderr redeclared in this block
/tmp/go/rclone/fs/log/redirect_stderr.go:15:24: previous declaration
# github.com/rclone/rclone/backend/local
backend/local/local.go:1362:9: o.readMetadataFromFile undefined (type *Object has no field or method readMetadataFromFile)
root@xxxxxx\(xxxx\)/tmp/go/rclone $ go version
go version go1.17.12 aix/ppc64
I am not sure if the golang compiler is a bit pickier on AIX than on Linux - however, I am not sure how to handle such errors from depending libraries like atotto.
Any known workarounds?
root@xxxxxx\(xxxxx\):/tmp/go/rclone $ go build
backend/local/local.go:1362:9: o.readMetadataFromFile undefined (type *Object has no field or method readMetadataFromFile)
Obviously, the error relates to the local file system backend plugin. Seems like AIX has its own way of getting file metadata.
As a workaround, I removed the local backend from
/rclone/backend/all/all.go
I now have a rclone executable. I will do further tests tomorrow.
Adding and removing build constraints is the correct way to fix the build.
As for the read metadata, probably adding aix in here rclone/metadata_unix.go at master · rclone/rclone · GitHub should be the right thing to do and add !aix in the other metadata*.go files. If that doesn't work, then add it into metadata_other.go
I already played around with the metadata_*.go files.
Adding aix to metadata_unix.go results in
:/tmp/go/rclone $ go build -trimpath -ldflags -s
# github.com/rclone/rclone/backend/local
backend/local/metadata_unix.go:34:23: cannot use stat.Atim (type syscall.StTimespec_t) as type syscall.Timespec in argument to setTime
backend/local/metadata_unix.go:35:23: cannot use stat.Mtim (type syscall.StTimespec_t) as type syscall.Timespec in argument to setTime
however adding aix to metadata_other.go and !aix all others seems to work - no compiler errors!
I will do some testing later that day. Thanks a lot!
Damn - seems like AIX does not support fuse. No port is available for AIX.
is Bazil maybe still supported - since they state they do not rely on the C FUSE Library?
No FUSE support sounds like no support in the kernel rather than the userspace library?
If there is kernel support for FUSE but no libfuse then compiling cmd/mount is the way to go. Though cmd/cmount uses libfuse and is probably more reliable.
AIX doesn't seem to have kernel support for fuse.
I was able to use rclone for sftp, s3 and others. Mounting is not possible due to missing kernel support for fuse.
I will open a support case with IBM to get a final answer.
I will try to create a PR. The only things I changed, are build tags. However, I also changed build-tags in atotto (depending library).
I guess I need to create a second PR for the atotto repository.