FYI, there's a related bug open:

https://github.com/mozilla/rust/issues/8673 (this is about the problem
of repeating the same package ID#revision string in different files
and not having a way to abstract it out)

The preferred way to work on a dependency and the package that depends
on it at the same time is to make a local copy and put it in your
RUST_PATH; this copy will be found before rustpkg looks for the
upstream copy and/or for an automatically-cached copy of that. The
local copy has to have the same package ID, of course, so for a
package like github.com/foo/bar, you would have to have a
github.com/foo/bar directory in your RUST_PATH.

Hope that helps!
Cheers,
Tim


On Tue, Dec 3, 2013 at 11:44 AM, SiegeLord <[email protected]> wrote:
> So I've been thinking for awhile about how one would actually use rustpkg.
> Let me first outline my use case. I have a library and a program that uses
> that library, both of which I host on GitHub. One of the features of the
> rustpkg system is that I should be able to write this to refer to the
> library in my program:
>
> extern mod lib = "package_id";
>
> Unfortunately, there is no obvious thing to put into the 'package_id' slot.
> There are two options:
>
> First, I could use "github.com/SiegeLord/library" as my package_id. This is
> problematic, as it would require one of these sub-optimal courses of action:
>
> - Stick the source of the library into workspace/src/library where I would
> actually develop and then use a duplicate package in the
> workspace/src/github.com/SiegeLord/library that would be created by rustpkg
> (the program is located in workspace/src/program). Somehow this duplicate
> package will be synced to the actual package: either through pushing to
> GitHub and then pulling somehow via rustpkg (this is less than ideal, as I
> may want to test WIP changes without committing them elsewhere/I may have no
> internet connection e.g. when traveling), or some manual, local git
> operation.
>
> - Stick the source of the library into
> workspace/src/github.com/SiegeLord/library and develop the library there.
> There is no duplication, but it really seems bizarre to me to locate a
> project in a directory named like that. Also, I'd be a bit paranoid about
> rustpkg not realizing that I never want to communicate with GitHub and
> having it accidentally overwriting my local changes.
>
> The second option is to use "library" as the package id. This allows me to
> locate my library in a logical location (workspace/src/library), but it
> prevents other users of my program from building it automatically.
> Essentially what they'll have to do is to manually check out the library
> repository inside their workspaces so as to create the workspace/src/library
> directory on their system: the `extern mod` syntax will not work otherwise.
>
> I don't think any of these options are ideal. I don't want to suggest
> solutions to these issues because I'm not sure how things are supposed to be
> used/what the planned design is. Does anybody use rustpkg seriously today?
> Is everybody making workspaces with a github.com/<user> directory where they
> develop their software?
>
> -SL
> _______________________________________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev



-- 
Tim Chevalier * http://catamorphism.org/ * Often in error, never in doubt
"If you are silent about your pain, they'll kill you and say you enjoyed it."
-- Zora Neale Hurston
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to