Allow building deprecated modules without deprecation warnings#2650
Merged
Geod24 merged 1 commit intodlang:masterfrom Jan 11, 2024
Merged
Allow building deprecated modules without deprecation warnings#2650Geod24 merged 1 commit intodlang:masterfrom
Geod24 merged 1 commit intodlang:masterfrom
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=63sFull build output |
0e8fcfd to
63a2add
Compare
Geod24
reviewed
Jan 11, 2024
source/dub/project.d
Outdated
| /// The template code from which the test runner is generated | ||
| private immutable TestRunnerTemplate = q{ | ||
| module dub_test_root; | ||
| deprecated module dub_test_root; |
Member
There was a problem hiding this comment.
Maybe add an explanation here so a person looking at it is not puzzled as to why we do this.
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
Geod24
approved these changes
Jan 11, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).