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