Skip to content

Commit

Permalink
fallback if no zig
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Nov 20, 2022
1 parent 294a39b commit 5583171
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cli/src/build.ts
Expand Up @@ -305,6 +305,21 @@ export class BuildCommand extends Command {
}

if (this.useZig || isCrossForLinux || isCrossForMacOS) {
try {
execSync('zig version')
} catch (e) {
if (this.useZig) {
throw new TypeError(
`Could not find ${chalk.green('zig')} on the PATH`,
)
} else {
debug(
`Could not find ${chalk.green(
'zig',
)} on the PATH, fallback to normal linker`,
)
}
}
const zigABIVersion =
this.zigABIVersion ?? (isCrossForLinux && triple.abi === 'gnu')
? DEFAULT_GLIBC_TARGET
Expand Down

1 comment on commit 5583171

@github-actions
Copy link

Choose a reason for hiding this comment

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

Benchmark

Benchmark suite Current: 5583171 Previous: 035def0 Ratio
noop#napi-rs 54072412 ops/sec (±0.18%) 55270758 ops/sec (±0.19%) 1.02
noop#JavaScript 713890905 ops/sec (±0.13%) 712617818 ops/sec (±0.16%) 1.00
Plus number#napi-rs 19806811 ops/sec (±0.44%) 19840697 ops/sec (±0.56%) 1.00
Plus number#JavaScript 711839185 ops/sec (±0.14%) 709773557 ops/sec (±0.28%) 1.00
Create buffer#napi-rs 401547 ops/sec (±8.31%) 376424 ops/sec (±9.34%) 0.94
Create buffer#JavaScript 1798329 ops/sec (±5.29%) 1654823 ops/sec (±4.55%) 0.92
createArray#createArrayJson 37906 ops/sec (±0.12%) 38355 ops/sec (±0.11%) 1.01
createArray#create array for loop 7357 ops/sec (±0.11%) 7525 ops/sec (±0.11%) 1.02
createArray#create array with serde trait 7402 ops/sec (±0.11%) 7507 ops/sec (±0.13%) 1.01
getArrayFromJs#get array from json string 16829 ops/sec (±0.36%) 16903 ops/sec (±0.24%) 1.00
getArrayFromJs#get array from serde 9958 ops/sec (±0.07%) 10167 ops/sec (±0.03%) 1.02
getArrayFromJs#get array with for loop 11851 ops/sec (±0.12%) 12185 ops/sec (±0.12%) 1.03
Get Set property#Get Set from native#u32 392266 ops/sec (±5.89%) 402616 ops/sec (±5.68%) 1.03
Get Set property#Get Set from JavaScript#u32 349919 ops/sec (±5.59%) 349716 ops/sec (±5.48%) 1.00
Get Set property#Get Set from native#string 364417 ops/sec (±5.35%) 362021 ops/sec (±5.47%) 0.99
Get Set property#Get Set from JavaScript#string 337785 ops/sec (±5.58%) 333856 ops/sec (±5.75%) 0.99
Async task#spawn task 36805 ops/sec (±0.88%) 35797 ops/sec (±2.1%) 0.97
Async task#ThreadSafeFunction 873 ops/sec (±30.94%) 1990 ops/sec (±12.78%) 2.28
Async task#Tokio future to Promise 30276 ops/sec (±2.93%) 30478 ops/sec (±3.53%) 1.01
Query#query * 100 1978 ops/sec (±5.41%) 1996 ops/sec (±4.23%) 1.01
Query#query * 1 30422 ops/sec (±7.38%) 31402 ops/sec (±0.64%) 1.03

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.