-
Notifications
You must be signed in to change notification settings - Fork 381
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
Writing resolved Go modules as K:V JSON for external bookkeeping #1906
Open
Buzz-Lightyear
wants to merge
9
commits into
bazel-contrib:master
Choose a base branch
from
Buzz-Lightyear:srini/depgraph
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7916a0f
Writing resolved Go modules as K:V JSON for external bookkeeping
Buzz-Lightyear f06c5cb
Merge remote-tracking branch 'origin/master' into srini/depgraph
Buzz-Lightyear dfc4ad6
Only adding K:V for modules that have resolved versions
Buzz-Lightyear f11a8a6
Trying to explose resolved deps via bazel_gazelle_go_repository_config
Buzz-Lightyear 367d612
For internal modules, version is None, so we're excluding it
Buzz-Lightyear aa09427
Exporting resolved_deps.json
Buzz-Lightyear f0e1348
Merge branch 'master' into srini/depgraph
Buzz-Lightyear a5c9bc3
Merge branch 'master' into srini/depgraph
Buzz-Lightyear f78ae1e
Merged in latest
Buzz-Lightyear File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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.
Files written by module extensions are emitted into an unspecified temporary directory that should be removed after execution. We would need to instantiate a repo with this info or accept an absolute path via an environment variable.
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.
Makes sense, I'm propagating this similar to config.json used by rules_go. I was able to verify that I can access this file as
@bazel_gazelle_go_repository_config//:resolved_deps.json
. Would this approach work?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.
I can also expose this via a separate repo rule if that's preferable. On a related note, while I can pull this into my workspace as
@bazel_gazelle_go_repository_config//:resolved_deps.json
,bazel mod tidy
still thinks this repo is an indirect dependency and removes it fromMODULE.bazel
(I'm explicitly passing it in as inputs to both a build rule and ash_binary
rule). Is that perhaps a bug? If not, can I add a directive to informbazel mod tidy
that I intend to keep that use_repo call?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.
Unsure why Windows build of rules_go is failing but interestingly I see Bazel warn that the repo is an indirect dependency in Gazelle's own MODULE.bazel file:
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.
Looks like the failure was intermittent and unrelated to the change