Skip to content

Compile fails on symlink #1765

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
3 tasks done
econeale opened this issue Jun 14, 2022 · 2 comments · Fixed by #2497
Closed
3 tasks done

Compile fails on symlink #1765

econeale opened this issue Jun 14, 2022 · 2 comments · Fixed by #2497
Assignees
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@econeale
Copy link

Describe the problem

When executing arduino-cli compile within a project that is also a git repository, I receive this error:

/Users/neale/myProject/.git/hooks/pre-commit: no such file or directory

This pre-commit hook is a symlink to a shell script that's also contained in the repository. This appears to happen regardless of where the symlink points / exists in the repository. There appears to be no way to work around the error other than completely removing the link.

To reproduce

Create a project with the structure:

  • myProject
    • myProject.ino
    • aLink -> /somewhere/else

Execute arduino-cli compile within the directory.

Expected behavior

Several solutions to this come to mind:

  1. Recursing hidden directories probably shouldn't happen by default
  2. Ability to explicitly list files / directories to compile
  3. An option to follow / not follow symlinks

Arduino CLI version

0.23.0

Operating system

macOS

Operating system version

12.3.1

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the nightly build
  • My report contains all necessary details
@econeale econeale added the type: imperfection Perceived defect in any part of project label Jun 14, 2022
@matthijskooijman
Copy link
Collaborator

Hm, I recall that .git (or maybe all hidden directories) were already filtered out from the list of files to compile/load, but maybe I remember wrong (or this was changed at some point, maybe).

In any case, I ran into issues with (broken) symlinks breaking compilation before, see #1438 for an attempt at fixing this (which is probably not ideal, but will be useful as a starting point and see some of the previous attempts, considerations and involved code).

@per1234 per1234 added the topic: code Related to content of the project itself label Jun 15, 2022
@cmaglie cmaglie self-assigned this Mar 17, 2023
@cmaglie
Copy link
Member

cmaglie commented Apr 26, 2023

This requires two fix IMHO:

  1. ignore .git folders in sketches
  2. ignore broken symbolic links and continue the compilation anyway.

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

Successfully merging a pull request may close this issue.

4 participants