@@ -219,6 +219,19 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream
219
219
return r , compileErr
220
220
}
221
221
222
+ defer func () {
223
+ importedLibs := []* rpc.Library {}
224
+ for _ , lib := range builderCtx .ImportedLibraries {
225
+ rpcLib , err := lib .ToRPCLibrary ()
226
+ if err != nil {
227
+ msg := tr ("Error getting information for library %s" , lib .Name ) + ": " + err .Error () + "\n "
228
+ errStream .Write ([]byte (msg ))
229
+ }
230
+ importedLibs = append (importedLibs , rpcLib )
231
+ }
232
+ r .UsedLibraries = importedLibs
233
+ }()
234
+
222
235
// if it's a regular build, go on...
223
236
if err := builder .RunBuilder (builderCtx ); err != nil {
224
237
return r , & arduino.CompileFailedError {Message : err .Error ()}
@@ -268,16 +281,6 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream
268
281
}
269
282
}
270
283
271
- importedLibs := []* rpc.Library {}
272
- for _ , lib := range builderCtx .ImportedLibraries {
273
- rpcLib , err := lib .ToRPCLibrary ()
274
- if err != nil {
275
- return r , & arduino.PermissionDeniedError {Message : tr ("Error getting information for library %s" , lib .Name ), Cause : err }
276
- }
277
- importedLibs = append (importedLibs , rpcLib )
278
- }
279
- r .UsedLibraries = importedLibs
280
-
281
284
r .ExecutableSectionsSize = builderCtx .ExecutableSectionsSize .ToRPCExecutableSectionSizeArray ()
282
285
283
286
logrus .Tracef ("Compile %s for %s successful" , sk .Name , fqbnIn )
0 commit comments