Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

adding --static option #1222

Closed
wants to merge 1 commit 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
15 changes: 12 additions & 3 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,15 @@ function stringifyTargetForOutput(
return a.join('-');
}

function fabricatorForTarget({ nodeRange, arch }: NodeTarget) {
function fabricatorForTarget({ nodeRange, arch, linuxStatic }: NodeTarget) {
let fabPlatform = hostPlatform;

if (
hostArch !== arch &&
(hostPlatform === 'linux' || hostPlatform === 'alpine')
linuxStatic === true ||
(
hostArch !== arch &&
(hostPlatform === 'linux' || hostPlatform === 'alpine')
)
) {
// With linuxstatic, it is possible to generate bytecode for different
// arch with simple QEMU configuration instead of the entire sysroot.
Expand Down Expand Up @@ -233,6 +236,7 @@ export async function exec(argv2: string[]) {
'public',
'v',
'version',
'static',
],
string: [
'_',
Expand Down Expand Up @@ -277,6 +281,10 @@ export async function exec(argv2: string[]) {

const forceBuild = argv.b || argv.build;

// linuxstatic

const linuxStatic = argv.static;

// doCompress
const algo = argv.C || argv.compress || 'None';

Expand Down Expand Up @@ -543,6 +551,7 @@ export async function exec(argv2: string[]) {

for (const target of targets) {
target.forceBuild = forceBuild;
target.linuxStatic = linuxStatic;

await needWithDryRun(target);

Expand Down
1 change: 1 addition & 0 deletions lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export interface NodeTarget {
arch: string;
platform: keyof typeof platform;
forceBuild?: boolean;
linuxStatic?: boolean;
}

export interface Target extends NodeTarget {
Expand Down