Comments (23)
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.
Huh. Can we file a bug upstream about this? Or was there some justification for why this isn't possible?
from gdk.
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.
You can use git-repo to make this problem go away. There will be a cargo override out of the box.
from gdk.
@gkoz: I don't remember why we didn't choose this solution. Well, I'll see that tomorrow.
from gdk.
@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.
Also, path dependencies seem to actually be allowed: https://github.com/sfackler/rust-openssl/blob/master/openssl/Cargo.toml#L22
from gdk.
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.
@jashephe: That's what we wanted to do at first, the command cargo publish
didn't allow it, that's all.
from gdk.
@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.
@gkoz: I will, please remind it to me, I might forget otherwise...
from gdk.
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.
Hum... That seems a lot to update for just a sub-dependency...
from gdk.
We probably don't need to publish a new version because of this, as it only affects the git checkouts.
from gdk.
Maybe we should add an explanation on this error in the README ?
from gdk.
You don't want to alter the Cargo.toml
s? Dunno, using the path seems to be idiomatic and expected so explaining the error may not help a lot.
from gdk.
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.
The openssl example above is exactly like that -- two crates in one repo, there's just a bit different directory structure.
from gdk.
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.
@gkoz: The big come back of the crates branch !
from gdk.
Does openssl not have this problem? Or do they just not care?
from gdk.
@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.
It seems, we have a satisfactory crate publishing process now.
from gdk.
Related Issues (20)
- Any way to get XID from Window/DrawingArea? HOT 13
- Missing keymaps HOT 3
- add a method get_root_position() to EventMotion HOT 2
- Bindings for gdk_event_request_motions() missing HOT 1
- Events are missing properties HOT 6
- `Event::downcast` is requires clone from event handler HOT 2
- Proposal: use an `Option` for return value of `get_[predicted_]presentation_time()` HOT 3
- setting _NET_WM_WINDOW_TYPE(ATOM) HOT 2
- get window title HOT 1
- Window function set_titlebar generate gtk-CRITICAL error messages when moving window HOT 2
- gdk::Seat::grab() panic HOT 4
- Compilation failing HOT 2
- Clean up ciaro interactions HOT 4
- Missing gdk_key_map_* functions
- GdkPixbufExt: create_surface doesn't work with a None HOT 5
- Add GDK_EVENT_* & GDK_BUTTON_* to the public api HOT 2
- Use of gdk_sys::gdk_screen_get_default() HOT 2
- gdk::WindowAttr should contain an EventMask in the event_mask field
- Nicer bindings for Key(val) related functions HOT 1
- unresolved import `gdk::Monitor` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gdk.