Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Add BUILD_STATIC_BINARY env var for building a static lumo binary #475

Merged
merged 1 commit into from
Apr 26, 2019
Merged
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
4 changes: 3 additions & 1 deletion build.boot
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
(def +node-version+ (or (System/getenv "BUILD_NODE_VERSION")
"11.13.0"))

(def +build-static-binary+ (-> (System/getenv "BUILD_STATIC_BINARY") boolean str))

(set-env!
:source-paths #{"src/cljs/snapshot"}
:asset-paths #{"src/js" "src/cljs/bundled"}
Expand Down Expand Up @@ -193,7 +195,7 @@
(deftask package-executable
[c ci-build bool "CI build"]
(with-pass-thru _
(dosh "node" "scripts/package.js" +node-version+)))
(dosh "node" "scripts/package.js" +node-version+ +build-static-binary+)))

(deftask backup-resources
"Backup resources to be gzipped in the 2nd stage binary
Expand Down
4 changes: 3 additions & 1 deletion scripts/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const embed = require('./embed');

const argv = process.argv.slice(0);
const nodeVersion = argv[2];
const staticBinary = /^true$/.test(argv[3]);
Copy link
Owner

Choose a reason for hiding this comment

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

this is getting a little ugly. At which point to we actually switch to parsing CLI arguments?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

agree...maybe next PR? 👅


function getDirContents(dir, accumPath = dir) {
let filenames = fs.readdirSync(dir);
Expand Down Expand Up @@ -65,7 +66,8 @@ Promise.all(resources.map(deflate)).then(() => {
'--without-inspector',
'--without-etw',
'--with-snapshot',
].concat(isWindows ? ['--openssl-no-asm'] : []),
]
.concat(isWindows ? ['--openssl-no-asm'] : (staticBinary ? ['--fully-static'] : [])),
nodeMakeArgs: ['-j', '8'],
nodeVCBuildArgs: ['nosign', 'x64', 'noetw'],
flags: true,
Expand Down