gvvaughan / lyaml

LibYAML binding for Lua.
gvvaughan.github.io/lyaml
Other
208 stars 34 forks source link

Support for s390x #32

Closed rinaldou closed 4 years ago

rinaldou commented 5 years ago

Is it possible to create a support to s390x plattaform (mainframe)? I am trying to install kong in s390x plattaform, and lyaml is a required library that I couldn't install. When I try to install it gives me the error "luke: fatal: no modules table in 'lukefile', nothing to build". Looking into lukefile, there is no s390x platform, so I believe the error is because of that.

gvvaughan commented 5 years ago

Hi!

Absolutely. However I don’t have access to that platform... it doesn’t sound like missing platform support in luke from that error though, more like the actual modules table in the lyaml luke file is being misparsed?

Can you provoke a stack-trace to paste here?

You could also try experimenting with adding a table entry to build-aux/luke for whatever string you get back from uname -s on your host to see if that gets further.

The additional compiler flags in the lyaml lukefile were ported from the autoconf generated configure script in the master branch of gvvaughan/luke, but I don’t recall seeing anything special required for s390x.

In any case, I’ve been meaning to add better debug output to luke for a long time, so if you don’t get anywhere with the suggestions above, I’ll make some time to do that to help you figure out exactly where the build is failing for you...

Let me know how you get on!

On Sep 18, 2019, at 6:33 AM, rinaldou notifications@github.com wrote:

 Is it possible to create a support to s390x plattaform (mainframe)? I am trying to install kong in s390x plattaform, and lyaml is a required library that I couldn't install. When I try to install it gives me the error "luke: fatal: no modules table in 'lukefile', nothing to build". Looking into lukefile, there is no s390x platform, so I believe the error is because of that.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

rinaldou commented 5 years ago

There is an easy way to have access to s390x Linux. You can access https://developer.ibm.com/linuxone/request-vm/ and fill the information and you will have access to a virtual linux on s390x for free! It is for development purpose. I am not an expert, so if you could guide me to how I can generate a stack-trace, I will gladly try.

gvvaughan commented 5 years ago

Let me see if I can work something out with the remote access, but please prod me in a few days in case I get distracted and forget to prioritize this.

On Sep 18, 2019, at 10:07 AM, rinaldou notifications@github.com wrote:

 There is an easy way to have access to s390x Linux. You can access https://developer.ibm.com/linuxone/request-vm/ and fill the information and you will have access to a virtual linux on s390x for free! It is for development purpose. I am not an expert, so if you could guide me to how I can generate a stack-trace, I will gladly try.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

rinaldou commented 4 years ago

Hi! Did the remote access worked for you?

yselkowitz commented 4 years ago

Just came across this issue as well, using luajit on s390x but not with lua. I think it may be a bug with the s390x support in the luajit builds which contain such (either from patches on top of the original upstream, or from forks which have pulled in these patches). Reproducing this is pretty straight-forward once you have a linux (preferably Fedora or RHEL 8) install on s390x. Any chance to get this looked at?

gvvaughan commented 4 years ago

I'm afraid my free time has plummeted in the last year, so I have not looked into this at all. I would, however, be delighted to review, merge and release contributed patches.

yselkowitz commented 4 years ago

This was actually a bug in the s390x support in LuaJIT, not with lyaml. Unless OP has seen this in plain lua (I did not), then it can probably be closed.

gvvaughan commented 4 years ago

Thanks for checking back with an update.

Excellent timing too - I’m working on the remaining known bugs right now to get a new release out!

ccorley commented 3 years ago

I also am running into this and it is the only remaining issue blocking Kong on s390x. Kong has a dependency on the lyaml rock and the build of that rock causes the exact problem mentioned by the opener of the issue. I am building Kong on a LinuxONE VM & using LuaJIT via OpenResty 1.17.8.1 from Linux on IBM Z.

It does seem like we are running into these lines in luke:

validate_arguments=function(parsed)local luke,err=loadluke(parsed.fname)diagnose(luke~=nil,'bad %s: %s',parsed.fname,err)if isempty(luke.modules or{})then
fatal("no modules table in '%s', nothing to build",parsed.fname)
...
loadluke=function(filename)local content,err=slurp(File(filename))if content==nil then
return nil,err
end

Any suggestions? Can we please reopen this issue?

yselkowitz commented 3 years ago

As mentioned above, the issue is in LuaJIT, not this package, and that is where the fix needs to happen.

ccorley commented 3 years ago

Can you please elaborate on the issue in LuaJIT, so we might get it fixed via another avenue besides LuaJIT PR 395? If it's an issue there, it may need to be fixed in OpenResty 1.17.8.1 from Linux on IBM Z as well.

yselkowitz commented 3 years ago

As mentioned in the LuaJIT PR, the following commit is needed on top of the rest of the patchset: https://github.com/moonjit/moonjit/pull/107

rinaldou commented 3 years ago

Hi ccorley! I was able to build kong on s390x (RHEL8). Check this link https://github.com/openresty/luajit2/pull/89/files After I corrected the file with this code, I was able to build lyaml on s390x. Be sure to run kong build tools to create the requisites.

ccorley commented 3 years ago

Thanks yselkowitz and rinaldou. After pulling in that 2-line fix, I was able to build the lyaml rock on s390x, as a part of the kong build.