From a131fd99a382dcefb3cadd43b4928b9e5b414648 Mon Sep 17 00:00:00 2001 From: Howard Hellyer Date: Tue, 6 Dec 2016 13:36:16 +0000 Subject: [PATCH 1/5] package.json: Make llnode installable via npm This updates package.json and adds scripts to allow llnode to be built via "npm install llnode" It doesn't create a Node.js module you can use via require('llnode'). (This may change in the future depending on project direction.) The npm name llnode has been reserved here: https://www.npmjs.com/package/llnode This PR does leave the npm version number at 0.0.0, this should once the install process has been reviewed and at that point the llnode package should be npm publish'd. --- gyp_llnode | 4 +- llnode.gyp | 55 +------------- llnode.gyp.json | 54 ++++++++++++++ package.json | 21 ++++-- scripts/cleanup.js | 19 +++++ scripts/configure.js | 166 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 259 insertions(+), 60 deletions(-) mode change 100644 => 120000 llnode.gyp create mode 100644 llnode.gyp.json create mode 100644 scripts/cleanup.js create mode 100644 scripts/configure.js diff --git a/gyp_llnode b/gyp_llnode index 38f67290..d1891cdf 100755 --- a/gyp_llnode +++ b/gyp_llnode @@ -56,14 +56,14 @@ if __name__ == '__main__': # On msvs it will crash if it gets an absolute path. # On Mac/make it will crash if it doesn't get an absolute path. if sys.platform == 'win32': - args.append(os.path.join(root, 'llnode.gyp')) + args.append(os.path.join(root, 'llnode.gyp.json')) common_fn = os.path.join(root, 'common.gypi') options_fn = os.path.join(root, 'options.gypi') # we force vs 2010 over 2008 which would otherwise be the default for gyp if not os.environ.get('GYP_MSVS_VERSION'): os.environ['GYP_MSVS_VERSION'] = '2010' else: - args.append(os.path.join(os.path.abspath(root), 'llnode.gyp')) + args.append(os.path.join(os.path.abspath(root), 'llnode.gyp.json')) common_fn = os.path.join(os.path.abspath(root), 'common.gypi') options_fn = os.path.join(os.path.abspath(root), 'options.gypi') diff --git a/llnode.gyp b/llnode.gyp deleted file mode 100644 index ce6bd42d..00000000 --- a/llnode.gyp +++ /dev/null @@ -1,54 +0,0 @@ -{ - "variables": { - # gyp does not appear to let you test for undefined variables, so define - # lldb_build_dir as empty so we can test it later. - "lldb_build_dir%": "" - }, - - "targets": [{ - "target_name": "llnode", - "type": "shared_library", - "product_prefix": "", - - "include_dirs": [ - ".", - "<(lldb_dir)/include", - ], - - "sources": [ - "src/llnode.cc", - "src/llv8.cc", - "src/llv8-constants.cc", - "src/llscan.cc", - ], - - "conditions": [ - [ "OS == 'mac'", { - "conditions": [ - [ "lldb_build_dir == ''", { - "variables": { - "mac_shared_frameworks": "/Applications/Xcode.app/Contents/SharedFrameworks", - }, - "xcode_settings": { - "OTHER_LDFLAGS": [ - "-F<(mac_shared_frameworks)", - "-Wl,-rpath,<(mac_shared_frameworks)", - "-framework LLDB", - ], - }, - }, - # lldb_builddir != "" - { - "xcode_settings": { - "OTHER_LDFLAGS": [ - "-Wl,-rpath,<(lldb_build_dir)/lib", - "-L<(lldb_build_dir)/lib", - "-l<(lldb_lib)", - ], - }, - }], - ], - }], - ] - }], -} diff --git a/llnode.gyp b/llnode.gyp new file mode 120000 index 00000000..8061de5a --- /dev/null +++ b/llnode.gyp @@ -0,0 +1 @@ +llnode.gyp.json \ No newline at end of file diff --git a/llnode.gyp.json b/llnode.gyp.json new file mode 100644 index 00000000..ce6bd42d --- /dev/null +++ b/llnode.gyp.json @@ -0,0 +1,54 @@ +{ + "variables": { + # gyp does not appear to let you test for undefined variables, so define + # lldb_build_dir as empty so we can test it later. + "lldb_build_dir%": "" + }, + + "targets": [{ + "target_name": "llnode", + "type": "shared_library", + "product_prefix": "", + + "include_dirs": [ + ".", + "<(lldb_dir)/include", + ], + + "sources": [ + "src/llnode.cc", + "src/llv8.cc", + "src/llv8-constants.cc", + "src/llscan.cc", + ], + + "conditions": [ + [ "OS == 'mac'", { + "conditions": [ + [ "lldb_build_dir == ''", { + "variables": { + "mac_shared_frameworks": "/Applications/Xcode.app/Contents/SharedFrameworks", + }, + "xcode_settings": { + "OTHER_LDFLAGS": [ + "-F<(mac_shared_frameworks)", + "-Wl,-rpath,<(mac_shared_frameworks)", + "-framework LLDB", + ], + }, + }, + # lldb_builddir != "" + { + "xcode_settings": { + "OTHER_LDFLAGS": [ + "-Wl,-rpath,<(lldb_build_dir)/lib", + "-L<(lldb_build_dir)/lib", + "-l<(lldb_lib)", + ], + }, + }], + ], + }], + ] + }], +} diff --git a/package.json b/package.json index ff941ecb..49791667 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,31 @@ { "name": "llnode", - "version": "1.4.0", + "version": "0.0.0", "description": "llnode test suite", "main": "no-entry-sorry.js", "directories": { "test": "test" }, + "//": "We need to use the install scripts as llnode must be built on the machine it's deployed on.", + "//": "(Blame C++)", "scripts": { + "preinstall" : "node scripts/configure.js", + "install" : "./gyp_llnode && make -C out/", + "postinstall" : "node scripts/cleanup.js", "test": "tape test/*-test.js" }, "repository": { "type": "git", - "url": "git+ssh://git@github.com/indutny/llnode.git" + "url": "git+ssh://git@github.com/nodejs/llnode.git" }, + "files" : [ + "llnode.gyp.json", + "gyp_llnode", + "common.gypi", + "src/", + "scripts/", + "out/" + ], "keywords": [ "llnode", "post", @@ -22,9 +35,9 @@ "license": "MIT", "gypfile": true, "bugs": { - "url": "https://github.com/indutny/llnode/issues" + "url": "https://github.com/nodejs/llnode/issues" }, - "homepage": "https://github.com/indutny/llnode#readme", + "homepage": "https://github.com/nodejs/llnode#readme", "devDependencies": { "tape": "^4.4.0" } diff --git a/scripts/cleanup.js b/scripts/cleanup.js new file mode 100644 index 00000000..aff2be3b --- /dev/null +++ b/scripts/cleanup.js @@ -0,0 +1,19 @@ +var os = require('os'); +var child_process = require('child_process'); + +var cwd = process.cwd(); +var osName = os.type(); +var libExt = "so"; + +if (osName === 'Darwin') { + libExt = "dylib"; +} + +var llnodeLib = "llnode." + libExt; + +// Move the library somewhere easy to remember. +console.log('Copying ' + cwd + '/out/Release/' + llnodeLib + ' to ' + cwd + '/' + llnodeLib); +child_process.execSync('mv ' + cwd + '/out/Release/' + llnodeLib + ' ' + cwd + '/' + llnodeLib ); + +console.log(os.EOL + 'llnode plugin installed, load in lldb with:'); +console.log('(lldb) plugin load ' + cwd + '/' + llnodeLib + os.EOL); diff --git a/scripts/configure.js b/scripts/configure.js new file mode 100644 index 00000000..0d402b67 --- /dev/null +++ b/scripts/configure.js @@ -0,0 +1,166 @@ +const os = require('os'); +const fs = require('fs'); +const child_process = require('child_process'); + +const lldbReleases = { + '3.9': 'release_39', + '3.8': 'release_38', + '3.7': 'release_37', + '3.6': 'release_36', + '3.5': 'release_35', + '3.4': 'release_34', +}; + +const buildDir = process.cwd(); + +console.log('Build dir is: ' + buildDir); + +const osName = os.type(); + +var lldbVersion; +var lldbHeadersBranch; +var lldbIncludeDir; + +// Need to determine: +// - What level of lldb we are running. +// - If we need the headers. (Linux may have them installed) +if (osName === 'Darwin') { + + lldbVersion = getDarwinRelease(); + + if(lldbVersion === undefined) { + console.log('Unable to locate lldb binary. llnode installation failed.'); + process.exit(1); + } + + lldbHeadersBranch = lldbReleases[lldbVersion]; + lldbIncludeDir = 'lldb-' + lldbVersion; + +} else if ( osName === 'Linux') { + + lldbVersion = getLinuxVersion(); + + if(lldbVersion === undefined) { + console.log('Unable to locate lldb binary. llnode installation failed.'); + process.exit(1); + } + + // console.log('lldb_version is ' + lldb_version) + var installedHeadersDir = getLinuxHeadersDir(lldbVersion); + // console.log('installed_headers_dir is ' + installed_headers_dir); + if (installedHeadersDir === undefined) { + // Initialising lldb_headers_branch will cause us to clone them. + lldbHeadersBranch = lldbReleases[lldbVersion]; + lldbIncludeDir = 'lldb-' + lldbVersion; + } else { + lldbIncludeDir = installedHeadersDir; + } +} + +console.log('Installing llnode for lldb version ' + lldbVersion); + +// Check out source code of the LLDB that is compatible with OS X's default lldb +// TODO: The llvm project is probably moving to github soon at that point we +// should stop using the mirror. +if (lldbHeadersBranch != undefined) { + console.log('Cloning lldb from ' + lldbHeadersBranch); + child_process.execFileSync('git', ['clone', '--depth=1', '-b', lldbHeadersBranch, 'https://github.com/llvm-mirror/lldb.git', lldbIncludeDir], + {cwd: buildDir}); +} + +// Link to the headers file so we can run gyp_llnode directly and don't need to +// setup +// parameters to pass it. +console.log('Linking lldb to include directory ' + lldbIncludeDir); +fs.symlinkSync(lldbIncludeDir, 'lldb'); + +// Initialize GYP +// We can use the node-gyp that comes with npm. +// We can locate it with npm -g explore npm npm explore node-gyp pwd +// It might have been neater to make node-gyp one of our dependencies +// *but* they don't get installed until after the install step has run. +var gypDir = child_process.execFileSync('npm', ['-g', 'explore', 'npm', 'npm', 'explore', 'node-gyp', 'pwd'], {cwd: buildDir}).toString().trim(); +fs.mkdirSync('tools'); +console.log('Linking tools/gyp to ' + gypDir+'/gyp'); +fs.symlinkSync(gypDir + '/gyp', 'tools/gyp'); + +// Exit with success. +process.exit(0); + +// On Mac the lldb version string doesn't match the original lldb versions. +function getDarwinRelease() { + var xcodeStr; + try { + xcodeStr = child_process.execFileSync('xcodebuild', ['-version']).toString(); + } catch(err) { + return undefined; + } + var versionStr = ''; + var splitStr = xcodeStr.split(os.EOL); + for( var str of splitStr) { + if (str.indexOf('Xcode') != -1) { + versionStr = str.split(' ')[1]; + break; + } + } + // console.log('Xcode version is ' + version_str) + + var version = parseFloat(versionStr); + if (version > 8.0) { + return '3.8'; + } else { + return '3.4'; + } +} + +// There are multiple versions of lldb available for the various linux distos. +// Use the default unless --llnode_version= has been set on the command line. +function getLinuxVersion() { + + // TODO - Allow the user to specify the version of lldb to use, e.g: + // lldb-3.9 instead of lldb as Linux has packages for multiple versions + // of lldb. + var lldbStr; + try { + lldbStr = child_process.execFileSync('lldb', ['-v']).toString(); + } catch(err) { + return undefined; + } + // Ignore minor revisions like 3.8.1 + if (lldbStr.indexOf('version 3.9') > 0) { + return '3.9'; + } else if (lldbStr.indexOf('version 3.8') > 0) { + return '3.8'; + } else if (lldbStr.indexOf('version 3.7') > 0) { + return '3.7'; + } if (lldbStr.indexOf('version 3.6') > 0) { + return '3.6'; + } if (lldbStr.indexOf('version 3.5') > 0) { + return '3.5'; + } + return undefined; +} + +function getLinuxHeadersDir(version) { + // Get the directory which should contain the headers and + // check if they are present. + // (Using the installed headers will ensure we have the correct ones.) + console.log('Checking for headers, version is ' + version); + try { + var includeDir = child_process.execFileSync('llvm-config-' + version, ['--prefix']).toString().trim(); + // console.log('Checking for directory ' + include_dir); + // Include directory doesn't need include/lldb on the end but the llvm + // headers can be installed without the lldb headers so check for them. + if (fs.existsSync(includeDir + '/include/lldb')) { + // console.log('Found ' + include_dir); + return includeDir; + } + } catch(err) { + // Return undefined, we will download the headers. + } + // On Redhat the headers are just installed in /usr/include + if (fs.existsSync('/usr/include/lldb')) { + return '/usr'; + } + return undefined; +} From 76cbbfb75cdcc3c07ebacec34069dbcd307f7a23 Mon Sep 17 00:00:00 2001 From: Howard Hellyer Date: Mon, 12 Dec 2016 14:15:23 +0000 Subject: [PATCH 2/5] Improve detection of lldb executable on Linux. - If lldb doesn't exist try lldb-3.9,3.8,3.7 etc instead. - Allow install scripts guess to be overridden with --lldb_exe option e.g. npm install --lldb_exe=`which lldb-3.9` --- scripts/configure.js | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/scripts/configure.js b/scripts/configure.js index 0d402b67..a752d651 100644 --- a/scripts/configure.js +++ b/scripts/configure.js @@ -3,6 +3,7 @@ const fs = require('fs'); const child_process = require('child_process'); const lldbReleases = { + '4.0': 'master', '3.9': 'release_39', '3.8': 'release_38', '3.7': 'release_37', @@ -24,6 +25,8 @@ var lldbIncludeDir; // Need to determine: // - What level of lldb we are running. // - If we need the headers. (Linux may have them installed) +var lldbExe = 'lldb'; + if (osName === 'Darwin') { lldbVersion = getDarwinRelease(); @@ -38,7 +41,8 @@ if (osName === 'Darwin') { } else if ( osName === 'Linux') { - lldbVersion = getLinuxVersion(); + lldbExe = getLldbExecutable(); + lldbVersion = getLinuxVersion(lldbExe); if(lldbVersion === undefined) { console.log('Unable to locate lldb binary. llnode installation failed.'); @@ -57,7 +61,7 @@ if (osName === 'Darwin') { } } -console.log('Installing llnode for lldb version ' + lldbVersion); +console.log('Installing llnode for ' + lldbExe + ', lldb version ' + lldbVersion); // Check out source code of the LLDB that is compatible with OS X's default lldb // TODO: The llvm project is probably moving to github soon at that point we @@ -113,21 +117,43 @@ function getDarwinRelease() { } } +// Find the 'best' lldb to use. Either: +// - the one specified by the user using npm --llnode_exe=... install llnode +// - the default lldb executable +// - the higest known lldb version +function getLldbExecutable() { + var lldbExe = process.env.npm_config_lldb_exe; + if (lldbExe === undefined) { + var lldbExeNames = ['lldb', 'lldb-4.0', 'lldb-3.9', 'lldb-3.8', 'lldb-3.7', 'lldb-3.6'] + for (lldbExeVersion of lldbExeNames) { + try { + lldbExe = child_process.execSync('which ' + lldbExeVersion).toString().trim(); + // If the result starts with '/' `which` found a path. + if (lldbExe.startsWith('/')) { + break; + } + } catch(err) { + // Do nothing - we expect not to find some of these. + } + } + } + return lldbExe; +} + // There are multiple versions of lldb available for the various linux distos. -// Use the default unless --llnode_version= has been set on the command line. -function getLinuxVersion() { +// Use the default unless --llnode_exe= has been set on the command line. +function getLinuxVersion(lldbExe) { - // TODO - Allow the user to specify the version of lldb to use, e.g: - // lldb-3.9 instead of lldb as Linux has packages for multiple versions - // of lldb. var lldbStr; try { - lldbStr = child_process.execFileSync('lldb', ['-v']).toString(); + lldbStr = child_process.execFileSync(lldbExe, ['-v']).toString(); } catch(err) { return undefined; } // Ignore minor revisions like 3.8.1 - if (lldbStr.indexOf('version 3.9') > 0) { + if (lldbStr.indexOf('version 4.0') > 0) { + return '4.0'; + } else if (lldbStr.indexOf('version 3.9') > 0) { return '3.9'; } else if (lldbStr.indexOf('version 3.8') > 0) { return '3.8'; From 848005f284643d2e6ca75c35c3d48e8d031f65fb Mon Sep 17 00:00:00 2001 From: Howard Hellyer Date: Mon, 9 Jan 2017 10:56:30 +0000 Subject: [PATCH 3/5] package.json: test install from npmjs.org Set the version to 0.0.1 to allow the install process from npmjs.org to be tested. It can be corrected to the current version when this branch is merged into master. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 49791667..28e0e4d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "llnode", - "version": "0.0.0", + "version": "0.0.1", "description": "llnode test suite", "main": "no-entry-sorry.js", "directories": { From 2e5461d4195534f8cf5ab6f5b038be3d84e5c36c Mon Sep 17 00:00:00 2001 From: Howard Hellyer Date: Tue, 10 Jan 2017 11:28:52 +0000 Subject: [PATCH 4/5] Run eslint and fix code formatting issues. --- scripts/cleanup.js | 24 +++++++++-------- scripts/configure.js | 63 +++++++++++++++++++++++++------------------- 2 files changed, 49 insertions(+), 38 deletions(-) diff --git a/scripts/cleanup.js b/scripts/cleanup.js index aff2be3b..9eec4796 100644 --- a/scripts/cleanup.js +++ b/scripts/cleanup.js @@ -1,19 +1,21 @@ -var os = require('os'); -var child_process = require('child_process'); +'use strict'; -var cwd = process.cwd(); -var osName = os.type(); -var libExt = "so"; +const os = require('os'); +const child_process = require('child_process'); + +const cwd = process.cwd(); +const osName = os.type(); +var libExt = 'so'; if (osName === 'Darwin') { - libExt = "dylib"; + libExt = 'dylib'; } -var llnodeLib = "llnode." + libExt; +const llnodeLib = `llnode.${libExt}`; // Move the library somewhere easy to remember. -console.log('Copying ' + cwd + '/out/Release/' + llnodeLib + ' to ' + cwd + '/' + llnodeLib); -child_process.execSync('mv ' + cwd + '/out/Release/' + llnodeLib + ' ' + cwd + '/' + llnodeLib ); +console.log(`Copying ${cwd}/out/Release/${llnodeLib} to ${cwd}/${llnodeLib}`); +child_process.execSync(`mv ${cwd}/out/Release/${llnodeLib} ${cwd}/${llnodeLib}`); -console.log(os.EOL + 'llnode plugin installed, load in lldb with:'); -console.log('(lldb) plugin load ' + cwd + '/' + llnodeLib + os.EOL); +console.log(`${os.EOL}llnode plugin installed, load in lldb with:`); +console.log(`(lldb) plugin load ${cwd}/${llnodeLib}${os.EOL}`); diff --git a/scripts/configure.js b/scripts/configure.js index a752d651..abd312fa 100644 --- a/scripts/configure.js +++ b/scripts/configure.js @@ -1,3 +1,5 @@ +'use strict'; + const os = require('os'); const fs = require('fs'); const child_process = require('child_process'); @@ -31,7 +33,7 @@ if (osName === 'Darwin') { lldbVersion = getDarwinRelease(); - if(lldbVersion === undefined) { + if (lldbVersion === undefined) { console.log('Unable to locate lldb binary. llnode installation failed.'); process.exit(1); } @@ -39,12 +41,12 @@ if (osName === 'Darwin') { lldbHeadersBranch = lldbReleases[lldbVersion]; lldbIncludeDir = 'lldb-' + lldbVersion; -} else if ( osName === 'Linux') { +} else if (osName === 'Linux') { lldbExe = getLldbExecutable(); lldbVersion = getLinuxVersion(lldbExe); - if(lldbVersion === undefined) { + if (lldbVersion === undefined) { console.log('Unable to locate lldb binary. llnode installation failed.'); process.exit(1); } @@ -61,21 +63,22 @@ if (osName === 'Darwin') { } } -console.log('Installing llnode for ' + lldbExe + ', lldb version ' + lldbVersion); +console.log(`Installing llnode for ${lldbExe}, lldb version ${lldbVersion}`); // Check out source code of the LLDB that is compatible with OS X's default lldb // TODO: The llvm project is probably moving to github soon at that point we // should stop using the mirror. if (lldbHeadersBranch != undefined) { console.log('Cloning lldb from ' + lldbHeadersBranch); - child_process.execFileSync('git', ['clone', '--depth=1', '-b', lldbHeadersBranch, 'https://github.com/llvm-mirror/lldb.git', lldbIncludeDir], - {cwd: buildDir}); + child_process.execFileSync('git', + ['clone', '--depth=1', '-b', lldbHeadersBranch, + 'https://github.com/llvm-mirror/lldb.git', lldbIncludeDir], + {cwd: buildDir}); } // Link to the headers file so we can run gyp_llnode directly and don't need to -// setup -// parameters to pass it. -console.log('Linking lldb to include directory ' + lldbIncludeDir); +// setup parameters to pass it. +console.log(`Linking lldb to include directory ${lldbIncludeDir}`); fs.symlinkSync(lldbIncludeDir, 'lldb'); // Initialize GYP @@ -83,10 +86,12 @@ fs.symlinkSync(lldbIncludeDir, 'lldb'); // We can locate it with npm -g explore npm npm explore node-gyp pwd // It might have been neater to make node-gyp one of our dependencies // *but* they don't get installed until after the install step has run. -var gypDir = child_process.execFileSync('npm', ['-g', 'explore', 'npm', 'npm', 'explore', 'node-gyp', 'pwd'], {cwd: buildDir}).toString().trim(); +var gypDir = child_process.execFileSync('npm', + ['-g', 'explore', 'npm', 'npm', 'explore', 'node-gyp', 'pwd'], + {cwd: buildDir}).toString().trim(); fs.mkdirSync('tools'); -console.log('Linking tools/gyp to ' + gypDir+'/gyp'); -fs.symlinkSync(gypDir + '/gyp', 'tools/gyp'); +console.log(`Linking tools/gyp to ${gypDir}/gyp`); +fs.symlinkSync(`${gypDir}/gyp`, 'tools/gyp'); // Exit with success. process.exit(0); @@ -95,18 +100,19 @@ process.exit(0); function getDarwinRelease() { var xcodeStr; try { - xcodeStr = child_process.execFileSync('xcodebuild', ['-version']).toString(); - } catch(err) { + xcodeStr = child_process.execFileSync('xcodebuild', ['-version']) + .toString(); + } catch (err) { return undefined; } var versionStr = ''; - var splitStr = xcodeStr.split(os.EOL); - for( var str of splitStr) { - if (str.indexOf('Xcode') != -1) { - versionStr = str.split(' ')[1]; - break; - } + var splitStr = xcodeStr.split(os.EOL); + for (var str of splitStr) { + if (str.indexOf('Xcode') != -1) { + versionStr = str.split(' ')[1]; + break; } + } // console.log('Xcode version is ' + version_str) var version = parseFloat(versionStr); @@ -124,15 +130,17 @@ function getDarwinRelease() { function getLldbExecutable() { var lldbExe = process.env.npm_config_lldb_exe; if (lldbExe === undefined) { - var lldbExeNames = ['lldb', 'lldb-4.0', 'lldb-3.9', 'lldb-3.8', 'lldb-3.7', 'lldb-3.6'] - for (lldbExeVersion of lldbExeNames) { + var lldbExeNames = ['lldb', 'lldb-4.0', 'lldb-3.9', + 'lldb-3.8', 'lldb-3.7', 'lldb-3.6']; + for (var lldbExeVersion of lldbExeNames) { try { - lldbExe = child_process.execSync('which ' + lldbExeVersion).toString().trim(); + lldbExe = child_process.execSync('which ' + + lldbExeVersion).toString().trim(); // If the result starts with '/' `which` found a path. if (lldbExe.startsWith('/')) { break; } - } catch(err) { + } catch (err) { // Do nothing - we expect not to find some of these. } } @@ -147,7 +155,7 @@ function getLinuxVersion(lldbExe) { var lldbStr; try { lldbStr = child_process.execFileSync(lldbExe, ['-v']).toString(); - } catch(err) { + } catch (err) { return undefined; } // Ignore minor revisions like 3.8.1 @@ -173,7 +181,8 @@ function getLinuxHeadersDir(version) { // (Using the installed headers will ensure we have the correct ones.) console.log('Checking for headers, version is ' + version); try { - var includeDir = child_process.execFileSync('llvm-config-' + version, ['--prefix']).toString().trim(); + var includeDir = child_process.execFileSync('llvm-config-' + version, + ['--prefix']).toString().trim(); // console.log('Checking for directory ' + include_dir); // Include directory doesn't need include/lldb on the end but the llvm // headers can be installed without the lldb headers so check for them. @@ -181,7 +190,7 @@ function getLinuxHeadersDir(version) { // console.log('Found ' + include_dir); return includeDir; } - } catch(err) { + } catch (err) { // Return undefined, we will download the headers. } // On Redhat the headers are just installed in /usr/include From 7813eb0da5627f48489df9660fc92f487df3754a Mon Sep 17 00:00:00 2001 From: Howard Hellyer Date: Tue, 10 Jan 2017 13:11:19 +0000 Subject: [PATCH 5/5] Restore version to 1.4.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 28e0e4d9..e4f00bf5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "llnode", - "version": "0.0.1", + "version": "1.4.1", "description": "llnode test suite", "main": "no-entry-sorry.js", "directories": {