Skip to content

libc variable should default to unknown for non-linux target_platform? #383

Open
@mark-buer

Description

@mark-buer

TLDR;

I claim that the libc variable makes no sense for windows targets and should default to "unknown" when installing prebuilts on windows and when installing prebuilts for windows on linux.

Long Story

When invoking node-pre-gyp from win32, libc will default to the value "unknown".
When invoking node-pre-gyp from a linux platform (i.e. docker), but targeting win32, libc will default to whatever value is detected for the host. Thus, if a native package includes libc within the package_name template, node-pre-gyp will attempt to download the wrong prebuilt binary.

A real world example of "installing prebuilts for windows on linux": electron-builder allows one to build a windows app distribution from a docker instance if all native modules have win32 prebuilts available. This mostly works, except for the case where the native module uses the libc variable within the package_name template. An example of such a package is grpc-node, which is used by many packages such as firebase for example.

Thus, should node-pre-gyp default the libc variable to unknown when targeting win32?

Or, is it the responsibility of each and every client of node-pre-gyp to ensure that the target_libc option is set to "unknown" for the edge case of cross-installing dependencies?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions