Skip to content

Comments

build.d: simplify isUpToDate#10588

Merged
dlang-bot merged 1 commit intodlang:masterfrom
marler8997:buildIsUpToDate
Nov 22, 2019
Merged

build.d: simplify isUpToDate#10588
dlang-bot merged 1 commit intodlang:masterfrom
marler8997:buildIsUpToDate

Conversation

@marler8997
Copy link
Contributor

No description provided.

@dlang-bot
Copy link
Contributor

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 verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

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 references

Your 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 locally

If 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#10588"

Copy link
Contributor

@MoonlightSentinel MoonlightSentinel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions

if (force)
return false;

auto oldestTargetTime = SysTime.max;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe start with the timestamp of thisBuildScript to avoid the chain + array literal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is supposed to be generic, not specific to this particular build.d.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

Copy link
Member

@PetarKirov PetarKirov Nov 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, we really ought to start using a more robust mechanism for determining whether we need to rebuild (like comparing a hash digest of the sources with a previously recorded hash, if any), not just the timestamp. Do you think this would be easily doable (of course I'm not talking about doing it with this PR)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Source hashing" does make the build more robust, but comes at the cost of performance. @CyberShadow and I had a discussion about doing this in rund (dragon-lang/rund#22). Right now my thought is that source hashing for rund (and probably for build.d as well) is that it's not really worth the performance cost and extra build logic.

Note that I'm assuming that source hashing would only help with "false positives" (rebuilding when you don't need to). If it also fixes "false negatives" (not rebuilding when you do need to) then I would give it more importance. If you know of "false negative" use cases it would fix then let me know.

I think my comment here would also apply to source hashing in build.d: dragon-lang/rund#22 (comment)

@marler8997 marler8997 force-pushed the buildIsUpToDate branch 2 times, most recently from a2e1ffb to 302fef7 Compare November 18, 2019 20:43
@thewilsonator
Copy link
Contributor

@marler8997 please give this a force push as it seems the doc tester has failed due to network errors.

@thewilsonator
Copy link
Contributor

Oh, there a merge conflict.

@marler8997
Copy link
Contributor Author

Rebased, this one should be good to go.

@dlang-bot dlang-bot merged commit 63f5dc2 into dlang:master Nov 22, 2019
@marler8997 marler8997 deleted the buildIsUpToDate branch November 22, 2019 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants