-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #2480 This fixes the problem where in some occasions dependencies from workspace are not loaded correctly when `--path` is passed. For example, `buf build workspacedir/a --path workspacedir/a/foo.proto` when `workspacedir/b` and `workspacedir/c` also exist. In `module_file_set_builder.go` module b and module c would be hashed based on their `TargetFileInfos`, which are both empty slices due to the `--path` filter. Same hash means only one of them gets added to the list of potential dependencies. In this PR, workspace modules are distinguished by their directories relative to the workspace directory. This is accomplished by adding `WorkspaceDirectory` to interface `bufmodule.Module`. --------- Co-authored-by: bufdev <[email protected]>
- Loading branch information
1 parent
4f7c33b
commit 9db765f
Showing
21 changed files
with
137 additions
and
132 deletions.
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
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
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
5 changes: 5 additions & 0 deletions
5
private/buf/cmd/buf/testdata/workspace/success/breaking/a/proto/a/v1/a.proto
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
syntax = "proto3"; | ||
|
||
package a.v1; | ||
|
||
message A {} |
1 change: 1 addition & 0 deletions
1
private/buf/cmd/buf/testdata/workspace/success/breaking/a/proto/buf.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
version: v1 |
1 change: 1 addition & 0 deletions
1
private/buf/cmd/buf/testdata/workspace/success/breaking/buf.work.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
version: v1 | ||
directories: | ||
- a/proto | ||
- other/proto | ||
- proto |
5 changes: 5 additions & 0 deletions
5
private/buf/cmd/buf/testdata/workspace/success/dir/a/proto/a/v1/a.proto
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
syntax = "proto3"; | ||
|
||
package a.v1; | ||
|
||
message A {} |
1 change: 1 addition & 0 deletions
1
private/buf/cmd/buf/testdata/workspace/success/dir/a/proto/buf.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
version: v1 |
1 change: 1 addition & 0 deletions
1
private/buf/cmd/buf/testdata/workspace/success/dir/buf.work.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
version: v1 | ||
directories: | ||
- a/proto | ||
- other/proto | ||
- proto |
5 changes: 5 additions & 0 deletions
5
private/buf/cmd/buf/testdata/workspace/success/dir_buf_work/a/proto/a/v1/a.proto
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
syntax = "proto3"; | ||
|
||
package a.v1; | ||
|
||
message A {} |
1 change: 1 addition & 0 deletions
1
private/buf/cmd/buf/testdata/workspace/success/dir_buf_work/a/proto/buf.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
version: v1 |
1 change: 1 addition & 0 deletions
1
private/buf/cmd/buf/testdata/workspace/success/dir_buf_work/buf.work
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
version: v1 | ||
directories: | ||
- a/proto | ||
- other/proto | ||
- proto |
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
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
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
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
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
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
Oops, something went wrong.