Skip to content

Commit

Permalink
chore: add libc fields on linux platform packages
Browse files Browse the repository at this point in the history
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+](yarnpkg/berry#3981) and [cnpm](cnpm/npminstall#387) are supported, the npm implementation is [still under discussion](npm/rfcs#519).
  • Loading branch information
yisibl committed Mar 20, 2022
1 parent 6d3539c commit 4666f83
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion npm/linux-arm64-gnu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"cpu": [
"arm64"
],
"libc": [
"glibc"
],
"main": "resvgjs.linux-arm64-gnu.node",
"files": [
"resvgjs.linux-arm64-gnu.node"
Expand All @@ -32,4 +35,4 @@
"access": "public"
},
"repository": "git@github.com:yisibl/resvg-js.git"
}
}
5 changes: 4 additions & 1 deletion npm/linux-arm64-musl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"cpu": [
"arm64"
],
"libc": [
"musl"
],
"main": "resvgjs.linux-arm64-musl.node",
"files": [
"resvgjs.linux-arm64-musl.node"
Expand All @@ -32,4 +35,4 @@
"access": "public"
},
"repository": "git@github.com:yisibl/resvg-js.git"
}
}
5 changes: 4 additions & 1 deletion npm/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"cpu": [
"x64"
],
"libc": [
"glibc"
],
"main": "resvgjs.linux-x64-gnu.node",
"files": [
"resvgjs.linux-x64-gnu.node"
Expand All @@ -32,4 +35,4 @@
"access": "public"
},
"repository": "git@github.com:yisibl/resvg-js.git"
}
}
5 changes: 4 additions & 1 deletion npm/linux-x64-musl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"cpu": [
"x64"
],
"libc": [
"musl"
],
"main": "resvgjs.linux-x64-musl.node",
"files": [
"resvgjs.linux-x64-musl.node"
Expand All @@ -32,4 +35,4 @@
"access": "public"
},
"repository": "git@github.com:yisibl/resvg-js.git"
}
}

1 comment on commit 4666f83

@vercel
Copy link

@vercel vercel bot commented on 4666f83 Mar 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.