-
-
Notifications
You must be signed in to change notification settings - Fork 743
fix Issue 14198 - [REG2.067a] Link failure with Variant #3038
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
Conversation
37e3f96
to
646dc19
Compare
This is a regression fix. Please review & approve ASAP. |
Can you please add a comment to |
fix Issue 14198 - [REG2.067a] Link failure with Variant
fixup in #3044 |
fixup #3038 add reference to bugzilla issue 14198
toStr() actually needs a LOT of work. It needlessly allocates lots of memory, calls a complex function to do trivial formatting, etc. It makes CTFE slow. toStr() should not be recursive for non-recursive types. toStr(0) should not allocate memory. Why is there to!type, toImpl!type, and toStr? What is the point in having 3 functions? It took me hours to reduce the bug down to that point. std.conv.to is absurdly over-complicated with layers and layers and layers. It has poor unittest coverage at 94%. Floating point formatting is seriously undertested. Some functions are 100% untested, like strippedOctalLiteral(). std.conv is a foundational, critical infrastructure module, we can't be so sloppy with it. |
Here's how to check unit test coverage:
I.e. it's trivial to do. |
We should probably make coverage an acceptance criteria for pull requests in phobos. |
fix Issue 14198 - [REG2.067a] Link failure with Variant
fixup #3038 add reference to bugzilla issue 14198
In win32.mak, there's a minimum 'bar' for coverage tests. |
related, FYI https://issues.dlang.org/show_bug.cgi?id=14071 |
Is there work on introducing coverage requirements in the druntime and phobos makefiles? |
@andralex please check the bugzilla issue I have just posted |
(tl; dr: I hit the compiler ICE the very moment I tried to add some |
Not that the ICE isn't a bug, it is, but you added -cov to the library generation. It has to be added to the unittest build instead. And besides, -cov testing should be per-module, i.e. to test std.conv:
|
We don't build unittests for a single module in phobos and druntime because we can't override existing modules in the shared library during linking. |
I find it rather impractical because it tends to create lot of test case duplication to achieve solid coverage. If module A is built on top of B, it is much more efficient to define primary test cases in terms of A and only add ones to B that address missing bits in coverage. Because of that using -cov for whole library build has been my default preference so far. |
is not helping me. I got an additional distro dmd installed which gives me parse error. using ../dmd/src/dmd compiles but fails when linking because of the distro dmd/druntime/phobos install. I could just compile and then link by hand, but thats no fun. so what am I doing wrong here. |
Bug reports need to have enough detail that someone else can reproduce the problem.
It's a lot easier to debug things when a unittest immediately follows a function and tests it completely. Tangling it up with other modules makes things much harder to untangle (speaking from experience, and working on this bug is an example).
You wrote above that wasn't working - is that a regression?
There is no need to run unittests for the shared library. Unittests are not for testing shared libraries, nor are they for testing the compiler's code generation. They are for testing the logic of a function (and certainly coverage testing falls into that category). I run unittests with |
@WalterBright based on you reply I don't know what information you are missing. IMO it is clear that your example does not show which version of dmd to use, to compile the phobos file and how to link it. |
This was caused by the format functions recursively calling
to!string
, resulting in it not being inferred properly as pure. A specialization fixes it.