Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 62b0758

Browse filesBrowse files
alexsch01aduh95
authored andcommitted
src: fix --build-sea default executable path
PR-URL: #61708 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent bb82b44 commit 62b0758
Copy full SHA for 62b0758

2 files changed

+35-1Lines changed: 35 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_sea_bin.cc‎

Copy file name to clipboardExpand all lines: src/node_sea_bin.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ ExitCode BuildSingleExecutable(const std::string& sea_config_path,
388388

389389
SeaConfig config = opt_config.value();
390390
if (config.executable_path.empty()) {
391-
config.executable_path = args[0];
391+
config.executable_path = Environment::GetExecPath(args);
392392
}
393393

394394
// Get file permissions from source executable to copy over later.
Collapse file
+34Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
'use strict';
2+
// This tests --build-sea with a custom argv0 value.
3+
4+
require('../common');
5+
6+
const { skipIfBuildSEAIsNotSupported } = require('../common/sea');
7+
8+
skipIfBuildSEAIsNotSupported();
9+
10+
const tmpdir = require('../common/tmpdir');
11+
const fixtures = require('../common/fixtures');
12+
const { copyFileSync } = require('fs');
13+
14+
const { spawnSyncAndAssert } = require('../common/child_process');
15+
tmpdir.refresh();
16+
17+
copyFileSync(
18+
fixtures.path('sea', 'basic', 'sea-config.json'),
19+
tmpdir.resolve('sea-config.json'),
20+
);
21+
22+
copyFileSync(
23+
fixtures.path('sea', 'basic', 'sea.js'),
24+
tmpdir.resolve('sea.js'),
25+
);
26+
27+
spawnSyncAndAssert(
28+
process.execPath,
29+
['--build-sea', tmpdir.resolve('sea-config.json')], {
30+
cwd: tmpdir.path,
31+
argv0: 'argv0',
32+
}, {
33+
stdout: /Generated single executable/,
34+
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.