@@ -50,7 +50,7 @@ class RustPlugin {
50
50
this . serverless . service . package . excludeDevDependencies = false ;
51
51
}
52
52
53
- runDocker ( funcArgs , cargoPackage , binary , profile ) {
53
+ runDocker ( funcArgs , cargoPackage , binary , profile , debugInfo ) {
54
54
const cargoHome = process . env . CARGO_HOME || path . join ( homedir ( ) , ".cargo" ) ;
55
55
const cargoRegistry = path . join ( cargoHome , "registry" ) ;
56
56
const cargoDownloads = path . join ( cargoHome , "git" ) ;
@@ -74,6 +74,9 @@ class RustPlugin {
74
74
// release or dev
75
75
customArgs . push ( "-e" , `PROFILE=${ profile } ` ) ;
76
76
}
77
+ if ( debugInfo ) {
78
+ customArgs . push ( "-e" , `DEBUGINFO=${ debugInfo } ` ) ;
79
+ }
77
80
if ( cargoPackage != undefined ) {
78
81
if ( cargoFlags ) {
79
82
cargoFlags = `${ cargoFlags } -p ${ cargoPackage } ` ;
@@ -121,7 +124,8 @@ class RustPlugin {
121
124
}
122
125
this . serverless . cli . log ( `Building native Rust ${ func . handler } func...` ) ;
123
126
let profile = ( func . rust || { } ) . profile || this . custom . profile ;
124
- const res = this . runDocker ( func . rust , cargoPackage , binary , profile ) ;
127
+ let debugInfo = ( func . rust || { } ) . debugInfo || this . custom . debugInfo ;
128
+ const res = this . runDocker ( func . rust , cargoPackage , binary , profile , debugInfo ) ;
125
129
if ( res . error || res . status > 0 ) {
126
130
this . serverless . cli . log (
127
131
`Dockerized Rust build encountered an error: ${ res . error } ${ res . status } .`
0 commit comments