Skip to content

Commit 1fd6354

Browse files
Use the correct library when a relative path is passed as --library value
1 parent a9729db commit 1fd6354

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

internal/cli/compile/compile.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,14 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
226226
stdOut, stdErr, stdIORes = feedback.OutputStreams()
227227
}
228228

229+
var libraryAbs []string
230+
for _, libPath := range paths.NewPathList(library...) {
231+
if libPath, err = libPath.Abs(); err != nil {
232+
feedback.Fatal(tr("Error converting path to absolute: %v", err), feedback.ErrGeneric)
233+
}
234+
libraryAbs = append(libraryAbs, libPath.String())
235+
}
236+
229237
compileRequest := &rpc.CompileRequest{
230238
Instance: inst,
231239
Fqbn: fqbn,
@@ -244,7 +252,7 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
244252
Clean: clean,
245253
CreateCompilationDatabaseOnly: compilationDatabaseOnly,
246254
SourceOverride: overrides,
247-
Library: library,
255+
Library: libraryAbs,
248256
KeysKeychain: keysKeychain,
249257
SignKey: signKey,
250258
EncryptKey: encryptKey,

0 commit comments

Comments
 (0)