Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor build improvements #614

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,20 @@
"tsconfig.json"
],
"scripts": {
"install": "(shx test -f ./script/build.js || run-s build.js) && cross-env npm_config_build_from_source=true aminya-node-gyp-build",
"clean": "shx rm -rf ./build ./lib/ ./prebuilds ./script/*.js ./script/*.js.map ./script/*.d.ts ./script/*.tsbuildinfo",
"clean.temp": "shx rm -rf ./tmp && shx mkdir -p ./tmp",
"preinstall": "run-s build.script",
"prepare": "run-s build.library",
"clean": "shx rm -rf ./build ./lib/ ./prebuilds",
"clean.temp": "shx rm -rf ./tmp && shx mkdir -p ./tmp && shx touch ./tmp/.gitkeep",
"deploy.doc": "run-s build.doc && gh-pages --dist \"./docs\"",
"install": "aminya-node-gyp-build",
"build.library": "tsc -p ./src/tsconfig.json",
"build.script": "tsc -p ./script/tsconfig.json && tsc -p ./script/tsconfig.esm.json",
"build.js": "run-p build.script build.library",
"build.doc": "typedoc --options ./typedoc.json && minify-all -s docs-raw -d docs --jsCompressor terser",
"deploy.doc": "run-s build.doc && gh-pages --dist \"./docs\"",
"build.prebuild": "run-s build.js && node ./script/prebuild.mjs",
"build.prebuild": "node ./script/prebuild.mjs",
"build.native": "node-gyp configure --release && node-gyp configure --release -- -f compile_commands_json && node-gyp build --release",
"build.native.debug": "node-gyp configure --debug && node-gyp configure --debug -- -f compile_commands_json && cross-env CMAKE_BUILD_TYPE=Debug node-gyp build --debug",
"build": "run-s build.js build.native",
"build.debug": "run-s build.js build.native.debug",
"build": "run-s build.native",
"build.debug": "run-s build.native.debug",
"test.deps": "cd test && pnpm install && cd ..",
"test": "run-s clean.temp test.deps build && mocha",
"test.skip_gc_tests": "run-s clean.temp test.deps build.debug && cross-env SKIP_GC_TESTS=true mocha",
Expand All @@ -104,8 +105,7 @@
"lint.eslint": "pnpm run lint-test.eslint --fix",
"lint": "run-p lint.eslint lint.clang-format",
"lint-test": "run-s lint-test.eslint",
"bench": "node --expose-gc test/bench",
"prepublishOnly": "pnpm run build.js"
"bench": "node --expose-gc test/bench"
},
"keywords": [
"zeromq",
Expand Down
10 changes: 6 additions & 4 deletions script/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import {mkdir, cd, exec, find, mv} from "shelljs"
const root = dirname(__dirname)

function main() {
const zmq_rev =
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing, @typescript-eslint/strict-boolean-expressions
process.env.ZMQ_VERSION || "5657b4586f24ec433930e8ece02ddba7afcf0fe0"
const src_url = `https://github.com/zeromq/libzmq/archive/${zmq_rev}.tar.gz`
// Revision to use. Can be a version number like "4.3.5", a branch name, or a commit hash.
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing, @typescript-eslint/strict-boolean-expressions
const zmq_rev = process.env.ZMQ_VERSION || "4.3.5"

// if it looks like a dot-separated version number, prepend with "v" to match repo tagging convention
const gitref = zmq_rev.match(/^\d+\./) ? `v${zmq_rev}` : zmq_rev
const src_url = `https://github.com/zeromq/libzmq/archive/${gitref}.tar.gz`
Comment on lines +8 to +14
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the conflicts and recent changes, this can be a separate pull request, but it needs some testing to verify it works

const libzmq_build_prefix = `${root}/build/libzmq-staging`
const libzmq_install_prefix = `${root}/build/libzmq`

Expand Down
Loading