Skip to content

rustpkg doesn't install to the correct location #11099

Closed
@eminence

Description

@eminence

The rustpkg manual has the following statement:

rustpkg install foo builds the libraries and/or executables that are targets for foo. If RUST_PATH is declared as an environment variable, then rustpkg installs the libraries and executables into the lib and bin subdirectories of the first entry in RUST_PATH.

I am finding that this is not the case. See the following reproduction:

$ mkdir -p ~/devel/MyLib/src/MyLib
$ vim ~/devel/MyLib/src/MyLib/{test,lib}.rs
$ cat ~/devel/MyLib/src/MyLib/lib.rs
#[crate_type="lib"];
#[crate_id="MyLib#0.2"];

pub mod MyMod {
    pub fn hello() -> ~str { ~"world" }
}
$ cat ~/devel/MyLib/src/MyLib/test.rs 
extern mod MyLib;
use MyLib::MyMod;

#[test]
fn test1() {
    MyMod::hello();
}
$ mkdir -p ~/devel/MyProject
$ cd ~/devel/MyProject
$ env RUST_PATH=~/devel/MyProject:~/devel/MyLib ~/devel/rust-git/prefix/bin/rustpkg install MyLib
WARNING: The Rust package manager is experimental and may be unstable
note: Installed package MyLib-0.0 to /Users/achin/devel/MyLib
note: Installed package MyLib-0.0 to /Users/achin/devel/MyProject
$ find ~/devel/MyLib/
/Users/achin/devel/MyLib/
/Users/achin/devel/MyLib//bin
/Users/achin/devel/MyLib//build
/Users/achin/devel/MyLib//build/x86_64-apple-darwin
/Users/achin/devel/MyLib//build/x86_64-apple-darwin/MyLib
/Users/achin/devel/MyLib//build/x86_64-apple-darwin/MyLib/libMyLib-e6b6b1b1-0.2.dylib
/Users/achin/devel/MyLib//build/x86_64-apple-darwin/MyLib/MyLibtest
/Users/achin/devel/MyLib//lib
/Users/achin/devel/MyLib//lib/x86_64-apple-darwin
/Users/achin/devel/MyLib//lib/x86_64-apple-darwin/libMyLib-e6b6b1b1-0.2.dylib
/Users/achin/devel/MyLib//src
/Users/achin/devel/MyLib//src/MyLib
/Users/achin/devel/MyLib//src/MyLib/lib.rs
/Users/achin/devel/MyLib//src/MyLib/test.rs
$ find ~/devel/MyProject/
/Users/achin/devel/MyProject/
/Users/achin/devel/MyProject//bin
/Users/achin/devel/MyProject//lib
/Users/achin/devel/MyProject//lib/x86_64-apple-darwin
/Users/achin/devel/MyProject//rustpkg_db.json
$ ~/devel/rust-git/prefix/bin/rustpkg --version
WARNING: The Rust package manager is experimental and may be unstable
/Users/achin/devel/rust-git/prefix/bin/rustpkg 0.9-pre (5c24bfa 2013-12-19 17:11:40 -0800)
host: x86_64-apple-darwin

Note the test.rs file seems to be affecting the rustpkg behavior:

$ rm ~/devel/MyLib/src/MyLib/test.rs 
$ rm rustpkg_db.json
$ env RUST_PATH=~/devel/MyProject:~/devel/MyLib ~/devel/rust-git/prefix/bin/rustpkg install MyLib
WARNING: The Rust package manager is experimental and may be unstable
note: Installed package MyLib-0.0 to /Users/achin/devel/MyProject

$ find ~/devel/MyProject/
/Users/achin/devel/MyProject/
/Users/achin/devel/MyProject//bin
/Users/achin/devel/MyProject//lib
/Users/achin/devel/MyProject//lib/x86_64-apple-darwin
/Users/achin/devel/MyProject//lib/x86_64-apple-darwin/libMyLib-e6b6b1b1-0.2.dylib
/Users/achin/devel/MyProject//rustpkg_db.json

cc: @catamorphism

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions