libc variable should default to unknown for non-linux target_platform?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.2k
- Forks
- 271
- Avg merge
- 23h 40m
- Merged PRs (30d)
- 2
Description
## 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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how node-pre-gyp determines libc and target_platform during native package installation, including the package_name template and target_libc option. Reproduce installation for a win32 target from both win32 and Linux hosts. Done means win32-targeted prebuilts consistently use libc as unknown, with coverage for both host scenarios.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100