You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
hashfiles() expression function needs to handle symlink loop gracefully #234
When user has symlink loop in the folder they trying to hash, the runner will stuck on finding all files under the folder, the job will hang and user get no idea what's going wrong.
We need to detect the symlink loop, stop the recursion search and continue find other files.
Im not sure globbing with node solves anything. Youll just get a list of files (some of which may be symlinks) and then when you try to hash them, wont you just follow the link to the target and hit the same issue? Although, there may be existing javascript implementations of things other than glob that could be leveraged
Yea, my follow up was going to be youd need to detect cycles in code (tarjans, or maybe a max stack depth), or with an existing node module, or shell out to a different tool other than node that can do this. Beyond that, I dont know what the correct behavior is for hashing files that contain cyclic links, but it seems like you probably wouldnt be able to
Activity
joshmgross commentedon Dec 18, 2019
The user reported issues:
actions/cache#95
actions/cache#132
(Not sure if both are symlink related)
ericsciple commentedon Dec 18, 2019
it might be good to leverage the node toolkit to do the glob rather than maintain separate logic in c#
joshmgross commentedon Dec 18, 2019
@ericsciple Since this is evaluated before the typescript action starts, how would we do that?
ericsciple commentedon Dec 18, 2019
invoke node :)
nothing to do with any action. just bundle the required modules and invoke a node script to return a list of files paths
ericsciple commentedon Dec 18, 2019
think of it as a command line tool
TingluoHuang commentedon Dec 18, 2019
+1 on invoke node.
dotnet doesn't support inspect symlink to find its target natively, we have to pinvoke to get the information.
bryanmacfarlane commentedon Dec 18, 2019
+1 - think of node / javascript as a good xplat runtime / cli
dakale commentedon Jan 6, 2020
Im not sure globbing with node solves anything. Youll just get a list of files (some of which may be symlinks) and then when you try to hash them, wont you just follow the link to the target and hit the same issue? Although, there may be existing javascript implementations of things other than glob that could be leveraged
TingluoHuang commentedon Jan 6, 2020
dotnet doesn't have any api to deal with symlink, it always follow symlinks...
dakale commentedon Jan 6, 2020
Yea, my follow up was going to be youd need to detect cycles in code (tarjans, or maybe a max stack depth), or with an existing node module, or shell out to a different tool other than node that can do this. Beyond that, I dont know what the correct behavior is for hashing files that contain cyclic links, but it seems like you probably wouldnt be able to
joshmgross commentedon Apr 2, 2020
The feature flag that this is behind has rolled out everywhere. Thanks @TingluoHuang!