Skip to content
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

[skip-changelog] Avoid getting locked up in a perpetual symlink loop when loading a library #2146

Merged

Conversation

MatteoPologruto
Copy link
Contributor

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

Code imperfection fix

What is the current behavior?

When loading a library or sketch that contains multiple symlinks to a parent path, Arduino CLI locks up in a perpetual loop.

What is the new behavior?

Arduino CLI fails with an error when a symlink loop is encountered.

Does this PR introduce a breaking change, and is titled accordingly?

No

@MatteoPologruto MatteoPologruto added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Apr 12, 2023
@MatteoPologruto MatteoPologruto self-assigned this Apr 12, 2023
@MatteoPologruto MatteoPologruto linked an issue Apr 12, 2023 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Apr 12, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.06 🎉

Comparison is base (2a5c83a) 62.55% compared to head (a34f57d) 62.61%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2146      +/-   ##
==========================================
+ Coverage   62.55%   62.61%   +0.06%     
==========================================
  Files         223      223              
  Lines       19459    19461       +2     
==========================================
+ Hits        12172    12186      +14     
+ Misses       6196     6188       -8     
+ Partials     1091     1087       -4     
Flag Coverage Δ
unit 62.61% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
arduino/libraries/loader.go 92.76% <100.00%> (+10.09%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Matteo!

arduino/libraries/libraries_test.go Outdated Show resolved Hide resolved
arduino/libraries/libraries_test.go Outdated Show resolved Hide resolved
arduino/libraries/loader.go Outdated Show resolved Hide resolved
@MatteoPologruto MatteoPologruto force-pushed the hang-on-symlink-library branch 2 times, most recently from 18ea391 to b4aa009 Compare April 26, 2023 10:50
@MatteoPologruto MatteoPologruto merged commit c3edbd3 into arduino:master May 9, 2023
@MatteoPologruto MatteoPologruto deleted the hang-on-symlink-library branch May 9, 2023 09:52
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 this pull request may close these issues.

Hang on symlink loop in library
4 participants