feat(node-swc): Support FreeBSD (#1758)

This commit is contained in:
LongYinan 2021-05-28 11:47:02 +08:00 committed by GitHub
parent 3359188a20
commit 6a13615381
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 105 additions and 5 deletions

View File

@ -4,7 +4,7 @@ on:
create:
tags:
- v*
env:
CARGO_INCREMENTAL: 0
CI: "1"
@ -301,6 +301,54 @@ jobs:
name: bindings
path: swc.*.node
build-freebsd:
runs-on: macos-latest
name: Build FreeBSD
steps:
- uses: actions/checkout@v2
- name: Build
id: build
uses: vmactions/freebsd-vm@v0.1.4
env:
DEBUG: 'napi:*'
RUSTUP_HOME: /usr/local/rustup
CARGO_HOME: /usr/local/cargo
RUSTUP_IO_THREADS: 1
with:
envs: 'DEBUG RUSTUP_HOME CARGO_HOME RUSTUP_IO_THREADS'
usesh: true
mem: 3000
prepare: |
pkg install -y curl node yarn npm
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain stable
export PATH="/usr/local/cargo/bin:$PATH"
echo "~~~~ rustc --version ~~~~"
rustc --version
echo "~~~~ node -v ~~~~"
node -v
echo "~~~~ yarn --version ~~~~"
yarn --version
run: |
export PATH="/usr/local/cargo/bin:$PATH"
pwd
ls -lah
whoami
env
freebsd-version
npm i
cargo build --release -p node
yarn build
npm test
- name: 'List files'
run: ls -la
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: bindings
path: swc.*.node
publish:
name: npm
runs-on: ubuntu-latest
@ -312,6 +360,7 @@ jobs:
- build-linux-aarch64
- build-apple-silicon
- build-android-aarch64
- build-freebsd
steps:
- uses: actions/checkout@v2

View File

@ -14,7 +14,7 @@ version = "0.1.0"
dashmap = "4.0.2"
swc_common = {version = "0.10", path = "../../common"}
[target.'cfg(all(unix, not(target_env = "musl"), not(target_arch = "aarch64")))'.dependencies]
[target.'cfg(all(unix, not(target_env = "musl"), not(target_os = "freebsd"), not(target_arch = "arm"), not(target_arch = "aarch64")))'.dependencies]
jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]}
[target.'cfg(windows)'.dependencies]

View File

@ -1,8 +1,14 @@
//! This crate configures memery allocator.
//! This crate configures memory allocator.
//!
//! The swc crates related to the node binding should depend on this crate.
#[cfg(all(unix, not(target_env = "musl"), not(target_arch = "aarch64")))]
#[cfg(all(
unix,
not(target_env = "musl"),
not(target_os = "freebsd"),
not(target_arch = "arm"),
not(target_arch = "aarch64")
))]
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

View File

@ -35,7 +35,8 @@
"aarch64-unknown-linux-gnu",
"armv7-unknown-linux-gnueabihf",
"aarch64-apple-darwin",
"aarch64-linux-android"
"aarch64-linux-android",
"x86_64-unknown-freebsd"
]
}
},

View File

@ -0,0 +1,3 @@
# `@swc/core-freebsd-x64`
This is the **x86_64-unknown-freebsd** binary for `@swc/core`

View File

@ -0,0 +1,41 @@
{
"name": "@swc/core-freebsd-x64",
"version": "1.2.59",
"os": [
"freebsd"
],
"cpu": [
"x64"
],
"main": "swc.freebsd-x64.node",
"files": [
"swc.freebsd-x64.node"
],
"description": "Super-fast alternative for babel",
"keywords": [
"swc",
"spack",
"babel",
"typescript",
"rust",
"webpack",
"tsc"
],
"author": "강동윤 <kdy1997.dev@gmail.com>",
"homepage": "https://swc.rs",
"license": "MIT",
"engines": {
"node": ">=10"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/swc-project/swc.git"
},
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
}