3scale / APIcast

3scale API Gateway
Apache License 2.0
304 stars 171 forks source link

Replace luafilesystem-ffi to fix build issue on aarch64 #1445

Closed tkan145 closed 4 months ago

tkan145 commented 5 months ago

This is a experimental PR, replace the lfs-ffi https://github.com/3scale/luafilesystem-ffi/blob/master/lfs_ffi.lua#L921 with https://github.com/lunarmodules/luafilesystem to hopefully fix the issue on arm64 https://issues.redhat.com/browse/THREESCALE-10662.

Verification Steps

The lfs module is mainly used during startup, so the criteria is to have the APIcast start without errors.

The gateway should be running without error

eguzki commented 5 months ago

it would be good to have verification steps

eguzki commented 5 months ago

Is there an easy way to build ARM docker image on x86 host?

Is there an easy way to run ARM docker image on x86 host?

tkan145 commented 5 months ago

Docker supports building arm images on x86 with -platform linux/arm64. I haven't tried running the arm image on x86 but I don't think it will work. The easiest way is to run the image inside a VM.

https://docs.docker.com/build/building/multi-platform/

eguzki commented 5 months ago

The easiest way is to run the image inside a VM.

Can you elaborate more on that?

Is this PR still in progress? (the title says "do not merge"). Then, what is missing? (other that CHANGELOG.md)

tkan145 commented 5 months ago

I'm using this on my x86 laptop https://github.com/multiarch/qemu-user-static with QEMU.

$ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
$ docker run --rm -t arm64v8/ubuntu uname -m

This is more like a test PR so @gsaslis can trigger a build for arm64 using code in this branch. I have provided 2 patches, 1 adds a new structure to luafilesystem-ffi and this patch replaces luafilesystem-ffi with another lib.

If the first patch works then great, everyone happy If that one doesn't work but this one does then we may need to analyze whether this new lib has any impact on performance.

gsaslis commented 4 months ago

@tkan145 it looks like some CI checks are still failing.

Please ping me here once those are taken care of, so I can adapt the product build accordingly. ;)

tkan145 commented 4 months ago

@gsaslis all the tests passed now :smile: