You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the Have_x versions should have the possible drawbacks discussed.
If you use version(Have_x), then that version might be defined when importing modules from a project, even if the project does not have a dependency on x. This can lead to bizarre behaviors like versioning out symbols that look like they should be present, resulting in linker errors.
A dependency is never built with Have_x unless x is actually a dependency.
I'm not sure how to describe this in a concise or non-confusing fashion. Maybe a simple example.
The current dub documentation is very sparse on the subject.
Not direct, but a dependency. The example from discord was something like:
moduleb; // project bversion(Have_a) int x;
And then in project a, it thinks there's an x int variable when it imports b, but when b is built, it omits that. This is because b doesn't build with Have_a as a version.
@schveiguy
Using the
Have_x
versions should have the possible drawbacks discussed.If you use
version(Have_x)
, then that version might be defined when importing modules from a project, even if the project does not have a dependency onx
. This can lead to bizarre behaviors like versioning out symbols that look like they should be present, resulting in linker errors.A dependency is never built with
Have_x
unlessx
is actually a dependency.I'm not sure how to describe this in a concise or non-confusing fashion. Maybe a simple example.
The current dub documentation is very sparse on the subject.
@WebFreak001
wait do you mean that x is a direct dependency? (optional or not)
I think it would probably rather be a bug if it was included without it being a direct dependency. (optional or not)
@schveiguy
Not direct, but a dependency. The example from discord was something like:
And then in project a, it thinks there's an
x
int variable when it imports b, but when b is built, it omits that. This is because b doesn't build withHave_a
as a version.If
a
becomes a dependency ofb
, then it is OK.@WebFreak001
ah right, a note / warning for this would probably be nice on the documentation page then.
It's probably a bug that the dependency even has that
version (Have_a)
statement without havinga
as dependency, as it would always be false then.@schveiguy
Right, that int will never be defined. That's probably the easiest way to explain it.
The text was updated successfully, but these errors were encountered: