GithubHelp home page GithubHelp logo

gdk-sys Cairo Dependency about gdk HOT 23 CLOSED

gtk-rs avatar gtk-rs commented on July 20, 2024
gdk-sys Cairo Dependency

from gdk.

Comments (23)

GuillaumeGomez avatar GuillaumeGomez commented on July 20, 2024

The problem is that crates.io and cargo don't allow a crates to have a dependency inside the project. We didn't have the choice on this one.

from gdk.

jashephe avatar jashephe commented on July 20, 2024

Huh. Can we file a bug upstream about this? Or was there some justification for why this isn't possible?

from gdk.

GuillaumeGomez avatar GuillaumeGomez commented on July 20, 2024

I asked about that to @acrichto on the irc, he replied that if a library needs a dependency, that dependency has to declared on crates.io, or something similar. It's late and I'm tired. ^^' I advise you to ask him the question directly, it'll be better and you'll have more details.

from gdk.

gkoz avatar gkoz commented on July 20, 2024

You can use git-repo to make this problem go away. There will be a cargo override out of the box.

from gdk.

GuillaumeGomez avatar GuillaumeGomez commented on July 20, 2024

@gkoz: I don't remember why we didn't choose this solution. Well, I'll see that tomorrow.

from gdk.

gkoz avatar gkoz commented on July 20, 2024

@GuillaumeGomez I'm not sure what you mean by choosing or not. This is mostly how you manage your own working copy. This tool has helped me manage various branches across multiple repos and not go crazy.

from gdk.

gkoz avatar gkoz commented on July 20, 2024

Also, path dependencies seem to actually be allowed: https://github.com/sfackler/rust-openssl/blob/master/openssl/Cargo.toml#L22

from gdk.

jashephe avatar jashephe commented on July 20, 2024

I thought I had seen something like that somewhere. I don't see why that wouldn't work in our case. Is there any reason why we wouldn't want to do that?

from gdk.

GuillaumeGomez avatar GuillaumeGomez commented on July 20, 2024

@jashephe: That's what we wanted to do at first, the command cargo publish didn't allow it, that's all.

from gdk.

gkoz avatar gkoz commented on July 20, 2024

@GuillaumeGomez you may want to ask sfackler how he managed it. At the very least you could just strip out the path line with sed in the process of publishing while keeping it in the git.

from gdk.

GuillaumeGomez avatar GuillaumeGomez commented on July 20, 2024

@gkoz: I will, please remind it to me, I might forget otherwise...

from gdk.

gkoz avatar gkoz commented on July 20, 2024

This post makes me think that it should just work if you do it exactly like

[dependencies.blahblah]
path = "../blahblah"
version = "x.y.z"

The blahblah package does have to already be registered on crates.

from gdk.

GuillaumeGomez avatar GuillaumeGomez commented on July 20, 2024

Hum... That seems a lot to update for just a sub-dependency...

from gdk.

gkoz avatar gkoz commented on July 20, 2024

We probably don't need to publish a new version because of this, as it only affects the git checkouts.

from gdk.

GuillaumeGomez avatar GuillaumeGomez commented on July 20, 2024

Maybe we should add an explanation on this error in the README ?

from gdk.

gkoz avatar gkoz commented on July 20, 2024

You don't want to alter the Cargo.tomls? Dunno, using the path seems to be idiomatic and expected so explaining the error may not help a lot.

from gdk.

GuillaumeGomez avatar GuillaumeGomez commented on July 20, 2024

I like the fact that *-sys are in an independant crate. So I don't really know what solution might fit better here...

from gdk.

gkoz avatar gkoz commented on July 20, 2024

The openssl example above is exactly like that -- two crates in one repo, there's just a bit different directory structure.

from gdk.

gkoz avatar gkoz commented on July 20, 2024

We probably can't do anything about this because only the current crate would see the path dependency while the others might still link to the same crate from crates leading to confusing errors like expected 'glib::types::Type' found 'glib::types::Type'.
We may have to make it clearer that the only supported way of using crates from git is to override all of the repos.

This may call for creating a crates branch used for publishing with the "crates.io" Cargo.toml version while the master branch would use the git dependencies. At the time of publishing new commits from the master would be merged into that branch.

from gdk.

GuillaumeGomez avatar GuillaumeGomez commented on July 20, 2024

@gkoz: The big come back of the crates branch !

from gdk.

jashephe avatar jashephe commented on July 20, 2024

Does openssl not have this problem? Or do they just not care?

from gdk.

gkoz avatar gkoz commented on July 20, 2024

@GuillaumeGomez this is a little different from tracking nightlies and stable separately, because we don't expect any conflicts when merging from master. The workflow would be: merge from master, bump the version, cargo publish.

@jashephe openssl doesn't have five repos each with a sys crate.

from gdk.

gkoz avatar gkoz commented on July 20, 2024

It seems, we have a satisfactory crate publishing process now.

from gdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.