cgofuse icon indicating copy to clipboard operation
cgofuse copied to clipboard

Build more !cgo variants using purego

Open ncw opened this issue 6 months ago • 4 comments

The !cgo variant for Windows is very useful for cross compilation.

I came across this Library recently

https://github.com/ebitengine/purego/

Which would enable !cgo for the other architectures if you wanted to use it.

This would mean, for example, that I could have cgofuse builds by default for rclone for all platforms, not just Windows and macOS. (I avoid cgo on Linux due to too many libc variants making it impossible to make a single binary)

ncw avatar Aug 17 '25 09:08 ncw

Hi, @ncw.

I seem to recall we have discussed purego before. Do you have any experience with it? Is it mature enough where it would make sense to incorporate it into cgofuse?

billziss-gh avatar Aug 23 '25 15:08 billziss-gh

@billziss-gh I've used ebitengine quite a bit and hence purego and it had been very stable there. It has 175 dependencies so is in use quite a bit.

I haven't had experience using the library directly though.

ncw avatar Aug 23 '25 21:08 ncw

I see that purego also supports Windows although it seems there may be API differences? If we were to do this it might make sense to unify the nocgo variants for both Windows and UNIX so that we do not have separate nocgo implementations.

billziss-gh avatar Aug 25 '25 10:08 billziss-gh

That would be ideal to unify the nocgo variants.

The example shows the API variation but I think it is only to do with how you load the shared library.

https://github.com/ebitengine/purego/tree/main/examples/libc

ncw avatar Aug 25 '25 15:08 ncw