Skip to content

Fix Native Module Packaging in Build Pipeline #35

@cdgco

Description

@cdgco

Rack Manage Agent requires two Node.js packages with native modules: sqlite3 and keytar which both have precompiled binaries available for all target platforms: darwin-x64, darwin-arm64, linux-x64, linux-arm64, win32-x64, and win32-ia32.

The current CircleCI build process runs Linux / Windows builds on a Ubuntu x64 machine, while MacOS builds run on an MacOS x64 machine. The current build process does not properly target different architectures when downloading native modules, causing all installers to include the x64 native modules for sqlite3 and keytar regardless of the target arch.

Both sqlite3 and keytar use node-gyp and prebuild for their native module compilation, so it may be possible to simply use flags like npm install --target_arch=arm64 --target_platform=linux or npm_config_target_arch=arm64 npm_config_target_platform=linux yarn install to specify the arch of the native modules to download, or the pipeline may need to be reconfigured to use runners of the target arch which would require adding a macos.m1.medium.gen1 and arm.medium workflow.

Either way, this will likely add multiple new steps and increase the length of the pipeline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions