nix icon indicating copy to clipboard operation
nix copied to clipboard

Remove dead code for `createSymlink` and `replaceSymlink`

Open fricklerhandwerk opened this issue 3 years ago • 6 comments

Problem

filesystem.cc is the only place where createSymlink() is used with three arguments: in the definition of replaceSymlink() with three parameters that is not used at all.

Proposal

Remove this third mtime parameter and delete the code that handled it.

Context

https://github.com/NixOS/nix/pull/7048 deals with timestamps, but there are occurrences that we can avoid handling altogether because they are dead code anyway.

fricklerhandwerk avatar Jun 12 '23 12:06 fricklerhandwerk

Hi, trying to make my first commit here. I updated the code and doubt I messed anything up, should be correct. But the pull request template asks me to explain the motivation behind the change as well as the context. I'm not sure what to do, should I just copy things mentioned in this issue? I don't know what else I can say, really. Anyway, please correct me if I'm doing anything wrong, help would be very much appreciated!

salpelter avatar Jun 12 '23 18:06 salpelter

Hey @salpelter, thanks a lot for taking time. I know first hand that contributing to Nix can be scary, so it's great that you're reaching out.

The motivation section in the PR template is for us maintainers to see at a glance what this is about. In this case, a copy of the problem statement will do. Generally, a sentence or brief paragraph is very helpful to get into context. Linking the underlying issue for reference helps.

fricklerhandwerk avatar Jun 12 '23 19:06 fricklerhandwerk

Thank you for a quick reply, @fricklerhandwerk! I'll do that soon. How long do you think it is gonna take for the reviewers to get to this kind or pull request? I'm just curious if it'll work out well, since I have no firm idea of what I'm doing (yet).

salpelter avatar Jun 12 '23 19:06 salpelter

We usually triage PRs every Friday, and since @Ericson2314 and me found this together, it is likely to get merged either instantly if it's obviously correct or... it goes its usual labyrinthine ways.

fricklerhandwerk avatar Jun 12 '23 20:06 fricklerhandwerk

I created a pull request. At first, I thought it would appear here as well, but now that I've thought about it, it makes sense why it didn't. Is there anything else I should do right now besides waiting?

salpelter avatar Jun 12 '23 20:06 salpelter

Thanks, just wait for reviews and address comments as you go. I linked this issue from there, this is how it shows up. If your PR doesn't feel ready, make it a draft so maintainers can filter it out.

Note that keeping a PR open for a long time can introduce even more work to get it merged, if it runs into conflicts with the master branch. Following up with incorporating feedback quickly helps in part, but sometimes things just get stuck on the maintainers' end due to lack of time.

fricklerhandwerk avatar Jun 13 '23 05:06 fricklerhandwerk