feat: support libc field for package.json#4605
Conversation
3cb856d to
41dc5e9
Compare
|
I will add some test case later |
41dc5e9 to
2ada0c3
Compare
|
hi~ @zkochan maybe i need to change some source code of when i write lockfile object as: it will generate: |
|
but i can't find the git repo of |
|
@zkochan I complete the test case, please take a look when u feel free~ |
| let osOk = true | ||
| let cpuOk = true | ||
| const { platform, arch } = process | ||
| const currentLibc = getLibcFamilySync() ?? 'unknown' |
There was a problem hiding this comment.
Is it fast to read it every time? It might be better to read it only once per installation, so move it out from the function.
There was a problem hiding this comment.
maybe i need to put getLibcFamilySync() function out of the package-is-installable ? and pass the result to the function checkPackage() ?
There was a problem hiding this comment.
Or just i use a env like process.env.libc to keep the value at package-is-installable?
There was a problem hiding this comment.
i read the source code of getLibFamilySync(), it just get a process.report value and deal it. Just like the process.platform and process.arch here, so it might not be slow?
https://github.com/pnpm/js-yaml branch features-for-pnpm |
zkochan
left a comment
There was a problem hiding this comment.
update js-yaml to stringify libc in one line
ok, i will make a pr for it. |
| cpu: [x86] | ||
| os: [darwin] | ||
| libc: | ||
| - glibc |
There was a problem hiding this comment.
@zkochan looks like this pr merged and publish a new package version of js-yaml, it will be fine here.
i open a pr for it: pnpm/js-yaml#1
|
We need to document this new field in the docs https://pnpm.io/package_json |


closes: #4454
This PR support for a filed named
libcinpackage.json, it will taken into account when filter optional dependencies.