@@ -174,6 +174,7 @@ class RustPlugin {
174
174
cargoPackage ,
175
175
binary ,
176
176
profile ,
177
+ debugInfo ,
177
178
srcPath ,
178
179
cargoRegistry ,
179
180
cargoDownloads ,
@@ -198,6 +199,9 @@ class RustPlugin {
198
199
// release or dev
199
200
customArgs . push ( "-e" , `PROFILE=${ profile } ` ) ;
200
201
}
202
+ if ( debugInfo ) {
203
+ customArgs . push ( "-e" , `DEBUGINFO=${ debugInfo } ` ) ;
204
+ }
201
205
if ( cargoPackage != undefined ) {
202
206
if ( cargoFlags ) {
203
207
cargoFlags = `${ cargoFlags } -p ${ cargoPackage } ` ;
@@ -219,7 +223,7 @@ class RustPlugin {
219
223
] . filter ( ( i ) => i ) ;
220
224
}
221
225
222
- dockerBuild ( funcArgs , cargoPackage , binary , profile ) {
226
+ dockerBuild ( funcArgs , cargoPackage , binary , profile , debugInfo ) {
223
227
const cargoHome = process . env . CARGO_HOME || path . join ( homedir ( ) , ".cargo" ) ;
224
228
const cargoRegistry = path . join ( cargoHome , "registry" ) ;
225
229
const cargoDownloads = path . join ( cargoHome , "git" ) ;
@@ -230,6 +234,7 @@ class RustPlugin {
230
234
cargoPackage ,
231
235
binary ,
232
236
profile ,
237
+ debugInfo ,
233
238
this . srcPath ,
234
239
cargoRegistry ,
235
240
cargoDownloads ,
@@ -280,10 +285,11 @@ class RustPlugin {
280
285
281
286
this . serverless . cli . log ( `Building Rust ${ func . handler } func...` ) ;
282
287
let profile = ( func . rust || { } ) . profile || this . custom . profile ;
288
+ let debugInfo = ( func . rust || { } ) . debugInfo || this . custom . debugInfo ;
283
289
284
290
const res = this . buildLocally ( func )
285
291
? this . localBuild ( func . rust , cargoPackage , binary , profile )
286
- : this . dockerBuild ( func . rust , cargoPackage , binary , profile ) ;
292
+ : this . dockerBuild ( func . rust , cargoPackage , binary , profile , debugInfo ) ;
287
293
if ( res . error || res . status > 0 ) {
288
294
this . serverless . cli . log (
289
295
`Rust build encountered an error: ${ res . error } ${ res . status } .`
0 commit comments