Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

fix(build): enumerate precompiled binaries #146

Merged
merged 14 commits into from
May 10, 2023
Merged

Conversation

JonasBa
Copy link
Member

@JonasBa JonasBa commented May 9, 2023

Our bindings require call was fully dynamic so bundlers (only tested esbuild and webpack) could not determine the static set of binaries that they need to copy the binaries for, resulting in MODULE_NOT_FOUND runtime error.

This PR fixes this by hardcoding the set of binaries so that they can be copied to the final bundle - the caveat of this approach is that now all precompiled binaries will be copied. Sadly, the approach is not fully forward compatible as missing env/platform/node variants which are not hardcoded will still have to be manually copied.

To ensure we don't break builds by hardcoding binaries and not providing precompiled binaries, I added a step before creating the final npm tarbal which attempts to build a bundle including our profiling package - this triggers .node files to be copied over to outdir folder and errors if any of the hardcoded binaries are not available.

@JonasBa JonasBa force-pushed the jb/build/enum-binaries branch from 730c781 to 59858a9 Compare May 9, 2023 17:51
@JonasBa JonasBa changed the title fix(build): enumerate all supported binaries fix(build): enumerate precompiled binaries May 9, 2023
@JonasBa JonasBa force-pushed the jb/build/enum-binaries branch 2 times, most recently from c7ac86c to 49aee8c Compare May 9, 2023 20:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant