Skip to content

rustpkg doesn't install to the correct location #11099

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
eminence opened this issue Dec 21, 2013 · 1 comment
Closed

rustpkg doesn't install to the correct location #11099

eminence opened this issue Dec 21, 2013 · 1 comment

Comments

@eminence
Copy link
Contributor

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

@flaper87
Copy link
Contributor

Closing rustpkg is deprecated

flip1995 pushed a commit to flip1995/rust that referenced this issue Jul 31, 2023
[`unnecessary_literal_unwrap`]: Fix ICE on None.unwrap_or_default()

Fixes rust-lang#11099
Fixes rust-lang#11064

I'm running into rust-lang#11099 (cc `@y21)` on my Rust codebase. Clippy ICEs on this code when evaluating the `unnecessary_literal_unwrap` lint:
```rust
fn main() {
    let val1: u8 = None.unwrap_or_default();
}
```

This fixes that ICE and adds an message specifically for that case:

```
error: used `unwrap_or_default()` on `None` value
  --> $DIR/unnecessary_literal_unwrap.rs:26:5
   |
LL |     None::<String>.unwrap_or_default();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the `None` and `unwrap_or_default()`: `String::default()`
```

This PR also fixes the same ICE with `None.unwrap_or_else` (by giving the generic error message for the lint in that case).

changelog: Fix ICE in `unnecessary_literal_unwrap` on `None.unwrap_or_default()`
flip1995 pushed a commit to flip1995/rust that referenced this issue Aug 17, 2023
[`unnecessary_literal_unwrap`]: Fix ICE on None.unwrap_or_default()

Fixes rust-lang#11099
Fixes rust-lang#11064

I'm running into rust-lang#11099 (cc `@y21)` on my Rust codebase. Clippy ICEs on this code when evaluating the `unnecessary_literal_unwrap` lint:
```rust
fn main() {
    let val1: u8 = None.unwrap_or_default();
}
```

This fixes that ICE and adds an message specifically for that case:

```
error: used `unwrap_or_default()` on `None` value
  --> $DIR/unnecessary_literal_unwrap.rs:26:5
   |
LL |     None::<String>.unwrap_or_default();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the `None` and `unwrap_or_default()`: `String::default()`
```

This PR also fixes the same ICE with `None.unwrap_or_else` (by giving the generic error message for the lint in that case).

changelog: Fix ICE in `unnecessary_literal_unwrap` on `None.unwrap_or_default()`
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants