-
-
Notifications
You must be signed in to change notification settings - Fork 747
Add changelog entry for StdUnittest #6142
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
|
Thanks for your pull request, @wilzbach! 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. |
|
I don't understand why users need to know this Phobos specific implementation detail. At most, this would be a short note saying |
|
People complained about this e.g. @timotheecour @FeepingCreature
Even just (2) is reason enough for this to be in the changelog. |
|
When building with -deps -unittest, DMD will recurse into Phobos unittests, even when building something unrelated. However, since StdUnittest is not set, the Phobos unittests are semantically invalid. |
|
Wow, that worse than I originally understood. That means people's builds are broken because of the change to If so we need to either revert until the change @jmdavis was making (only running tests for compiled files) is in. Or, version out the effected unittests a-la version(StdUnittest) unittest
{
} |
|
Indeed, though note that luckily this only seems to happen on master so far. What worries me is that there doesn't seem to be a build step to detect this issue. In the medium term, it would probably be useful to have a command line flag to prevent -deps from recursing into certain packages, such as those that are linked in as libraries. Phobos could then be excluded via a default flag. |
I'm doing no such thing. I suggested that it looked like we needed to go in that direction, and I suspect that a DIP is required. I'm not a compiler dev and have no idea how to go about implementing such a fix. This is almost certainly not something that is going to be fixed quickly. So, if |
|
would something like this
https://forum.dlang.org/post/mailman.3193.1518032575.9493.digitalmars-d@puremagic.com
provide a better, less hacky and invasive solution?
dmd -unittest=+foo.bar,+std,-std.stdio args... to specify unittests in
select pkg/mod (analog to newly introduced -i=pkg syntax)
it allows to sepcify what gets compiled into a unittest, eg:
`dmd -unittest=-std main.d` will disable phobos unittests (ie things in std
package)
…On Thu, Feb 8, 2018 at 11:31 AM, Jonathan M Davis ***@***.***> wrote:
If so we need to either revert until the change @jmdavis
<https://github.com/jmdavis> was making (only running tests for compiled
files) is in.
I'm doing no such thing. I suggested that it looked like we needed to go
in that direction, and I suspect that a DIP is required. I'm not a compiler
dev and have no idea how to go about implementing such a fix. This is
almost certainly not something that is going to be fixed quickly. So, if
version(StdUnittest) is causing problems, then either it needs to be
given the axe, or all of the affected unittest blocks need to be marked
with version(stdUnittest), as disgusting as that may be. However,
unfortunately, this is exactly the sort of thing that we're not going to
catch with the autotester, because it requires compiling other programs
that use phobos rather than compiling phobos.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6142 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACF9YEaSVzFfgQ2hZRv5y69oZA8otz0-ks5tS0pmgaJpZM4R-SFH>
.
|
|
Sorry, meant to say that you suggested it as a solution. Regardless, it looks like for the time being It's a shame to remove this optimization, but it also sucks that we are slowing down peoples unittest builds by running our own unittests. That has to really suck for people who are using something like |
Yeah, but that's why we have been working hard to get the Project Tester up, running and moderately stable. @FeepingCreature that's one of the advantages of open-sourcing your libraries.
It's simple, no one is using
If those aren't too many, that's imho the best way to go. |
Honestly, I think that this needs to be automatic unless there's a technical reason why it can't be. It's ridiculous to be running unittest blocks in modules that were only imported. And as soon as you're turning unittest blocks on or off manually, there are going to be mistakes. Maybe such a feature would be worthwhile for being able to selectively run tests, but I don't think that it's a great way to go for fixing the problem of unittest blocks from other projects being compiled in when they shouldn't be. |
|
As I understand/conjecture it, the problem isn't even necessarily that they're compiled in so much as that they have to be processed in order to identify import statements that they may contain, so -deps is accurate. Hence why this problem only occurs in the -deps -unittest combination. |
FYI I've done that in #6159 |
👍 However, simply not running unittests for modules not being compiled would break the 'keep unittests in external file'+single file compilation idiom. I think there's a bigger problem here manifesting in
Essentially, we need a way of telling the compiler
Ideally, (2) can be inferred by collecting all imported modules (through import chains) and removing the modules in (1). If every library provided a |
|
Any further discussion on this should be moved to the forums or slack. |
@timotheecour asked me to write a short changelog entry, so here it is.
See also: