From 687b50502c3892f87cf420ede794a591ab5cdf9a Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 17 Aug 2023 00:29:22 +0200 Subject: [PATCH] Fixed loading of Library given a non-absolute path Givin a relative path is not ideal, but at least allows the CLI to compile the sketch correctly. --- arduino/libraries/loader.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arduino/libraries/loader.go b/arduino/libraries/loader.go index 9af4b4fbf8e..2a106a37ae2 100644 --- a/arduino/libraries/loader.go +++ b/arduino/libraries/loader.go @@ -28,6 +28,13 @@ import ( // Load loads a library from the given LibraryLocation func Load(libDir *paths.Path, location LibraryLocation) (*Library, error) { + if !libDir.IsAbs() { + if abs, err := libDir.Abs(); err == nil { + libDir = abs + } else { + return nil, err + } + } if libDir.Join("library.properties").Exist() { return makeNewLibrary(libDir, location) }