forked from bazel-contrib/bazel-gazelle
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Hack: go.work support with one-caveat (dependency bleed) #1
Closed
Conversation
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
stefanpenner
force-pushed
the
hack-duplicate-go-deps-from-file
branch
from
January 4, 2024 23:56
519a434
to
907af59
Compare
stefanpenner
changed the title
Hack: Allow duplicate calls to go_deps.from_file
Hack: go.work support with mega-caveats
Jan 4, 2024
stefanpenner
force-pushed
the
hack-duplicate-go-deps-from-file
branch
2 times, most recently
from
January 5, 2024 23:14
0348aa7
to
4a351bb
Compare
stefanpenner
force-pushed
the
hack-duplicate-go-deps-from-file
branch
3 times, most recently
from
January 19, 2024 20:49
fd29820
to
39fb524
Compare
stefanpenner
changed the title
Hack: go.work support with mega-caveats
Hack: go.work support with one-caveat (dependency bleed)
Jan 22, 2024
stefanpenner
force-pushed
the
hack-duplicate-go-deps-from-file
branch
from
January 22, 2024 17:36
39fb524
to
1ae9e29
Compare
stefanpenner
commented
Jan 22, 2024
MODULE.bazel
Outdated
@@ -48,15 +48,11 @@ use_repo( | |||
"org_golang_x_tools_go_vcs", | |||
# Referenced by `gazelle_binary`. | |||
"bazel_gazelle_go_repository_config", | |||
# Dependencies of rules_go that require special handling in go_deps. |
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.
Probably shouldn't remove these
stefanpenner
commented
Jan 26, 2024
stefanpenner
commented
Jan 27, 2024
from_file_tags = [] | ||
go_works = [] | ||
module_tag_path_to_label = {} | ||
|
||
for from_file_tag in module.tags.from_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.
let's leave ourselves and future travelers a nice comment here, describing what is happening and why.
stefanpenner
force-pushed
the
hack-duplicate-go-deps-from-file
branch
9 times, most recently
from
February 8, 2024 17:30
82b70b3
to
f7a7d32
Compare
stefanpenner
force-pushed
the
hack-duplicate-go-deps-from-file
branch
4 times, most recently
from
February 15, 2024 21:59
a869982
to
30af2af
Compare
stefanpenner
force-pushed
the
hack-duplicate-go-deps-from-file
branch
from
February 15, 2024 21:59
30af2af
to
dc31480
Compare
Caveats: * allows for dependency bleed between different go modules in the workspace - this is sorta by design for this stepping stone, but is far from ideal * doesn't support replace statements in go.work yet (but that shouldn't be to hard to add) continue the megahack experiment: handle replace in go.work Lets provide a warning if differing versions are discovered Improve duplicate Version Warning Message * include both core + meta version segments in warning. 0.0.0 vs 0.0.0 isn't useful * include label were offending versions reside ensure error message is valid for all three scenarios 1) if external dependencies are out of sync, and something go work sync can handle, inform the user to run `go work sync` 2) if in-repo dependencies managed by go.work are out of sync inform the user to manually correct 3) if external dependencies have the same core version, but a different meta version tell the user to manually correct transition warning to error and touchup message Add tests for handling go.work files These tests aren't exhaustive, but they match the testing done for go.mod files. In the future, it would likely be good to add additional more comprehensive tests.
stefanpenner
force-pushed
the
hack-duplicate-go-deps-from-file
branch
from
February 15, 2024 22:19
dc31480
to
d0dc074
Compare
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.
TODO: Basically everything beyond proof of concept
Up next: