-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from mcgordonite/multi-arch
Add aarch64 binaries
- Loading branch information
Showing
6 changed files
with
104 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"ctrlc-windows": minor | ||
--- | ||
|
||
Added support for arm64. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,16 +17,17 @@ | |
"triples": { | ||
"defaults": false, | ||
"additional": [ | ||
"aarch64-pc-windows-msvc", | ||
"x86_64-pc-windows-msvc" | ||
] | ||
} | ||
}, | ||
"author": "Frontside Engineering <[email protected]>", | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "napi build --release && rimraf dist && mkdirp dist && mv ctrlc-windows.node dist && mv ./target/release/process-killer dist", | ||
"build": "node ./scripts/build.js --release", | ||
"test": "mocha -r ts-node/register \"test/**/*.test.ts\"", | ||
"build:debug": "napi build --platform", | ||
"build:debug": "node ./scripts/build.js", | ||
"format": "run-p format:prettier format:rs", | ||
"format:prettier": "prettier . -w", | ||
"format:rs": "cargo fmt", | ||
|
@@ -43,7 +44,8 @@ | |
"mocha": "^10.0.0", | ||
"rimraf": "^3.0.2", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.7.4" | ||
"typescript": "^4.7.4", | ||
"yargs": "^17.7.2" | ||
}, | ||
"volta": { | ||
"node": "14.20.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/env node | ||
const { execSync } = require("child_process"); | ||
const os = require("os"); | ||
const path = require("path"); | ||
const mkdirp = require("mkdirp"); | ||
const fs = require("fs"); | ||
|
||
const { arch, release } = require("yargs") | ||
.usage( | ||
"$0", | ||
"build for the given architecture", | ||
(yargs) => { | ||
yargs.option("r", { | ||
alias: "release", | ||
describe: "make a release build", | ||
boolean: true, | ||
require: false, | ||
default: false, | ||
}); | ||
yargs.option("a", { | ||
alias: "arch", | ||
describe: "target architecture, defaults to host architecture", | ||
type: "string", | ||
default: os.arch(), | ||
require: false, | ||
}); | ||
}, | ||
) | ||
.help("help").argv; | ||
|
||
if (os.platform() !== "win32") { | ||
console.log("Skipping native build on non-Windows platform"); | ||
process.exit(0); | ||
} | ||
|
||
const targetTriple = arch === "arm64" ? | ||
"aarch64-pc-windows-msvc" : "x86_64-pc-windows-msvc"; | ||
|
||
const rootDir = path.resolve(__dirname, ".."); | ||
const archDistDir = path.join(rootDir, "dist", arch); | ||
|
||
const buildCommand = `yarn napi build --target=${targetTriple}${release ? " --release" : ""}`; | ||
console.log(buildCommand); | ||
execSync(buildCommand, { stdio: "inherit" }); | ||
|
||
console.log("Moving artifacts to dist directory"); | ||
mkdirp.sync(archDistDir); | ||
|
||
fs.renameSync( | ||
path.join(rootDir, "target", targetTriple, release ? "release" : "debug", "process-killer.exe"), | ||
path.join(archDistDir, "process-killer.exe"), | ||
); | ||
|
||
fs.renameSync( | ||
path.join(rootDir, 'ctrlc-windows.node'), | ||
path.join(archDistDir, 'ctrlc-windows.node'), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -702,6 +702,15 @@ cliui@^7.0.2: | |
strip-ansi "^6.0.0" | ||
wrap-ansi "^7.0.0" | ||
|
||
cliui@^8.0.1: | ||
version "8.0.1" | ||
resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" | ||
integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== | ||
dependencies: | ||
string-width "^4.2.0" | ||
strip-ansi "^6.0.1" | ||
wrap-ansi "^7.0.0" | ||
|
||
clone@^1.0.2: | ||
version "1.0.4" | ||
resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" | ||
|
@@ -2394,7 +2403,7 @@ yargs-parser@^20.2.2: | |
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a" | ||
integrity sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw== | ||
|
||
yargs-parser@^21.0.0: | ||
yargs-parser@^21.0.0, yargs-parser@^21.1.1: | ||
version "21.1.1" | ||
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" | ||
integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== | ||
|
@@ -2452,6 +2461,19 @@ yargs@^17.1.1: | |
y18n "^5.0.5" | ||
yargs-parser "^21.0.0" | ||
|
||
yargs@^17.7.2: | ||
version "17.7.2" | ||
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" | ||
integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== | ||
dependencies: | ||
cliui "^8.0.1" | ||
escalade "^3.1.1" | ||
get-caller-file "^2.0.5" | ||
require-directory "^2.1.1" | ||
string-width "^4.2.3" | ||
y18n "^5.0.5" | ||
yargs-parser "^21.1.1" | ||
|
||
[email protected]: | ||
version "3.1.1" | ||
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" | ||
|