Skip to content

Document visibility requirements #906

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

Merged
merged 4 commits into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/rust_analyzer.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ A list of `rust_analyzer` compatible targets can be found by usign the following
bazel query 'kind("rust_*library|rust_binary", //...:all)'
```

Note that visibility rules apply.
Note: __All `rust_*` targets provided to the root rust_analyzer must have `//visibility:public`.__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually not true - all rust targets provided to the rust_analyzer target have to be visible to the rust_analyzer target. That's a slightly weaker restriction.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I exposed the targets to the analyzer rule, either individually or via a package_group rule, Bazel failed analysis because of a circular dependency. If you know of another way to have two targets reference each other explicitly, please update the docs.


Run `bazel run @rules_rust//tools/rust_analyzer:gen_rust_project` whenever
dependencies change to regenerate the `rust-project.json` file. It should be
Expand Down
2 changes: 1 addition & 1 deletion docs/rust_analyzer.vm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ A list of `rust_analyzer` compatible targets can be found by usign the following
bazel query 'kind("rust_*library|rust_binary", //...:all)'
```

Note that visibility rules apply.
Note: __All `rust_*` targets provided to the root rust_analyzer must have `//visibility:public`.__

Run `bazel run @rules_rust//tools/rust_analyzer:gen_rust_project` whenever
dependencies change to regenerate the `rust-project.json` file. It should be
Expand Down