Skip to content

Commit

Permalink
Merge pull request #36 from aminya/winx86
Browse files Browse the repository at this point in the history
32 bit builds for Windows
  • Loading branch information
DeMoorJasper authored Dec 14, 2020
2 parents 2fba112 + c5e0f4b commit 539f6ea
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 16 deletions.
8 changes: 8 additions & 0 deletions azure-pipelines-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ parameters:
- name: 'container'
type: string
default: ''
- name: 'is32bit'
type: string
default: 'false'

jobs:
- job: ${{ parameters.name }}
Expand All @@ -25,6 +28,7 @@ jobs:
- task: NodeTool@0
inputs:
versionSpec: $(node_version)
force32bit: ${{ parameters.is32bit }}
displayName: "Install Node.js"
- script: npm install --build-from-source
displayName: Install dependencies
Expand Down Expand Up @@ -61,6 +65,10 @@ jobs:
- script: npm run prebuild
displayName: Test prebuild

- script: npm run prebuild-ia32
displayName: Test prebuild-ia32
condition: eq('${{ parameters.is32bit }}', 'true')

- task: PublishBuildArtifacts@1
displayName: Publish Native Artifacts
condition: and(succeeded(), eq(variables['publish_artifacts'], 'true'))
Expand Down
6 changes: 6 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ jobs:
name: Windows
vmImage: vs2017-win2016

- template: azure-pipelines-template.yml
parameters:
name: Windowsx86
vmImage: vs2017-win2016
is32bit: true

- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/v') }}:
- job: Publish
condition: succeeded()
Expand Down
26 changes: 14 additions & 12 deletions bench/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,21 @@ init.then(() => {
map.delete();
});

suite.add('combine 1000 maps using flatbuffers and stringify', async () => {
let map = new SourceMap();
for (let i = 0; i < 1000; i++) {
map.addBufferMappings(sourcemapBuffer, i * 4);
}
await map.stringify({
file: 'index.js.map',
sourceRoot: '/',
// We don't wanna benchmark JSON.stringify...
format: 'object',
if (!(process.platform === 'win32' && process.arch === 'ia32')) {
suite.add('combine 1000 maps using flatbuffers and stringify', async () => {
let map = new SourceMap();
for (let i = 0; i < 1000; i++) {
map.addBufferMappings(sourcemapBuffer, i * 4);
}
await map.stringify({
file: 'index.js.map',
sourceRoot: '/',
// We don't wanna benchmark JSON.stringify...
format: 'object',
});
map.delete();
});
map.delete();
});
}

suite.run();
});
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@
"compile-wasm": "make clean && make -j4",
"transpile": "babel ./src/*.js --out-dir ./dist && flow-copy-source -v src dist",
"prebuild": "prebuildify -t 10.20.1 --napi --strip --tag-libc",
"prebuild-ia32": "prebuildify -t 12.13.0 --napi --strip --tag-libc --arch=ia32",
"build:dev": "node-gyp rebuild --debug",
"rebuild": "rm -rf build && yarn build:dev",
"rebuild": "shx rm -rf build && yarn build:dev",
"rebuild-all": "yarn transpile && yarn compile-wasm && yarn rebuild",
"install": "node-gyp-build",
"prepublish": "npm run transpile",
"lint": "prettier --write bench/run.js src/*.js",
"typecheck": "flow",
"format": "prettier --write \"./**/*.{js,md,mdx}\"",
"compile-schema": "./flatc --cpp -o ./src ./src/sourcemap-schema.fbs",
"clean": "rm -rf dist build"
"clean": "shx rm -rf dist build"
},
"husky": {
"hooks": {
Expand Down Expand Up @@ -56,7 +57,7 @@
},
"dependencies": {
"node-addon-api": "^3.0.0",
"node-gyp-build": "^4.2.2"
"node-gyp-build": "^4.2.3"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
Expand All @@ -71,8 +72,9 @@
"husky": "4.2.5",
"lint-staged": "^10.2.9",
"mocha": "^7.1.2",
"prebuildify": "^4.0.0",
"prebuildify": "^4.1.1",
"prettier": "^2.0.5",
"shx": "^0.3.3",
"source-map": "^0.7.3",
"tiny-benchy": "^1.0.0"
}
Expand Down

0 comments on commit 539f6ea

Please sign in to comment.