You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been unsuccessful so far in my attempts to compile ruby-packer v0.4.0 on a raspberry pi running raspbian (architecture armhf).
I am able to compile ruby from sources on the same setup (using ./configure && make), as well as able to use the same Docker image on x86_64 to build a working rubyc binary.
What goes wrong?
Compilation on armhf always fails at the following:
I wasn't sure if that was a spurious message/red herring, so I have compared the build logs between x86_64 and armhf.
I didn't find any error message on armhf that wasn't on x86_64 (I can provide the extensive logs if required).
So I came to the conclusion there wasn't something obviously missing or failing at an earlier step in either case, especially since the x86_64 build successfully finishes and produce a working rubyc binary as stated above.
Note that I have tried several versions of ruby-packer but was only successful in building a functional rubyc on x86_64 when using v0.4.0, which is why I am reporting the issue for an old version of the project.
Now, looking more specifically at the issue, I found that the enc.mk file was empty.
I traced it to a problem with the generation of the encs array at L55 of ruby/enc/make_encmake.rb: when running from miniruby on armhf, the Dir.open command returns some truncated file names on the armhf build while it works on the x86_64 builds. This is what leads to a functional enc.mk file or not.
I was able to create a simple test.rb file (see below) to run a comparative test between x86_64 and armhf. Results are in the attached files below:
Since the vanilla ruby build on armhf work, I am guessing that this issue does not happen with it, hence me reporting to the ruby-packer project.
Additionally I was unable to find anything related to miniruby failing on armhf while googling.
My attempts to hard-code the values for the encs, atrans and trans variables in the make_encmake.rb file to try and progress in the build were not really conclusive.
How to reproduce?
While I was originally working on Debian stretch based Docker images, I have tried to reproduce it with a docker image that would be as close as the travisci image as possible so here is what I ended up with:
Now, the last RUN line is commented as it fails on armhf, but it runs fine and produce a working image on x86_64.
The way to get a test environment is to build the image, and then run the container then trying to build rubyc using source "/usr/share/rvm/scripts/rvm" && rvm use ruby-2.4 && export CPPFLAGS="-P" && ruby -Ilib bin/rubyc bin/rubyc -o rubyc.
Any help from people more experienced with the project or a better understanding of compilers would be welcome.
If a later commit is known to produce some working a.out from gems I would be more than happy to try it too, as ultimately I am just trying to produce a self-contained binary for a gem on armhf as a one-off :)
The text was updated successfully, but these errors were encountered:
@endemics Thank you very much for the detailed bug report! However, currently only x64 is supported. I am personally not able to fix this as I do not have a armhf machine. Help from other people and Pull Requests are welcome!
@endemics Thank you very much for the detailed bug report! However, currently only x64 is supported. I am personally not able to fix this as I do not have a armhf machine. Help from other people and Pull Requests are welcome!
Thanks for the answer Minqi! Unfortunately I won't be able to help with the patch but sure can help by testing if anyone feel like trying to solve this. Also, if you are interested in trying to do the port yourself to armhf/aarch64 let me know and I can try to arrange to get you a raspberry pi 3.
Hi,
I have been unsuccessful so far in my attempts to compile
ruby-packer
v0.4.0 on a raspberry pi runningraspbian
(architecturearmhf
).I am able to compile ruby from sources on the same setup (using
./configure && make
), as well as able to use the same Docker image onx86_64
to build a workingrubyc
binary.What goes wrong?
Compilation on
armhf
always fails at the following:My analysis so far
I wasn't sure if that was a spurious message/red herring, so I have compared the build logs between
x86_64
andarmhf
.I didn't find any error message on
armhf
that wasn't onx86_64
(I can provide the extensive logs if required).So I came to the conclusion there wasn't something obviously missing or failing at an earlier step in either case, especially since the
x86_64
build successfully finishes and produce a workingrubyc
binary as stated above.Note that I have tried several versions of
ruby-packer
but was only successful in building a functionalrubyc
onx86_64
when usingv0.4.0
, which is why I am reporting the issue for an old version of the project.Now, looking more specifically at the issue, I found that the
enc.mk
file was empty.I traced it to a problem with the generation of the
encs
array at L55 ofruby/enc/make_encmake.rb
: when running from miniruby onarmhf
, theDir.open
command returns some truncated file names on thearmhf
build while it works on thex86_64
builds. This is what leads to a functionalenc.mk
file or not.I was able to create a simple
test.rb
file (see below) to run a comparative test betweenx86_64
andarmhf
. Results are in the attached files below:test_results_armhf.txt
test_results_x86.txt
Since the vanilla ruby build on
armhf
work, I am guessing that this issue does not happen with it, hence me reporting to theruby-packer
project.Additionally I was unable to find anything related to miniruby failing on
armhf
while googling.My attempts to hard-code the values for the
encs
,atrans
andtrans
variables in themake_encmake.rb
file to try and progress in the build were not really conclusive.How to reproduce?
While I was originally working on Debian stretch based Docker images, I have tried to reproduce it with a docker image that would be as close as the travisci image as possible so here is what I ended up with:
Now, the last RUN line is commented as it fails on armhf, but it runs fine and produce a working image on x86_64.
The way to get a test environment is to build the image, and then run the container then trying to build rubyc using
source "/usr/share/rvm/scripts/rvm" && rvm use ruby-2.4 && export CPPFLAGS="-P" && ruby -Ilib bin/rubyc bin/rubyc -o rubyc
.You can then try and run the following test.rb:
Where to?
Any help from people more experienced with the project or a better understanding of compilers would be welcome.
If a later commit is known to produce some working
a.out
from gems I would be more than happy to try it too, as ultimately I am just trying to produce a self-contained binary for a gem onarmhf
as a one-off :)The text was updated successfully, but these errors were encountered: