You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -134,6 +134,17 @@ use_repo(crate, "crates")
134
134
135
135
`crate.spec` and vendoring mode are currently unsupported.
136
136
137
+
### Self dev-dependencies
138
+
139
+
Cargo workspaces sometimes use a self-referencing dev-dependency to enable extra features for tests:
140
+
141
+
```toml
142
+
[dev-dependencies]
143
+
mycrate = { path = ".", features = ["test-utils"] }
144
+
```
145
+
146
+
`rules_rs` suppresses the generated self-edge in `aliases()` and `all_crate_deps()` so this pattern does not create a Bazel dependency cycle. The requested features are still part of the workspace feature resolution, so they may be enabled on the first-party crate more broadly than Cargo would enable them for a single targeted test command. If you need separate normal and test feature variants, model them as separate Bazel targets, with the test-only variant setting the extra `crate_features` and `testonly = True`.
147
+
137
148
### Exec vs target triple caveats
138
149
139
150
- Windows: the default Windows **exec** toolchain is MSVC-flavored. The upstream `gnullvm` toolchain dynamically links `libunwind`, which may not exist on a stock Windows machine.
0 commit comments