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

Better crossbuild v3 + fixes #9355

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Jai-JAP
Copy link
Contributor

@Jai-JAP Jai-JAP commented Dec 23, 2023

This PR implements a slightly better and a faster way to cross-build arm(64) artifacts.

The previous approach uses a x64 bionic chroot to build the native modules, whereas this approach uses a bare bionic arm(64) debootstrap as a sysroot which is just used to link arm(64) libraries using --sysroot parameter passed to gcc/g++ and PKG_CONFIG_PATH to specify path of *.pc files to pkg-config.

Thus this approach on its own should give a slight improvement as compared to a bionic chroot plus the added benefit of caching the sysroot makes it even faster than the previous approach implemented in #8613

Build times have been reduced from 15-20 mins to 11-13 mins.

Additionally this PR moves to Node 18 as version 16 now EOL, removes old code & fixes a potential ambiguous case in scripts/vars.mjs.

This PR is not tested but it should not break anything theoretically.

- Build now uses a bare `debootstrap` as a build-sysroot instead of a `chroot` and use its libraries for cross compiling using `crossbuild-essential-*` package using `--sysroot` GCC/G++ flag and `PKG_CONFIG_PATH` to specify path to find `*.pc` files for target arch
- Use node 18 (16 is EOL)
- Fix a potential ambiguous case in scripts/vars.mjs
- Fix cache on x64
- Run tar as root
@Eugeny
Copy link
Owner

Eugeny commented Dec 24, 2023

Thanks! Have you tested the produced ARM builds? I can test the rest

@Jai-JAP
Copy link
Contributor Author

Jai-JAP commented Dec 24, 2023

Thanks! Have you tested the produced ARM builds? I can test the rest

Nope, my pi is no longer working so can't test it.

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

Successfully merging this pull request may close these issues.

None yet

2 participants