I've been trying to understand how rustpkg is meant to be used, and I
found that it didn't quite mesh with my experience with other package
management systems. Since it's quite incomplete and under-documented,
instead of trying to comment on the status quo, I decided its best to
form a few scenarios of usage, and hopefully have the people who
understand where rustpkg is going help me to see if these scenarios are
going to be possible (or if not, what's wrong with them). To that end,
the syntax for rustpkg will be my own and not the current syntax.
Prelude 1:
1 Package != 1 crate. I think a package should be able to contain
several crates. E.g. Debian packages routinely contain multiple
binaries/libraries etc.
Prelude 2:
Package source != package name. Regardless of where you get the package
from and no matter what the package file name was, the package metadata
(name/author/version) should not be affected, and should be the only
things that determine the identity of the package. I don't think these
things are inferrable, so I envision a metadata file with all those
things specified.
Each package in these scenarios is named 'bar' and has a 'baz' crate.
Scenario 1: Installation from a package file
Given a package file foo.zip, I want to be able to do this:
sudo rustpkg install foo.zip
This would install it to /usr/local. `--prefix` switch would specify
where to install it (perhaps something more clever can be done here for
the sake of Windows).
You should be able to install multiple packages with the same name but
different authors/versions, e.g this should install two separate
packages if their metadata are different.
rustpkg install ~/dir1/foo.zip
rustpkg install ~/dir2/foo.zip
Scenario 2: Installation from an appropriately structured directory
Same thing should work with a local directory.
rustpkg install ~/foo
...and a remote one (like a github repository):
rustpkg install https://github.com/user/foo.git --branch master
If nothing is specified, it uses the current directory.
Scenario 3: Uninstallation
This should work if there's only one bar.
rustpkg uninstall --package bar
If there are multiple bar's, (different metadata) then you should be
able to disambiguate between them:
rustpkg uninstall --author Author --package bar
Or you can specify a package file here as well, instead of a package name.
Scenario 4: Fetching/building without installation
Building without installing:
rustpkg build <URI>
If you then run `rustpkg install <URI>` or `rustpkg install --package
bar`, then it'll use that pre-built copy without fetching the sources
and building them again. Speaking of fetching, this would just fetch the
sources:
rustpkg fetch <URI>
Scenario 5: Specifying a workspace
All of the above commands used some system workspace to store the
intermediate files. You should also be able to specify a custom
workspace, e.g. for the sake of development:
rustpkg build <URI> --workspace .
That command would fetch into the local directory as well as building in it.
-SL
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev