Conversation
|
Thanks for your pull request, @marler8997! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Some tips to help speed things up:
Bear in mind that large or tricky changes may require multiple rounds of review and revision. Please see CONTRIBUTING.md for more information. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
|
Thanks, this looks much more tractable. I'll have a proper look tomorrow, but in the meanwhile:
|
I don't see this as a problem. I want to know that
In my mind, the point of the logging is to tell the developer what's going on. Yes |
It's not a big deal; I used it as an example. The point is that it's helpful if you can write up a more detailed commit message describing in more detail the motivation for these changes, how these changes address those concerns, and so on.
This seems at odds with what you said in the previous PR:
... which suggests that you wanted to ensure that verbose output matched In any case, the So, I'd suggest dropping |
WebDrake
left a comment
There was a problem hiding this comment.
A few more thoughts and notes on the changes proposed here.
I kind of feel that this approach is right but not necessarily complete enough. In particular, there's a discussion to be had about the way that dryRun interacts with verbose output.
I'm going to try to summarize this in a few issues.
rdmd.d
Outdated
| auto cutoff = Clock.currTime() - dur!"hours"(lifetimeInHours); | ||
| yap("dirEntries ", pathname); | ||
| foreach (DirEntry d; dirEntries(pathname, SpanMode.shallow)) | ||
| foreach (d; std.file.dirEntries(pathname, std.file.SpanMode.shallow)) |
There was a problem hiding this comment.
This is odd: why not create a similar wrapper function here that handles the yap under the hood? Why preserve a manual yap call in the code as is done here?
There was a problem hiding this comment.
seemed unnecessary here. this function is only called once and the wrapper function would be larger than then other functions.
rdmd.d
Outdated
| std.digest.md, std.exception, std.getopt, | ||
| std.parallelism, std.path, std.process, std.range, std.regex, | ||
| std.stdio, std.string, std.typetuple; | ||
| static import std.file; |
There was a problem hiding this comment.
Note that an alternative to static import std.file could be to use selective imports that very carefully determine which std.file functions are allowed to be used unwrapped.
There was a problem hiding this comment.
yes I'm aware. I think static in this case makes more sense.
rdmd.d
Outdated
| try | ||
| remove(fullExe); | ||
| catch (FileException e) | ||
| std.file.remove(fullExe); |
There was a problem hiding this comment.
Why use std.file.remove here (with a manual yap above) rather than a call to the remove wrapper function?
There was a problem hiding this comment.
Look at the code and I think you'll see why.
rdmd.d
Outdated
| { | ||
| yap("mkdirRecurse ", name); | ||
| if (!dryRun) | ||
| return std.file.mkdirRecurse(name); |
There was a problem hiding this comment.
This touches on a rather interesting problem of rdmd: dry-run mode is implemented manually throughout the codebase. This means that in various places if (!dryRun) blocks mean that different output will actually be produced for --dry-run as opposed to just --chatty.
It might therefore be worth rethinking the wrapper functions as not just encapsulating the needed yap calls but also encapsulating the if (!dryRun) as and where needed (i.e. for those filesystem calls that actually change the filesystem, as opposed to just querying it).
There was a problem hiding this comment.
this is the only function affected by dryRun. this approach makes sense to me
rdmd.d
Outdated
| string absPath = buildPath(envPath, path ~ extension); | ||
| yap("stat ", absPath); | ||
| if (exists(absPath) && isFile(absPath)) | ||
| if (existsAsFile(absPath)) |
There was a problem hiding this comment.
Just use if (exists(absPath) && isFile(absPath)) here. It's simpler, it saves you defining an unnecessary extra wrapper function, and it makes the verbose report more correct.
rdmd.d
Outdated
| // | ||
| // std.file wrappers that also log their operations | ||
| // | ||
| auto exists(R)(R name) |
There was a problem hiding this comment.
Is there any need for the templates here? It's easier to just support string and modify if another use-case ever comes up.
There was a problem hiding this comment.
templates are easier for me
The point of |
The absence of those 2 log statements was something that you were complaining about in the previous PR. Can you please clarify? |
|
I was complaining about the logging accuracy. File operations that were being done with NO log statements at all. Combining 2 log statements for the same 2 operations is not a problem. |
|
What you said at the time was:
... which seemed to suggest this was the focus of your problem. Since you now say it's other things that were concerning you, can you give some specific examples of the missing The concern I have is that in some cases it might be deliberate that nothing gets reported. |
Look at the code yourself. I don't want to spend the time to explain every little thing to you. |
Gosh, you are a charmer. You are the one who is trying to justify making a change to I'm asking you a polite question to try to better understand your perception of why this change is necessary, so that I can offer more constructive advice. I've also given a motivation for that question which is quite reasonable. So please, just answer it. I'm asking you to save me time by telling me what you already know, instead of wasting my time by asking me to second-guess what your concerns are or what bits of the code you're really trying to fix. Your refusal (in the previous PR) to answer my questions wound up wasting not only my time, but that of two other reviewers. We're all volunteers here, so our time is precious and limited; anything you can do to save it matters, and anything you do that deliberately wastes it is frankly antisocial. You've already behaved towards me, on multiple occasions now, with no small amount of arrogance, rudeness, and personal attacks. Despite that, I've consistently offered constructive and detailed feedback on your code and concerns -- feedback that seems to have been useful to you, since this PR takes ideas from it. So I think that, just maybe, it might be reasonable to expect you to start engaging a bit more constructively yourself. |
By the way, if the concern really is about missing Just add them. That will fix the immediate problem, in a completely non-intrusive way. It will also be much more easy to spot if there are any cases where the omission may be deliberate. And then, after that, we can have a much more effective discussion about how best to refactor the code to avoid relying on developer virtue in reporting chatty output. |
|
I don't mean to be rude. I just don't have time to explain everything. It's a waste of both our times. In my opinion, you're discussing this PR much more than it needs to be. Please limit your suggestions as much as you can. Since I can't spend all the time it takes to address all of your questions, please consider making this change yourself. It will save both of us time. |
|
OK. I can understand limited time and its frustrations. I do strongly advise, though, that in that case you try to communicate much more up-front about the specific reasons and thinking behind your PRs. It takes a little more time when preparing them, but saves a LOT of time (yours too!) when they are being reviewed. |
|
Could we get this one merged? The new logic for rdmd I'm working on is quite complex and fixing the logging would be very helpful. |
|
The bottom line of this is that it feels like a more intrusive change than is necessary, without a really good sense of the impact it has. The newly introduced functions are not just well-defined verbose wrappers for I'd suggest just creating a new PR with the missing It's better to make the simplest change to get the desired result, rather than add to the existing complexity of |
|
I respectfully disagree with just about everything you said. If a maintainer could take a look and either merge or provide improvement suggestions it would be great to get this logging fixed. |
60cfac1 to
48db854
Compare
|
Yes, it would be good to get a third viewpoint on this PR. |
|
FWIW, I'm not opposed to the broad thrust of what you're trying to achieve here. I just think it'd be a good idea to distinguish between the short term need (fixing missing verbose output) and the long term one (providing a more robust and consistently reported structure for |
|
It's a shame there's no Ideally it should could/should use In general don't think we should waste too time on such bike-shedding discussions. Let's tackle the big things, not the color of the shed! |
It doesn't though (it moves some, but not all). That's the problem :-( I agree the aim is worthwhile but I think the issue of chatty output needs a more comprehensive and considered think-through to try to separate out all the concerns. I'll try to file an issue or two on this in the next days. I don't agree that this is bikeshedding -- code consistency and clarity is not a trivial issue. |
I agree in general, but from my experience on the effort I spent on introducing and improving the code consistency at phobos, the time is better spent on fixing actual bugs.
I agree that if the Anyhow independent to the discussion of whether |
|
I left a review on #295, most of which applies to this PR as well: |
2cf20c2 to
d556590
Compare
ab00406 to
025f7c5
Compare
CyberShadow
left a comment
There was a problem hiding this comment.
In case you'll do another pass, a few more nitpicks:
| struct Filesystem | ||
| { | ||
| static: | ||
| static auto opDispatch(string func, T...)(T args) |
There was a problem hiding this comment.
static on function is redundant
There was a problem hiding this comment.
I think the redundancy is ok....if this struct had really big functions, and you couldn't see the static: modifier, having static in the function definition is helpful. But if you really don't like the redundancy, I'll remove it.
There was a problem hiding this comment.
Ah OK, I didn't realize it was intentional.
rdmd.d
Outdated
| /** | ||
| Update a file's timestamp. | ||
| */ | ||
| static void touch(string name) |
rdmd.d
Outdated
| Operates on the file system without logging its operations or being | ||
| affected by dryRun. | ||
| */ | ||
| struct DirectFilesystem |
There was a problem hiding this comment.
Since we shouldn't be using this directly, maybe move it under Filesystem?
025f7c5 to
9135e1f
Compare
|
BTW I created #tools on Slack in case you want to have a more real-time discussion (it even supports calls :P) |
Unfortunately I can't get on dlang slack right now :-\ |
9135e1f to
ac3d35b
Compare
ac3d35b to
181538c
Compare
wilzbach
left a comment
There was a problem hiding this comment.
I like it 👍
Thanks for all the hard work!
@joseph-wakeling-sociomantic any final words or can we focus on more impactful PRs? ;-)
ac3d35b to
5fed01b
Compare
|
Well, my objections haven't changed, but if everyone else approves I don't see any reason to stand in the way. I still strongly dislike the introduction of I think the approach taken here can be tightened up further and made into a more rigorous "safety wrapper" around |
|
(Basically, I don't see the point in writing more code for a less accurate and informative outcome. And I don't think I've ever had actually had an explanation for why that's worth doing.) |
Must be "goldfish syndrome". Here's 4 times I've explained it:
|
No, but if the detail isn't important, it's also not important enough to write extra code to prevent it happening.
I'm aware that that's the point of it. I'm suggesting that's a bad tradeoff (more code for a less comprehensive result).
No, but why put effort into actively creating that situation when you don't have to?
That it's "noise in the log" is a contention ... not a fact. (For example, part of the reason it may seem "noise" is because |
|
Ok it looks like we disagree in this case, and that's ok. I don't have a problem with disagreement, but I do have a problem with the way you discuss these disagreements. You tend to bring up a few valid points, but then sprinkle in demonstrably false claims and inferences (i.e. no one has explained to you the reason for |
|
I didn't say that no one had explained to me the reason for |
Yes I suppose that's true. So you were saying that the reasons I gave weren't enough to justify a new function with 1 line of code. Ok, glad we got that one cleared up. |
Yes, especially given that the introduction of this function creates a situation where there are 2 different ways of doing the same thing instead of 1 (i.e. a dev can do either |
|
@WebDrake We've already established that we fundamentally disagree on this. Rehashing the arguments doesn't help, it just wastes time. I would suggest learning when to move on. |
These discussion points aren't just made for you. It matters that other reviewers understand why there is a disagreement, because this helps them make a more informed decision. There's a slightly bigger picture line of thought I'm having, which it might be good to explain. I'm considering whether it might be possible to replace the encapsulation-breaking So, I'd like to ask you to not impose something that I'll have to either unpick or separately extend if I want to do that. |
I'll just add: I've already stated above, "If everyone else approves I don't see any reason to stand in the way." Maybe it would be a good idea to drop the ad-hominem? |
|
If attempting to promote constructive discussion is "ad-hominem", then I think it's a good idea to do so every once in a while when discussion "devolves" :) I hope there's no ill feelings and we can continue to work together. I'm glad you're looking into adding more testing, that's a great way to help. We may differ on some things but I can see that you're a bright person, even though I think some of your effort is a bit misguided. Anyway, I hope our discussions are more productive in the future. |
|
Thanks for taking the time to write this. No hard feelings -- constructive disagreement isn't a bad thing, and I always have a lot of gratitude for anyone who takes the time to work on any part of D. I look forward to those productive future discussions :-) |
No description provided.