-
-
Notifications
You must be signed in to change notification settings - Fork 236
Remove $DFLAGS build type (but keep supporting the $DFLAGS variable) #3060
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
base: master
Are you sure you want to change the base?
Conversation
While it is useful and expected that dub would honor the $DFLAGS variable, it should not drop *all* flags that it adds on its own. The most egregious way this is manifesting is that: - `dub test` - runs unittests (duh) - `DFLAGS= dub test` - does not run a single test This is because dub would treat the presence (even if empty) of $DFLAGS as flags to override the current buildType. This has been changed and now $DFLAGS simply are appended to the flags derived from the buildType. If users actually want to prevent dub from passing any special flags they can do so with `dub test --build=plain` Signed-off-by: Andrei Horodniceanu <[email protected]>
|
✅ PR OK, no changes in deprecations or warnings Total deprecations: 0 Total warnings: 0 Build statistics: statistics (-before, +after)
executable size=5249272 bin/dub
-rough build time=59s
+rough build time=58sFull build output |
|
It's something I've been thinking about for a while now. I agree we should do it. I'm currently in vacations abroad so have limited time to review this week, but feel free to ping me next week if you see no action. |
|
While I do agree that the usability of the current approach is lacking and doesn't really make sense in the case of Maybe an alternative approach could work here, for example a command line argument (e.g. |
scripts:
This really don't seem like that big consequence compared to the fact that there is no way to safely pass flags to the compiler when scripting, which is a very common occurrence with
As in it lets it leak into the environment, but doesn't actually set Note that this is another issue that should be fixed/specified. Currently
Nothing easy comes to mind but I would imagine do the same thing: compile with |
Okay, with this, I'd agree that the consequences are rather limited and I don't have objections then. I was under the impression that currently DFLAGS would be ignored when a specific build mode was passed (not sure whether that already got changed along the way?). My
The default mode should always be to treat "deprecations" as non-fatal warnings and "warnings" as errors. Code that doesn't compile without actual "warnings" should specify "allowWarnings" as a build requirement instead of relying on DFLAGS, though, but I guess you are in a situation where you are compiling foreign code with a newer compiler?
What I meant is actually the non-environment DFLAGS variable defined by the build variable feature that is only available within the package recipe itself. But you are also right that it will pass on the DFLAGS variable from the parent environment, which is actually really messy, unfortunately. So it looks like we'll eventually have to introduce some kind of breakage here in order to streamline this. |
This is the issue, I understand that this was the initial intention, to treat warnings as errors but, given the current landscape where:
It sounds reasonable to abandon the original idea and to allow warnings by default, for All of this is unrelated to this PR though, so maybe the discussion should be continued in a separate issue.
yes, I usually hit it when trying to build somebody else's dub project, either in CI or as a package for Gentoo, and the build almost always prints deprecations, leading to ugly hacks to coerce dub into building with |
While it is useful and expected that dub would honor the $DFLAGS variable, it should not drop all flags that it adds on its own.
The most egregious way this is manifesting is that:
dub test- runs unittests (duh)DFLAGS= dub test- does not run a single testThis is because dub would treat the presence (even if empty) of $DFLAGS as flags to override the current buildType. This has been changed and now $DFLAGS simply are appended to the flags derived from the buildType. If users actually want to prevent dub from passing any special flags they can do so with
dub test --build=plain