Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

found a virtual manifest at <path> instead of a package manifest

I searched for [rust] "instead of a package manifest" on this site before asking and found no hits. I also read about virtual manifests here but did not resolve my question.

My goal is to make changes to azul.

To achieve this I read about patching dependencies here, and now I have this Cargo.toml

[package]
name = "my_first_azul_app"
version = "0.1.0"
authors = ["Name <Email>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
azul = { git = "https://github.com/maps4print/azul" }

[patch."https://github.com/maps4print/azul"]
azul = { path = "../azul" }

In path ../azul I have checked out the azul project with git clone. In main.rs I have followed this to get,

extern crate azul;

fn main() {
    println!("Hello world!");
}

Then I try to test

$ cargo run
error: failed to resolve patches for `https://github.com/maps4print/azul`

Caused by:
  failed to load source for a dependency on `azul`

Caused by:
  Unable to update /home/name/projects/azul

Caused by:
  found a virtual manifest at `/home/name/projects/azul/Cargo.toml` instead of a package manifest

I do not understand the final caused by line. If I remove the [patch] configuration, it "works". Quoting because it fails to compile, but that is why I am trying to check it out and attempt a fix. What charges do I need to make to develop the azul dependency?

TIA,

like image 909
Charles Avatar asked Apr 13 '20 13:04

Charles


1 Answers

looks like azul is using workspaces so if you want to refer to it via path you must point to the exact member(s) of that workspace.

azul's Cargo.toml contains


[workspace]
members = [
    "cargo/azul",
    "cargo/azul-css",
    "cargo/azul-core",
    "cargo/azul-layout",
    "cargo/azul-text-layout",
    "cargo/azul-widgets",
    "cargo/azul-css-parser",
    "cargo/azul-native-style",
]

so I believe you should be able to do something like:


[dependencies]
azul = { path = "../azul/cargo/azul"
azul-css = { path = "../azul/cargo/azul-css" }

you may need all/some of the members there.

like image 156
user2987504 Avatar answered Oct 20 '22 22:10

user2987504