-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Allow building deprecated modules without deprecation warnings #2650
Conversation
90f2a0c
to
0e8fcfd
Compare
✅ PR OK, no changes in deprecations or warnings Total deprecations: 0 Total warnings: 0 Build statistics: statistics (-before, +after)
executable size=5318488 bin/dub
-rough build time=62s
+rough build time=63s Full build output
|
0e8fcfd
to
63a2add
Compare
source/dub/project.d
Outdated
@@ -1911,7 +1911,7 @@ final class SelectedVersions { | |||
|
|||
/// The template code from which the test runner is generated | |||
private immutable TestRunnerTemplate = q{ | |||
module dub_test_root; | |||
deprecated module dub_test_root; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add an explanation here so a person looking at it is not puzzled as to why we do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
The compiler issues a deprecation warning only on a "non-deprecated" -> "deprecated" transition. As such, building or testing Dub packages which have deprecated modules when a dub_test_root.d file needs to be generated will cause deprecation warnings. This in turn makes it impossible to use `buildRequirements "disallowDeprecations"` in this situation. Fix this by simply making the auto-generated root module (dub_test_root) deprecated. As it is the compiler's entry point, the module itself will not cause a deprecation warning, and it importing deprecating modules will not cause deprecation warnings (as there is no longer a transition of deprecation state).
63a2add
to
7cacf52
Compare
The compiler issues a deprecation warning only on a "non-deprecated" -> "deprecated" transition. As such, building or testing Dub packages which have deprecated modules when a dub_test_root.d file needs to be generated will cause deprecation warnings.
This in turn makes it impossible to use
buildRequirements "disallowDeprecations"
in this situation.Fix this by simply making the auto-generated root module (dub_test_root) deprecated. As it is the compiler's entry point, the module itself will not cause a deprecation warning, and it importing deprecating modules will not cause deprecation warnings (as there is no longer a transition of deprecation state).