google / cargo-raze

Generate Bazel BUILD from Cargo dependencies!
Apache License 2.0
480 stars 104 forks source link

new_local_repository is not generated in crates.bzl #568

Open rahulchaphalkar opened 1 year ago

rahulchaphalkar commented 1 year ago

My cargo.toml has a few dependencies which are satisfied by a local path instead of git url or crate.io, similar to below

abc = { path = "path/to/abc"}

when I run cargo raze, the generated crates.bzl looks similar to

maybe(
        http_archive,
        name = "abc__9_0_3",
        url = "",
        type = "tar.gz",
        build_file = Label("//bazel/cargo/abc/remote:BUILD.abc-9.0.3.bazel"),
    )

where it still has http_archive. I had assumed something like new_local_repository would be used with the supplied path. The empty URL field creates issues down the road, like

"/home/oem/.cache/bazel/_bazel_oem/968da50c6a622da40e48702838fa463b/external/bazel_tools/tools/build_defs/repo/http.bzl", line 66, column 13, in _get_all_urls
                fail("At least one of url and urls must be provided")
Error in fail: At least one of url and urls must be provided