Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARMv6 support #231

Closed
NelsonBrandao opened this issue May 12, 2023 · 7 comments
Closed

ARMv6 support #231

NelsonBrandao opened this issue May 12, 2023 · 7 comments

Comments

@NelsonBrandao
Copy link

NelsonBrandao commented May 12, 2023

Hi, Is there any plan to support armv6?

This project would be a good replacement for converting SVG to PNG without puppeteer on the Raspberry pi zero

@NelsonBrandao NelsonBrandao changed the title Arm6 support ARMv6 support May 12, 2023
@yisibl
Copy link
Member

yisibl commented May 16, 2023

Raspberry Pi Zero is too old, you can try to compile it yourself using zig cc.

https://www.leemeichin.com/posts/gettin-ziggy-with-it-pi-zero/#:~:text=**-,build%20and%20push,-Zig%20comes%20with

@NelsonBrandao
Copy link
Author

I was able to cargo install resvg the main lib on the Pi Zero. That is why I created this issue, to see if we could get official support.

Will try to compile resvg-js on the Pi Zero

@zimond
Copy link
Collaborator

zimond commented May 17, 2023

you can install that because Rust supports the specified architecture. It's not because resvg has done something special about it. Besides, this project is not an official resvg affiliated project. We currently distribute to some chosen platforms using pre-compiled packages, adding more packages will make it harder to maintain. So I think manually compile it is a better choice now. Don't hesitate to ask if there's any difficulties doing so.

@NelsonBrandao
Copy link
Author

I was trying to setup this repo on my Pi but yarn install can't install @swc/core. Not sure if this is another problem related with ARMv6, this time on swc side.

yarn
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 13s 484ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 13s 707ms
➤ YN0000: ┌ Link step
➤ YN0007: │ @swc/core@npm:1.3.53 [c0754] must be built because it never has been before or the last one failed
➤ YN0009: │ @swc/core@npm:1.3.53 [c0754] couldn't be built successfully (exit code 129, logs can be found here: /tmp/xfs-9c34ecea/build.log)
➤ YN0000: └ Completed in 16s 451ms
➤ YN0000: Failed with errors in 45s 507ms
cat /tmp/xfs-9c34ecea/build.log
# This file contains the result of Yarn building a package (@swc/core@virtual:c0754d0947c87dd3aa2aa4a7216571ecf617b1efc6919e3c9a3be40955d92a4e78049e28a88b7dace7c117aca71a911ea4399a0565d7757b3941855c7b94f9f1#npm:1.3.53)
# Script name: postinstall

@yisibl
Copy link
Member

yisibl commented May 17, 2023

If you're just building binary .node files, you don't need to install any other dependencies, just @napi-rs/cli and then npm run build.

> @resvg/resvg-js@2.4.1 build
> napi build --platform --release --js js-binding.js --dts js-binding.d.ts

    Finished release [optimized] target(s) in 0.12s

@NelsonBrandao
Copy link
Author

So I ran rustc -vV on the Pi Zero to get the correct target:

rustc 1.69.0 (84c898d65 2023-04-16)
binary: rustc
commit-hash: 84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc
commit-date: 2023-04-16
host: arm-unknown-linux-gnueabihf
release: 1.69.0
LLVM version: 15.0.7

Decided to trigger the build on the actual Pi Zero instead of trying to cross compile. This was done by running npm run build -- --target arm-unknown-linux-gnueabihf

The build didn't throw any errors:

{...}
Finished release [optimized] target(s) in 109m 08s

and a resvgjs.linux-arm-gnueabihf.node file was created.

I then replace the original node_modules/@resvg/resvg-js-linux-arm-gnueabihf/resvgjs.linux-arm-gnueabihf.node inside my project node_modules with my built version.

Unfortunately the node script still throws an error when executing

Illegal instruction

I'm I doing something wrong here?

Btw thanks guys for all the help so far, much appreciated.

@yisibl
Copy link
Member

yisibl commented Jul 26, 2023

Sorry, but since the Raspberry Pi Zero is so old, I'm not going to support it and close this issue for now. If you figure out how to build it, feel free to share it here.

@yisibl yisibl closed this as completed Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants