File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
crates/node_binding/scripts Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -69,17 +69,33 @@ async function build() {
69
69
features . push ( "sftrace-setup" ) ;
70
70
envs . RUSTFLAGS = "-Zinstrument-xray=always" ;
71
71
}
72
- if ( values . profile === "release" ) {
72
+ if ( values . profile === "release" ) {
73
73
features . push ( "info-level" ) ;
74
74
}
75
75
if ( features . length ) {
76
76
args . push ( "--features " + features . join ( "," ) ) ;
77
77
}
78
78
79
- if ( positionals . length > 0 ) {
79
+ if ( positionals . length > 0
80
+ || values . profile === "release"
81
+ || values . profile === "release-debug"
82
+ || values . profile === "profiling"
83
+ ) {
80
84
// napi need `--` to separate options and positional arguments.
81
85
args . push ( "--" ) ;
82
- args . push ( ...positionals ) ;
86
+
87
+ if ( values . profile === "release"
88
+ || values . profile === "release-debug"
89
+ || values . profile === "profiling"
90
+ ) {
91
+ // allows to optimize std with current compile arguments
92
+ // and avoids std code generate unwind table to save size.
93
+ args . push ( "-Zbuild-std=panic_abort,std" ) ;
94
+ }
95
+
96
+ if ( positionals . length > 0 ) {
97
+ args . push ( ...positionals ) ;
98
+ }
83
99
}
84
100
85
101
console . log ( `Run command: napi ${ args . join ( " " ) } ` ) ;
Original file line number Diff line number Diff line change 1
1
[toolchain ]
2
2
profile = " default"
3
+ components = [" rust-src" ]
3
4
# Use nightly for better access to the latest Rust features.
4
5
channel = " nightly-2025-05-30"
You can’t perform that action at this time.
0 commit comments