Skip to content

Symbolic Links in <sketches>/libraries shows up in using list with destination of link directory #1658

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
KurtE opened this issue Feb 13, 2022 · 2 comments
Assignees
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@KurtE
Copy link

KurtE commented Feb 13, 2022

Describe the bug
When I am working on github projects including arduino libraries, I typically download the projects to specific
directory in my case: d:\github

When I wish to use them to build with I will typically create a symbolic link in the /libraries folder which has worked out
fine.

With arduino 1.8.xxx when I built the using library would show that it was using my c:\users\kurte\documents\arduino\libraries\usbhost_t36
now it is showing the github directory:

C:\Users\kurte\Documents\Arduino\libraries>dir usbhost*
 Volume in drive C is Windows
 Volume Serial Number is B2F0-35F3

 Directory of C:\Users\kurte\Documents\Arduino\libraries

10/15/2021  09:37 AM    <SYMLINKD>     USBHost_t36 [d:\GitHub\USBHost_t36]
               0 File(s)              0 bytes
               1 Dir(s)  672,677,158,912 bytes free

C:\Users\kurte\Documents\Arduino\libraries>

To Reproduce
Steps to reproduce the behavior:

  1. download a library to some location, like: d:\github\USBHost_t36
  2. make a link to it: mklink /D d:\github\USBHost_t36 c:\ c:\users\kurte\documents\arduino\libraries\usbhost_t36
  3. build a sketch using the library

Expected behavior
Actually I don't mind the change as that is where the sources are. But it is different, and I don't know if it would confuse
others as d:\github is not in the normal library search locations.

But if by design feel free to close as by design. I simply opened this to note it.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Version: nightly 20220212
@KurtE KurtE added the type: imperfection Perceived defect in any part of project label Feb 13, 2022
@per1234 per1234 transferred this issue from arduino/arduino-ide Feb 13, 2022
@per1234 per1234 added the topic: code Related to content of the project itself label Feb 13, 2022
@per1234 per1234 changed the title Sybolic Links in <sketches>/libraries shows up in using list with destination of link directory Symbolic Links in <sketches>/libraries shows up in using list with destination of link directory Feb 13, 2022
@umbynos umbynos assigned ubidefeo and unassigned silvanocerza Feb 3, 2023
@ubidefeo
Copy link

ubidefeo commented Feb 3, 2023

@KurtE
What happens is that the symlink is expanded, and when collecting paths and resources, the real final path is displayed.
This is not really by design but seems to me like a great way to know what resources are really being used.

That said, when you want to compile against a development library,
you can simply invoke the CLI passing in a --library option followed by a path.
This is how I do it

arduino-cli compile -b arduino:samd:nano_33_iot --library /data/GITHUB/ArduinoLibs/FTDebouncer

this will ignore FTDebouncer in my libraries folder and prefer to use the one I pointed it too.
The scoring system for Library choice gives maximum ranking to the one specified using --library

You also have a --libraries option folder which can be an extra libraries folder to point to, and all the libraries in it will supersede the ones in the Sketchbook's libraries folder

@cmaglie
Copy link
Member

cmaglie commented Mar 17, 2023

@KurtE the symlink resolution is part of the "canonicalization" of the file name https://github.com/arduino/go-paths-helper/blob/269e91aa596347d22e73b253e54483842e51d530/paths.go#L530-L543
(see also golang/go#17084 (comment))

We need to do this because sometimes a unique file name for a specific resource is needed (for example the language server requires it), so I'm closing this as "expect by design".

@cmaglie cmaglie closed this as completed Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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