Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(@turbo/repository): build library for linux musl #7299

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/turborepo-library-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@ jobs:
npm i -g [email protected]
setup: |
pnpm install
- host: ubuntu-latest
target: "aarch64-unknown-linux-musl"
install: |
apt-get update
apt-get install -y curl musl-tools
npm i -g [email protected]
setup: |
pnpm install
- host: ubuntu-latest
target: "x86_64-unknown-linux-musl"
install: |
apt-get update
apt-get install -y curl musl-tools
npm i -g [email protected]
setup: |
pnpm install
- host: windows-latest
target: "aarch64-pc-windows-msvc"
- host: windows-latest
Expand Down Expand Up @@ -109,6 +125,8 @@ jobs:
mv native-packages/turbo-library-x86_64-apple-darwin/@turbo/repository.darwin-x64.node packages/turbo-repository/npm/darwin-x64/
mv native-packages/turbo-library-aarch64-unknown-linux-gnu/@turbo/repository.linux-arm64-gnu.node packages/turbo-repository/npm/linux-arm64-gnu/
mv native-packages/turbo-library-x86_64-unknown-linux-gnu/@turbo/repository.linux-x64-gnu.node packages/turbo-repository/npm/linux-x64-gnu/
mv native-packages/turbo-library-aarch64-unknown-linux-musl/@turbo/repository.linux-arm64-musl.node packages/turbo-repository/npm/linux-arm64-musl/
mv native-packages/turbo-library-x86_64-unknown-linux-musl/@turbo/repository.linux-x64-musl.node packages/turbo-repository/npm/linux-x64-musl/
mv native-packages/turbo-library-aarch64-pc-windows-msvc/@turbo/repository.win32-arm64-msvc.node packages/turbo-repository/npm/win32-arm64-msvc/
mv native-packages/turbo-library-x86_64-pc-windows-msvc/@turbo/repository.win32-x64-msvc.node packages/turbo-repository/npm/win32-x64-msvc/

Expand All @@ -124,6 +142,8 @@ jobs:
npm pack packages/turbo-repository/npm/darwin-x64
npm pack packages/turbo-repository/npm/linux-arm64-gnu
npm pack packages/turbo-repository/npm/linux-x64-gnu
npm pack packages/turbo-repository/npm/linux-arm64-musl
npm pack packages/turbo-repository/npm/linux-x64-musl
npm pack packages/turbo-repository/npm/win32-arm64-msvc
npm pack packages/turbo-repository/npm/win32-x64-msvc
npm pack packages/turbo-repository/js
Expand All @@ -149,6 +169,8 @@ jobs:
npm publish -ddd --tag ${TAG} --access public turbo-repository-darwin-x64-${VERSION}.tgz
npm publish -ddd --tag ${TAG} --access public turbo-repository-linux-arm64-gnu-${VERSION}.tgz
npm publish -ddd --tag ${TAG} --access public turbo-repository-linux-x64-gnu-${VERSION}.tgz
npm publish -ddd --tag ${TAG} --access public turbo-repository-linux-arm64-musl-${VERSION}.tgz
npm publish -ddd --tag ${TAG} --access public turbo-repository-linux-x64-musl-${VERSION}.tgz
npm publish -ddd --tag ${TAG} --access public turbo-repository-win32-arm64-msvc-${VERSION}.tgz
npm publish -ddd --tag ${TAG} --access public turbo-repository-win32-x64-msvc-${VERSION}.tgz
npm publish -ddd --tag ${TAG} --access public turbo-repository-${VERSION}.tgz
24 changes: 11 additions & 13 deletions packages/turbo-repository/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,18 @@ switch (platform) {
}
break;
case "linux":
if (isMusl()) {
throw new Error("musl not yet supported");
} else {
switch (arch) {
case "x64":
suffix = "linux-x64-gnu";
break;
case "arm64":
suffix = "linux-arm64-gnu";
break;
default:
throw new Error(`Unsupported architecture on Linux: ${arch}`);
}
const isMusl = isMusl();
switch (arch) {
case "x64":
suffix = isMusl ? "linux-x64-musl" : "linux-x64-gnu";
break;
case "arm64":
suffix = isMusl ? "linux-arm64-musl" : "linux-arm64-gnu";
break;
default:
throw new Error(`Unsupported architecture on Linux: ${arch}`);
}

break;
default:
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`);
Expand Down
26 changes: 26 additions & 0 deletions packages/turbo-repository/npm/linux-arm64-musl/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "@turbo/repository-linux-arm64-musl",
"version": "0.0.1-canary.4",
"repository": {
"type": "git",
"url": "https://github.com/vercel/turbo",
"directory": "packages/turbo-repository/npm/linux-arm64-musl"
},
"os": [
"linux"
],
"cpu": [
"arm64"
],
"libc": [
"glibc"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

copy paste.. this is probably not right

],
"main": "repository.linux-arm64-musl.node",
"files": [
"repository.linux-arm64-musl.node"
],
"license": "MPL-2.0",
"engines": {
"node": ">= 10"
}
}
26 changes: 26 additions & 0 deletions packages/turbo-repository/npm/linux-x64-musl/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "@turbo/repository-linux-x64-musl",
"version": "0.0.1-canary.4",
"repository": {
"type": "git",
"url": "https://github.com/vercel/turbo",
"directory": "packages/turbo-repository/npm/linux-x64-musl"
},
"os": [
"linux"
],
"cpu": [
"x64"
],
"libc": [
"glibc"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

copy paste.. this is probably not right

],
"main": "repository.linux-x64-musl.node",
"files": [
"repository.linux-x64-musl.node"
],
"license": "MPL-2.0",
"engines": {
"node": ">= 10"
}
}
Loading