Skip to content

Is buildCtx.OtherLibrariesDirs even used? #976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Alfrederson opened this issue Sep 24, 2020 · 2 comments
Closed

Is buildCtx.OtherLibrariesDirs even used? #976

Alfrederson opened this issue Sep 24, 2020 · 2 comments
Assignees
Labels
conclusion: invalid Issue/PR not valid

Comments

@Alfrederson
Copy link

Bug Report

Current behavior

cmd.exe /r "C:\Users\pc\Documents\tool\arduino-cli.exe" compile "C:\Users\pc\Documents\tool\sketch\sketch.ino" -b arduino:avr:diecimila --libraries "C:\Users\pc\Documents\tool\libs" --output-dir "C:\Users\pc\Documents\tool\sketch\out" --verbose

It says it can't find a header file inside \tool\libs directory (with #include "header.h") .

Expected behavior

It should find the file like it does when the \libs\ folder is inside the same directory as the sketch (#include "libs/header.h")

Environment

  • CLI version (output of arduino-cli version):
  • OS and platform:

Additional context

Looking at the source code it seems like the values passed to --libraries are added to a list but aren't referenced ever again. Maybe this is the cause of the issue.

@ubidefeo
Copy link

hi @Alfrederson

it seems that the --libraries flag is causing some issues, we had another report #973 with a different behaviour caused by the same flag and I'm having this investigated.

Thank you for reporting

@per1234
Copy link
Contributor

per1234 commented Feb 3, 2021

Hi @Alfrederson. If I understand what you wrote correctly, the problem is that you are misusing the --libraries flag. From the command reference:
https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_compile/#options

--libraries strings            List of custom libraries paths separated by commas. Or can be used multiple times for multiple libraries paths.

The path specified via the --libraries flag is to a libraries folder. Like the libraries subfolder of directories.user (AKA "the sketchbook folder"), this is a folder containing libraries, like this:

C:\Users\pc\Documents\tool
|_ libs
    |_ BarLib
    |    |_ header.h
    |_ FooLib
        |_ library.properties
        |_ src
            |_ header.h

It sounds like your C:\Users\pc\Documents\tool\libs is actuall a library folder:

C:\Users\pc\Documents\tool
|_ libs
    |_ header.h

which is not supported.

@per1234 per1234 closed this as completed Feb 3, 2021
@per1234 per1234 added the conclusion: invalid Issue/PR not valid label Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: invalid Issue/PR not valid
Projects
None yet
Development

No branches or pull requests

5 participants