-
-
Notifications
You must be signed in to change notification settings - Fork 608
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 Issue 14508 - [REG2.067.0] compiling with -unittest instantiates … #4780
Conversation
|
Hmm, now I'm getting all sorts of weird failures in the test suite for things that appear unrelated. I fear I have no idea how all this works after all these revisions. |
bc68c59
to
3a01e20
Compare
…templates in non-root modules
|
I dislike this change. |
|
@9rnsr I understand, but it works and is straightforward. The other proposed solutions come with problems I mentioned that are worse. |
|
I found that this PR will introduce another issue. After this change, issue 2500 case will become unsupported without To fix that, users need to add In short, this change will request huge performance regression in practical projects. I cannot accept this. |
|
I suggest pulling this one for now, especially for the 2.068 release, as it puts us back into a known state. The other suggested PRs are complex and risky for adding to a beta that is being prepared for release. |
|
Yes, this PR will change back things to the known state, along with the huge side effect. I believe it will be called "regression". On the other hand, my PR has no known side effect, although it's a little complex than this. From my experience, a bugfix is always risky (let's consider the number of regressions wchich introduced by the previous bug fixes). Therefore I think it would not be so much reason in this case. Sorry, at least I cannot accept this change. |
|
It think it's the right place to fix the issue (see |
|
I'd suggest that we do not fix the template and compile time issue for 2.068.0. Clearly this pull will break many projects, and -allinst is not an appropriate workaround. Also you can't seem to come to a conclusion with Kenji about #4784. |
|
Outline of a better template instantiation approach.
This is very similar to the current scheme, but getting rid of the |
|
This should have gone into 2.068. We know that it works. We got ourselves into a jolly mess with the other schemes. |
We know that it doesn't work Walter. That's the state you introduced with the non-root module optimization. It broke about every other project and Kenji had to clean up all the mess. |
It's not suddenly requiring it. It was required back in 2.066. There was no disaster with it - a few projects added -allinst and it was good. Then all the complexity came in, with compiler slowdowns, and repeated regressions. |
2500 is when modules mutually import each other. That indeed is a problem with this PR, but can be fixed by checking for mutually importing modules. It's not necessary to come up with the overcomplex other schemes. |
I'm not sure what you are saying. The line 7937 you're commenting out in In there: If |
…templates in non-root modules
https://issues.dlang.org/show_bug.cgi?id=14508
This is an alternative to Kenji's fix #4626 which is a fix for a regression introduced by #4384. It essentially reverts part of 4384.
The problems with 4384:
So, 4626 was introduced to solve a problem https://issues.dlang.org/show_bug.cgi?id=2644 where a template wasn't being instantiated. We already have a solution to this, the
-allinstcompiler switch. I admit it's a crude approach, but it works, and is fairly easy to understand, explain to others, and implement. Yes, that switch slows down compilation too, because it instantiates everything in sight, but the cost is only borne by those who insist on creating complex circular template imports, not everyone else.4626 also has a fix for https://issues.dlang.org/show_bug.cgi?id=10920 which I leave intact.