Skip to content
Open
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
2 changes: 1 addition & 1 deletion src/node_sea_bin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ ExitCode BuildSingleExecutable(const std::string& sea_config_path,

SeaConfig config = opt_config.value();
if (config.executable_path.empty()) {
config.executable_path = args[0];
config.executable_path = Environment::GetExecPath(args);
}

// Get file permissions from source executable to copy over later.
Expand Down
34 changes: 34 additions & 0 deletions test/sea/test-build-sea-custom-argv0.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
'use strict';
// This tests --build-sea with a custom argv0 value.

require('../common');

const { skipIfBuildSEAIsNotSupported } = require('../common/sea');

skipIfBuildSEAIsNotSupported();

const tmpdir = require('../common/tmpdir');
const fixtures = require('../common/fixtures');
const { copyFileSync } = require('fs');

const { spawnSyncAndAssert } = require('../common/child_process');
tmpdir.refresh();

copyFileSync(

Check failure on line 17 in test/sea/test-build-sea-custom-argv0.js

View workflow job for this annotation

GitHub Actions / test-linux (ubuntu-24.04-arm)

--- stderr --- node:fs:3088 binding.copyFile( ^ Error: ENOENT: no such file or directory, copyfile '/home/runner/work/node/node/node/test/fixtures/sea-config.json' -> '/home/runner/work/node/node/node/test/.tmp.577/sea-config.json' at copyFileSync (node:fs:3088:11) at Object.<anonymous> (/home/runner/work/node/node/node/test/sea/test-build-sea-custom-argv0.js:17:1) at Module._compile (node:internal/modules/cjs/loader:1811:14) at Object..js (node:internal/modules/cjs/loader:1942:10) at Module.load (node:internal/modules/cjs/loader:1532:32) at Module._load (node:internal/modules/cjs/loader:1334:12) at wrapModuleLoad (node:internal/modules/cjs/loader:255:19) at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5) at node:internal/main/run_main_module:33:47 { errno: -2, code: 'ENOENT', syscall: 'copyfile', path: '/home/runner/work/node/node/node/test/fixtures/sea-config.json', dest: '/home/runner/work/node/node/node/test/.tmp.577/sea-config.json' } Node.js v26.0.0-pre Command: out/Release/node /home/runner/work/node/node/node/test/sea/test-build-sea-custom-argv0.js

Check failure on line 17 in test/sea/test-build-sea-custom-argv0.js

View workflow job for this annotation

GitHub Actions / test-linux (ubuntu-24.04)

--- stderr --- node:fs:3088 binding.copyFile( ^ Error: ENOENT: no such file or directory, copyfile '/home/runner/work/node/node/node/test/fixtures/sea-config.json' -> '/home/runner/work/node/node/node/test/.tmp.68/sea-config.json' at copyFileSync (node:fs:3088:11) at Object.<anonymous> (/home/runner/work/node/node/node/test/sea/test-build-sea-custom-argv0.js:17:1) at Module._compile (node:internal/modules/cjs/loader:1811:14) at Object..js (node:internal/modules/cjs/loader:1942:10) at Module.load (node:internal/modules/cjs/loader:1532:32) at Module._load (node:internal/modules/cjs/loader:1334:12) at wrapModuleLoad (node:internal/modules/cjs/loader:255:19) at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5) at node:internal/main/run_main_module:33:47 { errno: -2, code: 'ENOENT', syscall: 'copyfile', path: '/home/runner/work/node/node/node/test/fixtures/sea-config.json', dest: '/home/runner/work/node/node/node/test/.tmp.68/sea-config.json' } Node.js v26.0.0-pre Command: out/Release/node /home/runner/work/node/node/node/test/sea/test-build-sea-custom-argv0.js

Check failure on line 17 in test/sea/test-build-sea-custom-argv0.js

View workflow job for this annotation

GitHub Actions / test-macOS

--- stderr --- node:fs:3088 binding.copyFile( ^ Error: ENOENT: no such file or directory, copyfile '/Users/runner/work/node/node/node/test/fixtures/sea-config.json' -> '/Users/runner/work/node/node/node/test/.tmp.4604/sea-config.json' at copyFileSync (node:fs:3088:11) at Object.<anonymous> (/Users/runner/work/node/node/node/test/sea/test-build-sea-custom-argv0.js:17:1) at Module._compile (node:internal/modules/cjs/loader:1811:14) at Object..js (node:internal/modules/cjs/loader:1942:10) at Module.load (node:internal/modules/cjs/loader:1532:32) at Module._load (node:internal/modules/cjs/loader:1334:12) at wrapModuleLoad (node:internal/modules/cjs/loader:255:19) at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5) at node:internal/main/run_main_module:33:47 { errno: -2, code: 'ENOENT', syscall: 'copyfile', path: '/Users/runner/work/node/node/node/test/fixtures/sea-config.json', dest: '/Users/runner/work/node/node/node/test/.tmp.4604/sea-config.json' } Node.js v26.0.0-pre Command: out/Release/node /Users/runner/work/node/node/node/test/sea/test-build-sea-custom-argv0.js
fixtures.path('sea-config.json'),
tmpdir.resolve('sea-config.json'),
);

copyFileSync(
fixtures.path('sea.js'),
tmpdir.resolve('sea.js'),
);

spawnSyncAndAssert(
process.execPath,
['--build-sea', tmpdir.resolve('sea-config.json')], {
cwd: tmpdir.path,
argv0: 'argv0',
}, {
stdout: /Generated single executable/,
});
Loading