Repository navigation
Add support for the -i interface and maintain backwards compatibility. - #292
marler8997 wants to merge 1 commit into
Conversation
|
Thanks for your pull request, @marler8997! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Some tips to help speed things up:
Bear in mind that large or tricky changes may require multiple rounds of review and revision. Please see CONTRIBUTING.md for more information. 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. |
|
Note: implementation is currently very "rough", still working on it. |
|
Thanks for your continued work on this matter. Have you evaluated using |
|
It's seems to be missing to much information. |
|
Could improving |
|
Could be, but supporting verbose going to a file would be much less work:) |
Yeah, but I can see the point in objections for that. Currently, We probably should have made Would it really be more complicated printing a line to |
|
You make some good points. I'll look into this more tomorrow. I suppose it wouldn't really be more complex now that you mention it. |
|
Thanks! |
|
I just remembered that the |
|
Err, but, we're already doing that because we're doing one-pass compilation anyway, right? Also, is |
|
Were only adding semantic analysis on the modules that are being compiled. The biggest impact this would have is on druntime/phobos modules, forcing you to fully analyze all those modules who have a dependency even if they aren't being used. Yes |
|
running a simple comparison, |
|
Correction, most of the slow down was from printing all the information to the console. Apparently |
|
I've "double checked" my suspicion that the extra semantic analysis is causing the slow down. There's 2 lines in mars.d you can comment out to disable the extra semantic analysis, when I commented those out, the performance of |
|
Hmm, well, that just tells us that we've made a mistake by bundling that behaviour with the I recall that this (enabling deep scanning with if not, then we can make the flag a toggle, like |
|
Good question, might try to ask around. Also Walter says we could use the JSON file for this, will look into that as well. |
|
What happened to just using |
|
That doesn't solve the linker output problem. |
|
We could go with that too. I left a comment in the code if we go that route. The only problem with that one is now we have to redirect stderr, but might not matter. But the extra compiler invocation to get the version may be negligible, likely affecting final time less than a millisecond since it's caching the file access anyway |
|
What doesn't solve the linker problem? |
|
If the linker output problem gets addressed before 2.079 gets fixed, you wouldn't have to worry about that... |
Essentially this is unrelated and orthogonal to the question of "How do we get the list of dependencies, now that we invoke the compiler exactly once?". Parsing stdout/stderr is complicated because we have to be mindful of letting compiler errors, linker output, and user |
I don't understand what you mean by that. How would the linker output problem "get addressed", and how would 2.079 "get fixed"? |
|
Right |
|
I thought Jonathan was working on making the linker write to stderr or do use sth like a "L:" prefix for all linker output, no? |
|
There's alot going on, it's hard to keep track. I am exploring both of these issues. |
a2e9c98 to
ddeb7d2
Compare
aeabb9d to
f95bc25
Compare
|
@andralex @wilzbach @timotheecour Wanted to get your guys' opinion on this. So far we've had 2 options proposed to allow This PR currently uses option 2, however, as I've been looking through the code I've seen bug fixes and other feature enhancements that could be using other features that were only made available in certain versions of the compiler (the I do want to note that the performance impact of checking the compiler version will likely be negligible. Andrei pointed out that even though we have to deal with the overhead of creating an extra process, it will make the next invocation faster since it has "warmed up" the file-system/memory to load that process again. And if process creation has a noticeable impact we can cache the result of the version check. I also want to mention that this change does complicate |
|
Detecting the version scales forward nicely; future features can use that as well. |
|
Ok, so long as there are no objections, we'll go with detecting the version. |
|
FYI, I've added the compiler version to the json file so we could use that moving forward. If the json file was cached, get the version from that, otherwise invoke the compiler to get the version. |
f95bc25 to
f327989
Compare
|
here's a more robust way to solve these use case (figuringing out if compiler has feature X like allowing -i or -deps or -deps=file, etc): // pseudocode
execute(`dmd -Xf=query.json`);
bool has_dash_i = `query.json`.readText.parseJson["features"].canFind("-i");Advantage: more robust:
NOTE: this requires |
|
The disadvantages of
Yeah, but |
|
|
we would of course allow -Xf with no other arguments in support of this. |
Which is then essentially |
|
As far as I understand, we don't need |
|
Yes, but |
|
Then perhaps we should do that, then. Anything useful for Dub and planned for |
|
exactly. |
5c1bca5 to
b398d48
Compare
Definitely. Let's add it to the JSON file soon before the next release so you don't have to support different versions of the JSON file. |
b398d48 to
5bf5e4a
Compare
5bf5e4a to
d499f72
Compare
|
Based on the resistance I get when pushing changes to this repo, I've decided my time is better spent elsewhere. |
A backwards compatible alternative to #271