Compare commits

...

5 Commits

Author SHA1 Message Date
calebboyd 1023b72513 fix: update patches for node 12 bootstrapping 2019-06-12 16:04:17 -05:00
calebboyd 0cf436c9a7 chore: dep bump 2019-06-11 10:42:26 -05:00
calebboyd 77f49eb07a fix: asset alias 2019-06-11 10:36:09 -05:00
calebboyd 9bc98bf597 ci: fix gcc version 2019-06-10 15:50:26 -05:00
calebboyd 7e9a05675c fix: reference ogfs in readFilePath for internalmethods 2019-06-05 15:03:49 -05:00
9 changed files with 65 additions and 102 deletions
+4 -4
View File
@@ -25,15 +25,15 @@ jobs:
displayName: Install Node
inputs:
versionSpec: '10.x'
- script: sudo apt-get install -y libc6-dev-i386 gcc-multilib g++-multilib
condition: eq(variables['Agent.JobName'], 'linux')
- script: sudo apt-get update && sudo apt-get install -y libc6-dev-i386 gcc-multilib g++-multilib
condition: contains(variables['Agent.JobName'], 'linux')
displayName: Install Linux Build Dependencies
- script: choco install visualcpp-build-tools --version 14.0.25420.1 -fy && npm config set msvs_version 2015
condition: startsWith(variables['Agent.JobName'], 'windows_2015')
condition: contains(variables['Agent.JobName'], 'windows_2015')
displayName: Install Windows Build Dependencies
- script: choco install nasm -fy
displayName: Install Windows Assembler (NASM)
condition: startsWith(variables['Agent.JobName'], 'windows')
condition: contains(variables['Agent.JobName'], 'windows')
- script: npm install && npm run ci:build
displayName: Build Nexe
env:
+17 -17
View File
@@ -1,6 +1,6 @@
{
"name": "nexe",
"version": "3.2.0",
"version": "3.3.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -158,9 +158,9 @@
}
},
"@types/mocha": {
"version": "5.2.6",
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.6.tgz",
"integrity": "sha512-1axi39YdtBI7z957vdqXI4Ac25e7YihYQtJa+Clnxg1zTJEaIRbndt71O3sP4GAMgiAm0pY26/b9BrY4MR/PMw==",
"version": "5.2.7",
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz",
"integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==",
"dev": true
},
"@types/multistream": {
@@ -2529,9 +2529,9 @@
"integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc="
},
"prettier": {
"version": "1.17.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.17.1.tgz",
"integrity": "sha512-TzGRNvuUSmPgwivDqkZ9tM/qTGW9hqDKWOE9YHiyQdixlKbv7kvEqsmDPrcHJTKwthU774TQwZXVtaQ/mMsvjg==",
"version": "1.18.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz",
"integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==",
"dev": true
},
"process-nextick-args": {
@@ -2614,9 +2614,9 @@
"dev": true
},
"resolve": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz",
"integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==",
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz",
"integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==",
"dev": true,
"requires": {
"path-parse": "^1.0.6"
@@ -3141,9 +3141,9 @@
"dev": true
},
"tslint": {
"version": "5.16.0",
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.16.0.tgz",
"integrity": "sha512-UxG2yNxJ5pgGwmMzPMYh/CCnCnh0HfPgtlVRDs1ykZklufFBL1ZoTlWFRz2NQjcoEiDoRp+JyT0lhBbbH/obyA==",
"version": "5.17.0",
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.17.0.tgz",
"integrity": "sha512-pflx87WfVoYepTet3xLfDOLDm9Jqi61UXIKePOuca0qoAZyrGWonDG9VTbji58Fy+8gciUn8Bt7y69+KEVjc/w==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
@@ -3152,7 +3152,7 @@
"commander": "^2.12.1",
"diff": "^3.2.0",
"glob": "^7.1.1",
"js-yaml": "^3.13.0",
"js-yaml": "^3.13.1",
"minimatch": "^3.0.4",
"mkdirp": "^0.5.1",
"resolve": "^1.3.2",
@@ -3202,9 +3202,9 @@
"dev": true
},
"typescript": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.5.tgz",
"integrity": "sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==",
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.1.tgz",
"integrity": "sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw==",
"dev": true
},
"unbzip2-stream": {
+5 -5
View File
@@ -2,7 +2,7 @@
"name": "nexe",
"description": "Create a single executable out of your Node.js application",
"license": "MIT",
"version": "3.2.1",
"version": "3.3.0",
"contributors": [
"Craig Condon <craig.j.condon@gmail.com> (http://crcn.io)",
"Jared Allard <jaredallard@outlook.com>",
@@ -57,7 +57,7 @@
"@types/got": "^9.4.4",
"@types/minimist": "^1.2.0",
"@types/mkdirp": "^0.5.2",
"@types/mocha": "^5.2.6",
"@types/mocha": "^5.2.7",
"@types/multistream": "^2.1.1",
"@types/ora": "^3.2.0",
"@types/pify": "3.0.2",
@@ -66,11 +66,11 @@
"chai": "^4.2.0",
"execa": "^1.0.0",
"mocha": "^6.1.4",
"prettier": "^1.17.1",
"prettier": "^1.18.2",
"ts-node": "^8.2.0",
"tslint": "^5.16.0",
"tslint": "^5.17.0",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.0.1",
"typescript": "^3.4.5"
"typescript": "^3.5.1"
}
}
+8 -8
View File
@@ -196,19 +196,19 @@ function shimFs(binary: NexeBinary, fs: any = require('fs')) {
const encoding = fileOpts(options).encoding
callback = typeof options === 'function' ? options : callback
fs.open(blobPath, 'r', function(err: Error, fd: number) {
originalFsMethods.open(blobPath, 'r', function(err: Error, fd: number) {
if (err) return callback(err, null)
fs.read(fd, Buffer.alloc(length), 0, length, resourceOffset, function(
originalFsMethods.read(fd, Buffer.alloc(length), 0, length, resourceOffset, function(
error: Error,
bytesRead: number,
result: Buffer
) {
if (error) {
return fs.close(fd, function() {
return originalFsMethods.close(fd, function() {
callback(error, null)
})
}
fs.close(fd, function(err: Error) {
originalFsMethods.close(fd, function(err: Error) {
if (err) {
return callback(err, result)
}
@@ -227,7 +227,7 @@ function shimFs(binary: NexeBinary, fs: any = require('fs')) {
const resourceOffset = resourceStart + offset
const opts = fileOpts(options)
return fs.createReadStream(
return originalFsMethods.createReadStream(
blobPath,
Object.assign({}, opts, {
start: resourceOffset,
@@ -244,10 +244,10 @@ function shimFs(binary: NexeBinary, fs: any = require('fs')) {
const [offset, length] = entry
const resourceOffset = resourceStart + offset
const encoding = fileOpts(options).encoding
const fd = fs.openSync(process.execPath, 'r')
const fd = originalFsMethods.openSync(process.execPath, 'r')
const result = Buffer.alloc(length)
fs.readSync(fd, result, 0, length, resourceOffset)
fs.closeSync(fd)
originalFsMethods.readSync(fd, result, 0, length, resourceOffset)
originalFsMethods.closeSync(fd)
return encoding ? result.toString(encoding) : result
},
statSync: function statSync(filepath: string | Buffer) {
+1 -1
View File
@@ -80,7 +80,7 @@ const alias = {
b: 'build',
n: 'name',
r: 'resource',
a: 'resource',
a: 'asset',
p: 'python',
f: 'flag',
c: 'configure',
+21 -5
View File
@@ -1,6 +1,6 @@
import { NexeCompiler } from '../compiler'
import { parse } from 'cherow'
import { semverGt } from '../util'
import { wrap, semverGt } from '../util'
function walkSome(node: any, visit: Function) {
if (!node || typeof node.type !== 'string' || node._visited) {
@@ -29,6 +29,8 @@ export default async function main(compiler: NexeCompiler, next: () => Promise<v
if (version.startsWith('4.')) {
bootFile = 'src/node.js'
} else if (semverGt(version, '11.99')) {
bootFile = 'lib/internal/bootstrap/pre_execution.js'
} else if (semverGt(version, '9.10.1')) {
bootFile = 'lib/internal/bootstrap/node.js'
}
@@ -56,9 +58,23 @@ export default async function main(compiler: NexeCompiler, next: () => Promise<v
fileLines.splice(location.start.line, 0, '{{replace:lib/fs/bootstrap.js}}' + '\n')
file.contents = fileLines.join('\n')
await compiler.setFileContentsAsync(
'lib/_third_party_main.js',
'{{replace:lib/patches/boot-nexe.js}}'
)
if (semverGt(version, '11.99')) {
await compiler.replaceInFileAsync(
bootFile,
'initializePolicy();',
'initializePolicy();\n' + wrap('{{replace:lib/patches/boot-nexe.js}}')
)
await compiler.replaceInFileAsync(
'src/node.cc',
'MaybeLocal<Value> StartMainThreadExecution(Environment* env) {',
'MaybeLocal<Value> StartMainThreadExecution(Environment* env) {\n' +
' return StartExecution(env, "internal/main/run_main_module");\n'
)
} else {
await compiler.setFileContentsAsync(
'lib/_third_party_main.js',
'{{replace:lib/patches/boot-nexe.js}}'
)
}
return next()
}
+7 -2
View File
@@ -2,7 +2,7 @@ import { NexeCompiler, NexeError } from '../compiler'
import { resolve, relative } from 'path'
import { each } from '@calebboyd/semaphore'
import resolveFiles, { resolveFileNameSync } from 'resolve-dependencies'
import { dequote, STDIN_FLAG } from '../util'
import { dequote, STDIN_FLAG, semverGt } from '../util'
import { Readable } from 'stream'
function getStdIn(stdin: Readable): Promise<string> {
@@ -29,7 +29,12 @@ export default async function bundle(compiler: NexeCompiler, next: any) {
const { bundle, cwd, input: inputPath } = compiler.options
let input = inputPath
compiler.entrypoint = './' + relative(cwd, input)
compiler.startup = ';require("module").runMain();'
if (semverGt(compiler.target.version, '11.99')) {
compiler.startup = ''
} else {
compiler.startup = ';require("module").runMain();'
}
if (!bundle) {
await compiler.addResource(resolve(cwd, input))
+2 -2
View File
@@ -41,7 +41,7 @@ async function build() {
else if (isWindows) target = windowsBuild
else if (isMac) target = macBuild
else if (isLinux) target = linux
if (buildHost === 'alpine') target = alpine
if (buildHost.includes('alpine')) target = alpine
if (!target) {
return console.log('Nothing to build...')
@@ -67,7 +67,7 @@ async function build() {
if (
[/*'arm7l', 'arm6l', 'arm64', */ 'alpine'].includes(target.platform) &&
buildHost === 'alpine'
buildHost.includes('alpine')
) {
await runDockerBuild(target)
} else {
-58
View File
@@ -1,58 +0,0 @@
import { NexeTarget } from '../lib/releases'
import got = require('got')
import * as assert from 'assert'
import { getTarget } from '../lib/target'
const { env } = process
export function triggerMacBuild(release: NexeTarget, branch: string) {
assert.ok(env.CIRCLE_TOKEN)
const circle = `https://circleci.com/api/v1.1/project/github/nexe/nexe/tree/${branch}?circle-token=${
env.CIRCLE_TOKEN
}`
return got(circle, {
json: true,
body: {
build_parameters: {
NEXE_VERSION: release.toString()
}
}
})
}
export function triggerDockerBuild(release: NexeTarget, branch: string) {
assert.ok(env.TRAVIS_TOKEN)
const travis = `https://api.travis-ci.org/repo/nexe%2Fnexe/requests`
return got(travis, {
json: true,
body: {
request: {
branch: branch,
config: {
merge_mode: 'deep_merge',
env: {
//use matrix so that secure global variable is merged
matrix: {
NEXE_VERSION: release.toString()
}
}
}
}
},
headers: {
'Travis-API-Version': '3',
Authorization: `token ${env.TRAVIS_TOKEN}`
}
})
}
export function triggerWindowsBuild(release: NexeTarget) {
const version = 'NEXE_VERSION' in env ? env.NEXE_VERSION!.trim() : release.toString()
if (getTarget(version).version.startsWith('10.')) {
if ((env.APPVEYOR_BUILD_WORKER_IMAGE || '').includes('2017')) {
env.NEXE_VERSION = version
}
} else {
env.NEXE_VERSION = version
}
return Promise.resolve()
}