Skip to content

arduino-builder fails if tools directory contains broken symlinks #159

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
lmoellendorf opened this issue Jun 5, 2016 · 10 comments
Closed
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@lmoellendorf
Copy link

Steps to reproduce:

Create a tools dir with broken symlink:
mkdir tools-dir
ln -s /no/way tools-dir/broken-link

Call arduino-builider with created tools dir:
~/Makeblock/arduino-1.6.9/arduino-builder -hardware "~/Makeblock/arduino-1.6.9/hardware/" -tools "~/tools-dir" -fqbn "arduino:avr:uno" -verbose ~/Arduino/mBot/mBot-default-program/mBot-default- program.ino

The error is:
stat tools-dir/broken-link: no such file or directory

Note, this error also occurs if a valid tools directory is specified which contains broken sym-links.

@oqibidipo
Copy link

I was editing a file in my own library with Emacs and this happened:

stat /Users/rjl/Documents/Arduino/libraries/_test/.#test_warning.h: no such file or directory

For those not familiar with Emacs: that is the lock file it creates and it is a symlink to <user>@<host>.<process_id>.

facchinm added a commit to facchinm/arduino-builder that referenced this issue Jul 7, 2016
Fixes arduino#159, please make sure that it doesn't introduce any regression

Tests are passing on Linux but something nasty could happen on different OS
facchinm added a commit to facchinm/arduino-builder that referenced this issue Jul 7, 2016
Fixes arduino#159, please make sure that it doesn't introduce any regression

Tests are passing on Linux but something nasty could happen on different OS

Signed-off-by: Martino Facchin <[email protected]>
@facchinm
Copy link
Member

facchinm commented Jul 7, 2016

Hi @lmoellendorf ,
could you test #166 and report if it solves your bug (and if it doesn't introduce any regression, of course 😄 )?

@oqibidipo
Copy link

Not completely fixed: it still fails if there is a broken symlink directly under .../libraries.
Tested with 1.3.23, 1.3.24, PR213.

@facchinm
Copy link
Member

Ugh, are you sure about that? I tried to reproduce by creating a broken symlink in $sketchbook/libraries and the sketches still compile...

@oqibidipo
Copy link

That depends on which libraries the sketch includes and where they are located:
(target = Uno)

#include <SomeInstalledLibrary.h>
fails if a broken link is in $skechbook/libraries

#include <SPI.h>
fails if a broken link is in hardware/avr/libraries
compiles if a broken link is in $skechbook/libraries

#include <Mouse.h>
cannot find "HID.h" if a broken link is in hardware/avr/libraries

Clarification: 'fails' means that the directory in question is not added to the search path. The compilation may still succeed if the header can be found under a 'clean' directory.

@facchinm
Copy link
Member

Got it! I've been able to reproduce, reopening

@facchinm facchinm reopened this Feb 27, 2017
facchinm added a commit to facchinm/arduino-builder that referenced this issue Feb 28, 2017
@facchinm
Copy link
Member

Hi @oqibidipo , could you test #216 as soon as @ArduinoBot produces the build? Thanks!

@oqibidipo
Copy link

Looks good.

@akkana
Copy link

akkana commented Mar 17, 2017

Saw this in 1.8.1 downloaded tonight. It wouldn't have been a problem if there had been an error message about the bad link, but since the only error message was a failure to include the .h file from a library that really was there, it took hours to track down the real problem.

cmaglie pushed a commit that referenced this issue Mar 20, 2017
@facchinm
Copy link
Member

Fixed by merging 14ca8f2

@per1234 per1234 added conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

5 participants