Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please check if the PR fulfills these requirements
before creating one)
our contributing guidelines
UPGRADING.md
has been updated with a migration guide (for breaking changes)Bug fix
.ino
,.cpp
, etc.) is unreadable, it is silently skipped when loading the sketch..ino
,.cpp
, etc type of file)..ino
,.cpp
, etc.) is unreadable (i.e. no permission or otherwise unreadable), an error is thrown..ino
,.cpp
, etc type of file).titled accordingly?
Sketches that contain unreadable files that are not actually needed can no longer be compiled (they show an error instead of silently skipping the unreadable file), but I would consider such sketches an unsupported corner case.
The trigger for this PR was that I had a symlink in my sketch to the
compile_commands.json
in the build folder, so my editor would find that file and use it for code completion. However, after a reboot, the symlink would become broken, andarduino-cli compile
(even with--only-compilation-database
would fail, requiring me to remove the symlink and then recreate it afterwards.The first commit was not strictly required for this problem, but it seemed like a good idea to not silently ignore unreadable files, and raising this error simplifies the second commit, while still raising an error as before on symlinks that would be loaded.
I've omitted testcases from this PR, since a significant of the code paths to test would result in
os.Exit
, which I think is not supported directly in the test framework. Are there any strategies in place for handling this already (see this post for some suggestions if not)?