-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: handle hardlinks #17
feat: handle hardlinks #17
Conversation
e1abecc
to
0601fda
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass. This is looking very good, overall just a couple of nitpicks and comments about missing tests.
This reverts commit 19fc4ff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks James, this is looking very good! I did another quick pass, a bunch of nitpicks basically. I think we should also change the implementation for TreeDumpEntry
even if we are not using it right now.
The implementation of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes James. I think we are only need one more round to get this approved :D. Most of the comments are about changing the code to match the style of Chisel a bit more, which is always the tedious part in the beginning until we both share the same mindset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey James, another quick review pending the last pass. I see that you removed the changes to treedump.go
that would print whether an entry is a hardlink. I think we should keep the changes in treedump.go
even though we don't use it right now. I think that it is useful when:
- we need to write other tests using it in the future,
- debugging, think about a test that creates a hardlink when it shouldn't. If we do not introduce the changes then the output is going to be identical to a regular file and we won't be able to differentiate it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks James, only nitpicks this time about names. In Chisel we try to keep everything short and concise, hence why I suggested some changes to the naming. We should only have long names / comments where it makes sense to have that extra information.
internal/fsutil/create.go
Outdated
if os.SameFile(targetInfo, linkInfo) { | ||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some more tests and ln
does not respect this, let's remove it. Probably previous comment about naming does not apply as we no longer need those variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bookkeeping: As per the offline discussion, this has to exist since there can be different slices in one package that create the same hard link multiple times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks James, I did a thorough pass and everything is looking good, let's just fix these three nits and I will merge :)
Thanks again for your first contribution, I think you nailed it.
This PR enables chisel to handle hard links. This is based on the assumption that the hard link and the target file are within the same tarball. If the hard links are not in the same slice as the target files in the slice definition file, the slice containing the target files should be included as the
essential
of the slice that contains the hard links.Related Discussion:
canonical/chisel-releases#259 (comment)