feat(bzlmod): Use a common constant for detecting bzlmod being enabled#1302
Merged
rickeylev merged 1 commit intobazel-contrib:mainfrom Jul 10, 2023
Merged
feat(bzlmod): Use a common constant for detecting bzlmod being enabled#1302rickeylev merged 1 commit intobazel-contrib:mainfrom
rickeylev merged 1 commit intobazel-contrib:mainfrom
Conversation
Contributor
Author
|
@rickeylev Thoughts on me breaking the |
98a1377 to
d988458
Compare
Various parts of the codebase detect whether bzlmod is enabled or not. Most of them copy/paste the same if @ in Label(..) trick, and use a comment to explain what they're doing. Rather that copy/paste that everywhere, this commit uses a constant defined that does this once, then code can simply check "if BZLMOD_ENABLED". This commit also refactors the BZLMOD_ENABLED variable to its own file, so that we are not loading skylib all of the time.
d988458 to
8bdab7e
Compare
Collaborator
SGTM. From the error you shared, I think the issue is the skylib dependency becomes newly introduced during the workspace/module-extension phase. Which yeah, if we don't actually need it during that phase, +1 to refactor things such that it doesn't need to be loaded. |
rickeylev
approved these changes
Jul 10, 2023
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.
Various parts of the codebase detect whether bzlmod is enabled or not. Most of them copy/paste the same if @ in Label(..) trick and use a comment to explain what they're doing.
Rather than copy/paste that everywhere, this commit uses a constant defined that does this once and reuses the constant value to determine if bzlmod is enabled.
Closes: #1295