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
Usage looks like so:
```
crate = use_extension("@rules_rust//crate_universe:extension.bzl", "crate")
crate.spec(package = "anyhow", version = "1.0.77")
....
crate.from_specs(name = "crates")
```
It might make sense to merge the annotation attributes into the spec so
we don't have to duplicate things, but we can probably iterate on this
in the future, this API is still experimental, yeah?
fail("Defined two crate universes with the same name in the same MODULE.bazel file. Use the name tag to give them different names.")
222
262
elifcfg.nameinall_repos:
223
263
fail("Defined two crate universes with the same name in different MODULE.bazel files. Either give one a different name, or use use_extension(isolate=True)")
# This should be kept in sync with crate_universe/private/crate.bzl.
359
+
_spec=tag_class(
360
+
attrs=dict(
361
+
package=attr.string(
362
+
doc="The explicit name of the package.",
363
+
mandatory=True,
364
+
),
365
+
version=attr.string(
366
+
doc="The exact version of the crate. Cannot be used with `git`.",
367
+
),
368
+
artifact=attr.string(
369
+
doc="Set to 'bin' to pull in a binary crate as an artifact dependency. Requires a nightly Cargo.",
370
+
),
371
+
lib=attr.bool(
372
+
doc="If using `artifact = 'bin'`, additionally setting `lib = True` declares a dependency on both the package's library and binary, as opposed to just the binary.",
373
+
),
374
+
default_features=attr.bool(
375
+
doc="Maps to the `default-features` flag.",
376
+
),
377
+
features=attr.string_list(
378
+
doc="A list of features to use for the crate.",
379
+
),
380
+
git=attr.string(
381
+
doc="The Git url to use for the crate. Cannot be used with `version`.",
382
+
),
383
+
branch=attr.string(
384
+
doc="The git branch of the remote crate. Tied with the `git` param. Only one of branch, tag or rev may be specified. Specifying `rev` is recommended for fully-reproducible builds.",
385
+
),
386
+
tag=attr.string(
387
+
doc="The git tag of the remote crate. Tied with the `git` param. Only one of branch, tag or rev may be specified. Specifying `rev` is recommended for fully-reproducible builds.",
388
+
),
389
+
rev=attr.string(
390
+
doc="The git revision of the remote crate. Tied with the `git` param. Only one of branch, tag or rev may be specified.",
0 commit comments