huginn: Can't install Huginn on ARM device - libv8 tries to build with x64 arch

Installing on Debian Jessie on a Pine64 device.

When running the command: sudo -u huginn -H bundle install --deployment --without development test

I get error with the libv8 gem – all other gems install fine. Seems it tries to compile for x64 and not arm64.

Installing libv8 3.16.14.13 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /home/huginn/huginn/vendor/bundle/ruby/2.3.0/gems/libv8-3.16.14.13/ext/libv8
/usr/local/bin/ruby -r ./siteconf20160715-30828-5e4d0u.rb extconf.rb
creating Makefile
Compiling v8 for x64
Using python 2.7.9
Using compiler: /usr/bin/c++ (GCC version 4.9)
In file included from ../src/allocation.h:31:0,
                 from ../src/allocation.cc:28:
../src/globals.h:90:2: error: #error Host architecture was not detected as supported by v8
 #error Host architecture was not detected as supported by v8
  ^
../src/globals.h:116:2: error: #error Target architecture x64 is only supported on x64 host
 #error Target architecture x64 is only supported on x64 host
  ^
make[1]: *** [/home/huginn/huginn/vendor/bundle/ruby/2.3.0/gems/libv8-3.16.14.13/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o] Error 1
make: *** [x64.release] Error 2
/home/huginn/huginn/vendor/bundle/ruby/2.3.0/gems/libv8-3.16.14.13/ext/libv8/location.rb:36:in `block in verify_installation!': libv8 did not install properly, expected binary v8 archive '/home/huginn/huginn/vendor/bundle/ruby/2.3.0/gems/libv8-3.16.14.13/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a'to exist, but it was not found (Libv8::Location::Vendor::ArchiveNotFound)
    from /home/huginn/huginn/vendor/bundle/ruby/2.3.0/gems/libv8-3.16.14.13/ext/libv8/location.rb:35:in `each'
    from /home/huginn/huginn/vendor/bundle/ruby/2.3.0/gems/libv8-3.16.14.13/ext/libv8/location.rb:35:in `verify_installation!'
    from /home/huginn/huginn/vendor/bundle/ruby/2.3.0/gems/libv8-3.16.14.13/ext/libv8/location.rb:26:in `install!'
    from extconf.rb:7:in `<main>'
GYP_GENERATORS=make \
build/gyp/gyp --generator-output="out" build/all.gyp \
              -Ibuild/standalone.gypi --depth=. \
              -Dv8_target_arch=x64 \
              -S.x64  -Dv8_enable_backtrace=1 -Dv8_can_use_vfp2_instructions=true -Darm_fpu=vfpv2 -Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3 -Dwerror=''
make[1]: Entering directory '/home/huginn/huginn/vendor/bundle/ruby/2.3.0/gems/libv8-3.16.14.13/vendor/v8/out'
  CXX(target) /home/huginn/huginn/vendor/bundle/ruby/2.3.0/gems/libv8-3.16.14.13/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o
tools/gyp/preparser_lib.target.x64.mk:111: recipe for target '/home/huginn/huginn/vendor/bundle/ruby/2.3.0/gems/libv8-3.16.14.13/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o' failed
make[1]: Leaving directory '/home/huginn/huginn/vendor/bundle/ruby/2.3.0/gems/libv8-3.16.14.13/vendor/v8/out'
Makefile:195: recipe for target 'x64.release' failed

extconf failed, exit code 1

Gem files will remain installed in /home/huginn/huginn/vendor/bundle/ruby/2.3.0/gems/libv8-3.16.14.13 for inspection.
Results logged to /home/huginn/huginn/vendor/bundle/ruby/2.3.0/extensions/aarch64-linux/2.3.0-static/libv8-3.16.14.13/gem_make.out

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Comments: 43 (16 by maintainers)

Most upvoted comments

It would be nice to have a docker image compatible with arm, if you agree please provide some feedback: #2648 cc: @sfischer13 @LorenzoAncora @LexiconCode @wasafiri

@ch40s I agree, currently1 there are only AMD64 docker images.
An official ARM64\ARMhf docker image of Huginn would be very appropriate. 👍

1: the contents of that page may change at any time. You’ll find ARM images there if and when authors add them.

It would be nice to have a docker image compatible with arm, if you agree please provide some feedback: https://github.com/huginn/huginn/issues/2648 cc: @sfischer13 @LorenzoAncora @LexiconCode @wasafiri

I just created a Docker image of Huginn single process compatible with ARMv7/armhf, ARMv8/aarch64 and intel x86. This image is automatically updated for every new commit on https://github.com/huginn/huginn. You can find it here: https://quay.io/repository/unixfox/huginn-single-process The source code of my Dockerfile is here: https://github.com/unixfox/periodic-build-with-github-actions/blob/master/huginn/single-process/Dockerfile

I have no plans to support the multiple processes docker image of Huginn because I don’t use it myself, and it is more difficult to build.

Any update on this? There are a few powerful ARM based SBCs these days that can easily run Huginn. In my opinion this issue limits and slows down the adoption of huginn.

@wasafiri Can you try to install libv8 via the package manager and build the gem with gem install libv8 -v '3.16.14.3' -- --with-system-v8? If the gem installed successfully bundler should use the already installed version and not try to build it again.

@LorenzoAncora, thanks for the information about Linux process management. Your explanation makes more sense than mine and I guess my corrupted SD was just a coincidence. Good luck with your project!

I made it work on Raspberry Pi 3 by applying this PR. I also had to fix the versions of some dependencies because they have not been updated for the ARM architecture.

By hindsight, it was not worth the effort. There were regular crashes, probably due to heavy usage of swap memory, which then wore out the SD cards. This is only a guess, but I never had issues again after migrating to a server with more memory (not ARM though).

I don’t want to discourage anyone – the Raspberry Pi is a great platform – but you may waste a lot of time tinkering and then realize that Huginn needs more power as your number of agents increases.

Some people has success on raspberries in the past, but I don’t know about the 3. Recent libv8 versions seem not to build on ARM/ARM64 so even mini_racer will not help us.

Is there update on this?