Skip to content

Instantly share code, notes, and snippets.

@joyeecheung
joyeecheung / install.sh
Last active September 26, 2023 11:19
How to install nightly with various Node.js version managers
# Using n
$ n install nightly
# Using nvs
$ nvs remote add nightly https://nodejs.org/download/nightly/
$ nvs add nightly/21
$ nvs use nightly/21
# Using nvm
$ NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly/ nvm i node
@joyeecheung
joyeecheung / build-llnode.sh
Last active December 9, 2019 16:55
Commands to build llnode on throw-away VPS with different UNIX OSs
# I am being lazy here by using the root perm because I am mostly testing
# on throw-away VPS
# Also, might be missing some commands, should be easy to resolve though
# Ubuntu
apt-get update
apt-get install lldb-4.0 git make python g++
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
nvm install stable
git clone --depth=1 -b merge-gyp https://github.com/joyeecheung/llnode.git
#include "node_native_module.h"
#include "node_internals.h"
// This file is generated by tools/generate_code_cache.js
// and is used when configure is run with `--code-cache-path`
namespace node {
namespace native_module {
static const uint8_t _http_agent_raw[] = { };
@joyeecheung
joyeecheung / failures.json
Created August 14, 2018 14:34
failures of recent 20 runs, 20180814
[
{
"source": "https://github.com/nodejs/node/pull/22310/",
"upstream": "https://ci.nodejs.org/job/node-test-pull-request/16436/",
"url": "https://ci.nodejs.org/job/node-test-commit-linux/nodes=alpine-latest-x64/20711/console",
"builtOn": "test-softlayer-alpine38_container-x64-1",
"reason": "not ok 775 parallel/test-cluster-master-error\n ---\n duration_ms: 120.106\n severity: fail\n exitcode: -15\n stack: |-\n timeout\n ...\n",
"highlight": 0,
"type": "JS_TEST_FAILURE",
"file": "parallel/test-cluster-master-error",
[
{
"source": "https://github.com/nodejs/node/pull/21346/",
"upstream": "https://ci.nodejs.org/job/node-test-commit/19271/",
"type": "JS_TEST_FAILURE",
"url": "https://ci.nodejs.org/job/node-test-commit-linux/nodes=centos6-64-gcc48/19594/console",
"reason": "not ok 1550 parallel/test-timers-throw-reschedule\n ---\n duration_ms: 0.349\n severity: fail\n stack: |-\n assert.js:42\n throw new errors.AssertionError({\n ^\n \n AssertionError [ERR_ASSERTION]: false == true\n at Timeout.common.mustCall (/home/iojs/build/workspace/node-test-commit-linux/nodes/centos6-64-gcc48/test/parallel/test-timers-throw-reschedule.js:20:5)\n at Timeout._onTimeout (/home/iojs/build/workspace/node-test-commit-linux/nodes/centos6-64-gcc48/test/common/index.js:478:15)\n at ontimeout (timers.js:498:11)\n at Timer.unrefdHandle (timers.js:611:5)\n ...\n",
"highlight": 0,
"file": "parallel/test-timers-throw-reschedule",
"severity": "fail"
@joyeecheung
joyeecheung / database-2018-06-14.json
Last active June 14, 2018 15:47
CI failures of the last 100 runs in https://ci.nodejs.org/job/node-test-pull-request/, 2018-06-14
[
{
"source": "https://github.com/nodejs/node/pull/21325/",
"upstream": "https://ci.nodejs.org/job/node-test-commit/19231/",
"type": "JS_TEST_FAILURE",
"url": "https://ci.nodejs.org/job/node-test-commit-aix/nodes=aix61-ppc64/15767/console",
"reason": "not ok 1966 parallel/test-worker-dns-terminate\n ---\n duration_ms: 2.829\n severity: crashed\n exitcode: -6\n stack: |-\n ...\n",
"highlight": 0,
"file": "parallel/test-worker-dns-terminate",
"severity": "crashed"
@joyeecheung
joyeecheung / stats-by-pr-count-2018-06-14.json
Created June 14, 2018 15:37
Reasons of CI failure ranked by failed PR count, 2018-06-14
[
{
"count": 14,
"reason": "sequential/test-inspector-port-zero-cluster",
"prs": [
"https://github.com/nodejs/node/pull/21323/",
"https://github.com/nodejs-private/node-private/pull/136/",
"https://github.com/nodejs/node/pull/21196/",
"https://github.com/nodejs/node/pull/21256/",
"https://github.com/nodejs/node/pull/21105/",
@joyeecheung
joyeecheung / hours.js
Created April 8, 2018 07:31
Get frequency of committed time, in UTC hours
'use strict';
const child_process = require('child_process');
const log = child_process.spawnSync('git', ['log', '--format=%cI', '-n', '10000'], {
cwd: process.cwd()
});
const dates = log.stdout.toString().trim();
const hours = dates.split('\n').map(d => new Date(d).getUTCHours());
const map = new Map();
for (const h of hours) {
if (map.has(h)) {

Recent work

  • Link with lldb reported by llvm-config on MacOS: no need to use the XCode one, can work with custom builds or lldb installed with Homebrew
  • Fixed tests and Travis intergration
  • LLNODE_DEBUG=true to print details of failures during symbol loading, turned on in Travis
  • Loading symbols with shared libraries: can work with libv8 + d8 built with post-mortem support

JS API

  • Original work by @rnchamberlain, rewrote with NAN and some API changes, e.g. use iterators for instance lists to save memory.
@joyeecheung
joyeecheung / see-bench.sh
Last active January 25, 2018 18:32
Get the results of Node.js benchmark CI
#/usr/bin/env bash
# Saves CI results to bench-$JOBID.txt
# output of compare.R to bench-$JOBID-results.txt
JOBID=$1
wget https://ci.nodejs.org/job/benchmark-node-micro-benchmarks/$JOBID/consoleText -O bench-$JOBID.txt
grep 'improvement' -A 10000 bench-$JOBID.txt > bench-$JOBID-results.txt
head -n 1 bench-$JOBID-results.txt > bench-$JOBID-significant.txt
grep '*' bench-$JOBID-results.txt >> bench-$JOBID-significant.txt