How build with Node.js 64bit version for amd64 and armhf version for armv7l?

I explain better, i’m try to snap an easy node.js app developed with Ubuntu 16LTS based on amd64, but the app need to run on armhf architecture too… But i think i’m doing some config wrong in the snapcraft.yaml file because it’s works on amd64 architecture but i get an error on armhf architecture (i’m building both the version on snapcraft build from github) here the snapcraft.yaml :


base: core18
architectures:

  • build-on: amd64
    run-on: amd64
  • build-on: armhf
    run-on: armhf

node part

node-service:
source: .
plugin: nodejs
nodejs-version: “13.14.0”
nodejs-package-manager: “npm”

The error i get on armhf architecture :

node: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory

So my question is, can the snapcraft automatic build, build the right node version for both the architecture or i need to add/change some snapcraft.yaml configuration ?

That library is supplied by libatomic1 package. You need to add that as a stage-packages: entry to your node-service part:

parts:
  node-service:
    ...
    stage-packages:
      - libatomic1
2 Likes

Thanks … It’s works ! You’ve saved my weekend !! :stuck_out_tongue_closed_eyes::stuck_out_tongue_closed_eyes: