-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Checking for binary that is built as an implicit dependency of an integration test. #8020
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Oh wow I'm actually a bit surprised we allowed this in |
Oh, and just a heads up, |
@alexcrichton @ehuss, thank you for reviewing the pr.
I'll try to add comment as the last step. |
What do you mean by coordinating these two changes? Can you elaborate? |
I think that the PR which is going to be merged second might have to deal with some conflicts. |
Oh, right. Thank you for explaining @aleksator. |
☔ The latest upstream changes (presumably #8028) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
Looks good, just one minor nit!
@xiongmao86 Also, don't forget to squash the history ;) |
@xiongmao86 I'd put tests in the same commit as changes they are supposed to test as well. |
Thanks! |
📌 Commit 8b17895 has been approved by |
☀️ Test successful - checks-azure |
Congrats on the first successful PR! |
@alexcrichton, @ehuss, @aleksator, thank you very much for helping me with this pr.
Perhaps because of the three phase of writing code in agile development: test, implement, refactor. Here refactor is mix with implement because of squash? |
That does sound like a good ideal, but as a maintainer of this project we do not require a clean history in a PR. If you want to rewrite history so each commit makes sense on its own, in whatever way makes you happy, grate! If you what to record the order you actually made changes, with all of the wrong turns, also grate! |
Thank you for your tips, @Eh2406, so I am free to choose squash or not. But some repo does need to squash, what is the possible reason, is it possible in some specific situation that one approach is preferable than the other? |
Some people/projects really value clean historys, or the ability to bisect to an individual commit. There going to tend to want edited historys, or if that is to much work squashing. Other project put there priorities on different things. |
So it's a delicate tradeoff, and depend on project and people. Thank you @Eh2406. |
@xiongmao86 In my opinion, it's always good to have, but forcing it requires some amount of work, which for open source project might not be worth it and can turn off contributors if applied too rigidly. That's why cargo chooses not to (I think). At my workplace we choose to do so, as it has clear benefits and it's easy to have discipline within a small team, but much harder with potentially all of the internet for open source projects. For me it's easier to understand a feature that way, when the commit is self contained. You don't have to waste time tracking down what is this test supposed to check, when you can just click on a line annotation in an IDE and be shown connected feature right there. And vise versa, when you make changes you know which tests you will need to fix.
As you are developing a new feature, from the point of project's view refactoring does not exist yet. You should squash it and hide your work in progress, as it is only harmful noise. That said, when you change the existing code, that is refactoring that's important to show others. It should never be mixed into your new feature commit, but always provided separately. |
@aleksator, I see your point, in this case the test is good to commit with the feature. but sometimes the change is too big to squash together, as what the test account for is separate into several commits, then it is hard or sometimes impossible(if what I add is a single test) to separate the test, this is a time I feel a test is stand out as a single commit content. So is it ok to do so in this case, or there is actually a better way to divide the changes? |
I have read about the concept of incremental development that is we should take small steps to change code base, in this prospect, will large changes inherently bad to show up? Would this be the answer to my doubts above? |
I have not worked in a "you must squash all PRs" codebase, and it seems a extreme position to me. But to each their own. I have contributed to "commits should be incremental and interpretable" codebase. If a PR comes in that took a lot of commits to do something straightforward, squashing can be an improvement. If a big PR comes in, to big to understand in one sitting, asking that the contributor ( who probably, just having written it, understand it better than anyone ) to split it up into commits/PRs that can be reviewed one at a time, can also be reasonable. Just like how splitting your code into functions can make it easier to read. Does not mean that more functions is always better. You as a programer need to use functions to communicate what you were trying to do. Git/PRs/commits are the same way. Use the tools you have in moderation and with judgment to make your intent intelligible to others. |
@aleksator, @Eh2406, I see your point. Thank you very much for explaining. |
@Eh2406 Our views aren't different, actually. I'd do the same in the situation you described. |
Update cargo 8 commits in 8a0d4d9c9abc74fd670353094387d62028b40ae9..6e07d2dfb7fc87b1c9489de41da4dafa239daf03 2020-03-24 17:57:04 +0000 to 2020-03-31 03:22:39 +0000 - Fix man page typo for "Owner Options". (rust-lang/cargo#8057) - enable progress bar on all UNIX platforms (rust-lang/cargo#8054) - Squelch some rustdoc warnings. (rust-lang/cargo#8052) - Remove clippy tests. (rust-lang/cargo#8053) - Fix -Zfeatures=itarget with certain host dependencies (rust-lang/cargo#8048) - Checking for binary that is built as an implicit dependency of an integration test. (rust-lang/cargo#8020) - Use stabilized version of rustdoc's --crate-version (rust-lang/cargo#8039) - Remove the `git-checkout` subcommand. (rust-lang/cargo#8040)
Update cargo 8 commits in 8a0d4d9c9abc74fd670353094387d62028b40ae9..6e07d2dfb7fc87b1c9489de41da4dafa239daf03 2020-03-24 17:57:04 +0000 to 2020-03-31 03:22:39 +0000 - Fix man page typo for "Owner Options". (rust-lang/cargo#8057) - enable progress bar on all UNIX platforms (rust-lang/cargo#8054) - Squelch some rustdoc warnings. (rust-lang/cargo#8052) - Remove clippy tests. (rust-lang/cargo#8053) - Fix -Zfeatures=itarget with certain host dependencies (rust-lang/cargo#8048) - Checking for binary that is built as an implicit dependency of an integration test. (rust-lang/cargo#8020) - Use stabilized version of rustdoc's --crate-version (rust-lang/cargo#8039) - Remove the `git-checkout` subcommand. (rust-lang/cargo#8040)
When a project containing binary with required-features, the binary will only be built with the given dependency's feature is enabled. But this feature syntax is not checked when the binary is built as an implicit dependency of an integration test. This pr addresses this issue.
More info is in the issue page: this pr fixes #7853.