Skip to content
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

Fix unnecessary rebuild of single file package #1811

Merged
merged 1 commit into from
Dec 16, 2019
Merged

Fix unnecessary rebuild of single file package #1811

merged 1 commit into from
Dec 16, 2019

Conversation

andre2007
Copy link
Contributor

@andre2007 andre2007 commented Dec 5, 2019

In case a single file package has dependencies, isUpToDate method checks whether dub.selections.json exists. As single file package has the UpgradeOptions.noSaveSelections dub.selections.json won't be created and therefore isUpToDate always returns false.
This pull request passes the UpgradeOptions.noSaveSelections to the build generator and avoid the check of dub.selections.json

@dlang-bot
Copy link
Collaborator

Thanks for your pull request and interest in making D better, @andre2007! 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.

@andre2007
Copy link
Contributor Author

version.d was added by mistake, i will remove it from pr

Copy link

@aliak00 aliak00 left a comment

Choose a reason for hiding this comment

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

A minor nit, but lgtm afaics

@andre2007
Copy link
Contributor Author

Ping:)

semaphoreci & appveyor issues are unrelated.

@andre2007 andre2007 closed this Dec 14, 2019
@andre2007 andre2007 reopened this Dec 14, 2019
@andre2007
Copy link
Contributor Author

Reopening pr to trigger voters again

@WebFreak001
Copy link
Member

The only thing I think should be improved now is that the variable is still called "saveSelections". I think some name that would better represent the documentation and the case what it actually does (rebuild if dub.selections.json is modified) would be more appropriate. Makes it easier to construct and read GeneratorSettings variables in new code (which is done both by dub and by third party libraries)

@andre2007
Copy link
Contributor Author

@WebFreak001 rebuilding is a decision at some specific point in the program flow based on the information that the selections are saved. Therefore I am not sure about changing the variable name, because.. But if you like I change the variable name, do you have a proposal?

@WebFreak001
Copy link
Member

hm you are right but the variable isn't used for anything else and I don't really see any other uses in it in the future.

Maybe this shouldn't be stored in GeneratorSettings at all like this, but rather only store "single" in generator settings (because generators might be interested in single more) and then determine bool checkSelectedVersions = !settings.single; in the isUpToDate function.

single would also fit the other existing build variables in there more imo

Copy link
Member

@PetarKirov PetarKirov left a comment

Choose a reason for hiding this comment

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

Looks good to me, nice work!

@PetarKirov
Copy link
Member

PetarKirov commented Dec 15, 2019

@andre2007 The lastest revision of your PR looks like a pretty clean change, but unfortunately right now dub-registry decided to take a break and the CIs haven't been able to test it, which I would prefer before merging. Please ping me (here, or better or on Slack) whenever at least some of the CIs are green again.

P.S. Thanks for following through on the problem and taking it to the finish line. I meant to work on this myself, but I haven't had enough free time lately.

Edit: looks like it's working now...

Copy link
Member

@WebFreak001 WebFreak001 left a comment

Choose a reason for hiding this comment

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

LGTM

With my current release dub I don't seem to be getting the "To force a rebuild" message that would make the test pass here, but I think this might just be something with my old dub version I have (and I can't build the new one because registry has a major downtime right now)

@andre2007
Copy link
Contributor Author

reopen to force a restart of pr voters

@andre2007 andre2007 closed this Dec 16, 2019
@andre2007 andre2007 reopened this Dec 16, 2019
@andre2007
Copy link
Contributor Author

andre2007 commented Dec 16, 2019

@WebFreak001 @PetarKirov
Thanks for your input.

Unfortunately the pr voters are all broken. See https://forum.dlang.org/post/iqbsiwwzcqylnzznbemx@forum.dlang.org

@andre2007 andre2007 closed this Dec 16, 2019
@andre2007 andre2007 reopened this Dec 16, 2019
@andre2007 andre2007 closed this Dec 16, 2019
@andre2007 andre2007 reopened this Dec 16, 2019
@PetarKirov PetarKirov merged commit a36c285 into dlang:master Dec 16, 2019
@andre2007 andre2007 deleted the fix_issue_1809 branch December 16, 2019 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants