build.d: Save whether dependency was updated#10643
Conversation
|
Thanks for your pull request and interest in making D better, @marler8997! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. 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. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + dmd#10643" |
7c65cf5 to
78e885f
Compare
|
@marler8997 something has gone terribly wrong with building dmd. It used to build fairly quickly. Now I change one file, do a "debug" build, and it takes about 5 minutes. Debug builds are supposed to be fast, and they used to be fast. I'm doing a: |
|
This is killing my productivity. |
@WalterBright Does it also take that much time using the following command? EDIT; |
|
Looks like the problem is that |
|
fix here: #10663 note that problems like this are going to happen during this transition. That's why we are making changes gradually so we can isolate and identify issues quickly. However, I think this issue has likely been around for many months so I'm not sure why this is the first time someone has seen/reported it. |
Fixes a race condition caused by b3621e8
The problem is line 1420
return false;. The first time something callsrunit will return whether or not it was updated correctly, but all future calls will returnfalse. This introduces a race condition on whether or not the caller will see that the dependency was updated. The expected behavior is that therunfunction will always returntrue(meaning the dependency was updated in the current build) if it's command was executed, which signals that all the "dependents" will also need to be rebuilt.Note that I also removed the return type from
runSynchronized, which guarantees that it will always return the sameupdatedstate. There's no chance that you could have one statement sayreturn trueorreturn falseand return an updated state that doesn't match what it stored in theupdatedfield.