-
Notifications
You must be signed in to change notification settings - Fork 440
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
crate_universe: Support git #1027
Comments
try a commit hash instead of tag |
I think the problem here is that you're trying to rename the dependency, which isn't supported by
but this doesn't:
Yes, but you'll need to configure git in such a way that auth works - I think setting |
To clarify, I'm currently using The line importing Admittedly, this is a very weird crate. There is an entry for it would be really great to see native support for fetching repos using the native git CLI. It's such a common workflow which is seemingly overlooked. Especially as it's inconsistent with the behaviour of other repository rules like Side note: Is it possible to get some better errors? Great work with the |
Aha, right you are! So, the crux of the Which we handle here: rules_rust/crate_universe/src/templates/BUILD.crate.bazel.template Lines 26 to 40 in 53b1de6
As far as I can tell, cargo-raze does exactly the same target skipping: and indeed using this Cargo.toml: [package]
name = "rustplay"
version = "0.1.0"
edition = "2018"
[dependencies]
rure = {git = "https://github.com/rust-lang/regex", rev = "1.5.4"}
[package.metadata.raze]
workspace_path = "//cargo"
package_aliases_dir = "."
targets = [
"x86_64-apple-darwin",
"x86_64-pc-windows-msvc",
"x86_64-unknown-linux-gnu",
]
genmode = "Remote" Running """
@generated
cargo-raze crate build file.
DO NOT EDIT! Replaced on runs of cargo-raze
"""
# buildifier: disable=load
load("@bazel_skylib//lib:selects.bzl", "selects")
# buildifier: disable=load
load(
"@rules_rust//rust:defs.bzl",
"rust_binary",
"rust_library",
"rust_proc_macro",
"rust_test",
)
package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//cargo", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])
licenses([
"notice", # MIT from expression "MIT OR Apache-2.0"
])
# Generated Targets
# Unsupported target "rure" with type "cdylib" omitted
# Unsupported target "rure" with type "staticlib" omitted |
Now, back to the git auth issue! @gibfahn put together a fantastic guide to making this Just Work after they spent quite a while delving into it: https://fahn.co/posts/cargo-auth-for-private-git-repos.html - possibly some of the content there may be useful to you? I definitely agree that it's sad that this stuff doesn't Just Work out of the box though, and if you have any insights as to how we could make it work more smoothly, I'd be very interested in working with you on them! |
#904 is an open issue about that |
The new implementation of |
Maybe I'm missing something, but when using
git
repositories inCargo.toml
,create_universe
throws an error.Additionally, is it possible to fetch private git repositories?
cargo-raze
uses Bazel's git rules which circumvents rust-lang/cargo#1851.The text was updated successfully, but these errors were encountered: