diff --git a/azure-pipelines-template.yml b/azure-pipelines-template.yml index c109e1df..6c4ea5ee 100644 --- a/azure-pipelines-template.yml +++ b/azure-pipelines-template.yml @@ -6,6 +6,9 @@ parameters: - name: 'container' type: string default: '' +- name: 'is32bit' + type: string + default: 'false' jobs: - job: ${{ parameters.name }} @@ -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 @@ -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')) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e27bc22c..af262194 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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() diff --git a/bench/run.js b/bench/run.js index a84951c7..12e7c8e2 100644 --- a/bench/run.js +++ b/bench/run.js @@ -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(); }); diff --git a/package.json b/package.json index aa202c2e..9fd1cc4f 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,9 @@ "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", @@ -24,7 +25,7 @@ "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": { @@ -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", @@ -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" }