Skip to content

Commit 698ec9b

Browse files
Draft: Upgrade go-paths-helper to patched version
This commit should not be merged, instead the indicated commit should be merged into upstream go-paths-helper first and this commit adapted. This makes two relevant changes: - ReadDirRecursive now returns broken symlinks as-is (and other files that cannot be stat'd due to permission errors) rather than failing entirely. This causes broken symlinks to no longer break the build, unless they are actually used (i.e. broken .cpp links will cause gcc to error out later). - FilterOutDirs no longer filters out broken symlinks (and other files that cannot be stat'd due to whatever error). This ensures that broken symlinks are actually returned by Sketch.supportedFiles, so sketch.New can check them (though that still ignores any errors currently). The test suite is updated for these changes.
1 parent 397ca14 commit 698ec9b

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

go.mod

+2
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,5 @@ require (
5252
gopkg.in/src-d/go-git.v4 v4.13.1
5353
gopkg.in/yaml.v2 v2.4.0
5454
)
55+
56+
replace github.com/arduino/go-paths-helper v1.6.1 => github.com/matthijskooijman/go-paths-helper v1.6.2-0.20210908151509-429170ecd10a

test/test_compile.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,11 @@ def test_broken_symlink(sketch_name, link_name, target_name, expect_error):
220220
else:
221221
assert result.ok
222222

223-
test_broken_symlink("CompileIntegrationTestSymlinkBrokenIno", "link.ino", "doesnotexist.ino", expect_error=True)
224-
test_broken_symlink("CompileIntegrationTestSymlinkBrokenCpp", "link.cpp", "doesnotexist.cpp", expect_error=True)
225-
test_broken_symlink("CompileIntegrationTestSymlinkBrokenH", "link.h", "doesnotexist.h", expect_error=True)
226-
test_broken_symlink("CompileIntegrationTestSymlinkBrokenJson", "link.json", "doesnotexist.json", expect_error=True)
227-
test_broken_symlink("CompileIntegrationTestSymlinkBrokenXXX", "link.xxx", "doesnotexist.xxx", expect_error=True)
223+
test_broken_symlink("CompileIntegrationTestSymlinkBrokenIno", "link.ino", "doesnotexist.ino", expect_error=False)
224+
test_broken_symlink("CompileIntegrationTestSymlinkBrokenCpp", "link.cpp", "doesnotexist.cpp", expect_error=False)
225+
test_broken_symlink("CompileIntegrationTestSymlinkBrokenH", "link.h", "doesnotexist.h", expect_error=False)
226+
test_broken_symlink("CompileIntegrationTestSymlinkBrokenJson", "link.json", "doesnotexist.json", expect_error=False)
227+
test_broken_symlink("CompileIntegrationTestSymlinkBrokenXXX", "link.xxx", "doesnotexist.xxx", expect_error=False)
228228

229229

230230
def test_compile_blacklisted_sketchname(run_command, data_dir):

0 commit comments

Comments
 (0)