From 91148c5dab4c8ff97c6c1cb261a011014cd47343 Mon Sep 17 00:00:00 2001 From: yisibl Date: Sun, 20 Mar 2022 14:43:56 +0800 Subject: [PATCH] chore: add libc fields on linux platform packages On Linux, it is not possible to tell exactly what kind of C library a native modules depends on just by os/cpu, so yarn 3.2 and cnpm added libc fields to further distinguish this case. This avoids downloading both `gnu` and `musl` packages at the same time. Currently only [yarn 3.2+](https://github.com/yarnpkg/berry/pull/3981) and [cnpm](https://github.com/cnpm/npminstall/pull/387) are supported, the npm implementation is [still under discussion](https://github.com/npm/rfcs/pull/519). --- CHANGELOG.md | 8 ++++++++ npm/linux-arm64-gnu/package.json | 5 ++++- npm/linux-arm64-musl/package.json | 5 ++++- npm/linux-x64-gnu/package.json | 5 ++++- npm/linux-x64-musl/package.json | 5 ++++- 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4422584..7f98092a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,14 @@ This changelog also contains important changes in dependencies. ## [Unreleased] +### Changed + +- chore: add libc fields on linux platform packages + + On Linux, it is not possible to tell exactly what kind of C library a native modules depends on just by os/cpu, so yarn 3.2 and cnpm added libc fields to further distinguish this case. This avoids downloading both `gnu` and `musl` packages at the same time. + + Currently only [yarn 3.2+](https://github.com/yarnpkg/berry/pull/3981) and [cnpm](https://github.com/cnpm/npminstall/pull/387) are supported, the npm implementation is [still under discussion](https://github.com/npm/rfcs/pull/519). + ## [2.0.0-alpha.5] - 2022-03-19 ### Changed diff --git a/npm/linux-arm64-gnu/package.json b/npm/linux-arm64-gnu/package.json index f642b2ac..4dfff4a2 100644 --- a/npm/linux-arm64-gnu/package.json +++ b/npm/linux-arm64-gnu/package.json @@ -7,6 +7,9 @@ "cpu": [ "arm64" ], + "libc": [ + "glibc" + ], "main": "resvgjs.linux-arm64-gnu.node", "files": [ "resvgjs.linux-arm64-gnu.node" @@ -32,4 +35,4 @@ "access": "public" }, "repository": "git@github.com:yisibl/resvg-js.git" -} \ No newline at end of file +} diff --git a/npm/linux-arm64-musl/package.json b/npm/linux-arm64-musl/package.json index b71d00a8..42768c77 100644 --- a/npm/linux-arm64-musl/package.json +++ b/npm/linux-arm64-musl/package.json @@ -7,6 +7,9 @@ "cpu": [ "arm64" ], + "libc": [ + "musl" + ], "main": "resvgjs.linux-arm64-musl.node", "files": [ "resvgjs.linux-arm64-musl.node" @@ -32,4 +35,4 @@ "access": "public" }, "repository": "git@github.com:yisibl/resvg-js.git" -} \ No newline at end of file +} diff --git a/npm/linux-x64-gnu/package.json b/npm/linux-x64-gnu/package.json index 0f5d4c21..76840c8d 100644 --- a/npm/linux-x64-gnu/package.json +++ b/npm/linux-x64-gnu/package.json @@ -7,6 +7,9 @@ "cpu": [ "x64" ], + "libc": [ + "glibc" + ], "main": "resvgjs.linux-x64-gnu.node", "files": [ "resvgjs.linux-x64-gnu.node" @@ -32,4 +35,4 @@ "access": "public" }, "repository": "git@github.com:yisibl/resvg-js.git" -} \ No newline at end of file +} diff --git a/npm/linux-x64-musl/package.json b/npm/linux-x64-musl/package.json index e1aa0d0f..8f7b4d9f 100644 --- a/npm/linux-x64-musl/package.json +++ b/npm/linux-x64-musl/package.json @@ -7,6 +7,9 @@ "cpu": [ "x64" ], + "libc": [ + "musl" + ], "main": "resvgjs.linux-x64-musl.node", "files": [ "resvgjs.linux-x64-musl.node" @@ -32,4 +35,4 @@ "access": "public" }, "repository": "git@github.com:yisibl/resvg-js.git" -} \ No newline at end of file +}