Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Can't compile snatch's pbr dependency with rustc 1.11 #46

Closed
knocte opened this issue Jan 23, 2017 · 5 comments
Closed

Can't compile snatch's pbr dependency with rustc 1.11 #46

knocte opened this issue Jan 23, 2017 · 5 comments

Comments

@knocte
Copy link

knocte commented Jan 23, 2017

This is the output when I try to compile:

    Updating git repository `https://github.com/derniercri/snatch.git`
   Compiling ansi_term v0.9.0
   Compiling lazy_static v0.2.2
   Compiling bitflags v0.7.0
   Compiling winapi-build v0.1.1
   Compiling libc v0.2.18
   Compiling num_cpus v1.2.0
   Compiling httparse v1.2.1
   Compiling winapi v0.2.8
   Compiling gcc v0.3.40
   Compiling openssl v0.7.14
   Compiling pkg-config v0.3.8
   Compiling openssl-sys v0.7.17
   Compiling argparse v0.2.1
   Compiling rustc-serialize v0.3.22
   Compiling semver v0.1.20
   Compiling typeable v0.1.2
   Compiling openssl-sys-extras v0.7.14
   Compiling rustc_version v0.1.7
   Compiling unicase v1.4.0
   Compiling unicode-normalization v0.1.2
   Compiling language-tags v0.2.2
   Compiling traitobject v0.0.1
   Compiling kernel32-sys v0.2.2
   Compiling time v0.1.35
   Compiling pbr v1.0.0-alpha.2
.cargo/registry/src/github.com-1ecc6299db9ec823/pbr-1.0.0-alpha.2/src/pb.rs:436:13: 436:16 error: binary assignment operation `+=` cannot be applied to type `std::string::String` [E0368]
.cargo/registry/src/github.com-1ecc6299db9ec823/pbr-1.0.0-alpha.2/src/pb.rs:436             out += repeat!(" ", width - s.len());
                                                                                            ^~~
.cargo/registry/src/github.com-1ecc6299db9ec823/pbr-1.0.0-alpha.2/src/pb.rs:436:13: 436:16 help: run `rustc --explain E0368` to see a detailed explanation
.cargo/registry/src/github.com-1ecc6299db9ec823/pbr-1.0.0-alpha.2/src/multi.rs:206:17: 206:20 error: binary assignment operation `+=` cannot be applied to type `std::string::String` [E0368]
.cargo/registry/src/github.com-1ecc6299db9ec823/pbr-1.0.0-alpha.2/src/multi.rs:206                 out += &move_cursor_up(self.nlines);
                                                                                                   ^~~
.cargo/registry/src/github.com-1ecc6299db9ec823/pbr-1.0.0-alpha.2/src/multi.rs:206:17: 206:20 help: run `rustc --explain E0368` to see a detailed explanation
error: aborting due to 2 previous errors
error: failed to compile `snatch v0.1.1 (https://github.com/derniercri/snatch.git#9e30b500)`, intermediate artifacts can be found at `/tmp/cargo-install.LV86csGNNryo`

Caused by:
  Could not compile `pbr`.

To learn more, run the command again with --verbose.

Is there a way to pin pbr to a stable version or something like that?

@knocte
Copy link
Author

knocte commented Jan 23, 2017

If I switch pbr to 1.0.0-alpha.1, same thing happens.
If I switch pbr to 0.3.1, build of pbr works, but snatch doesn't:

   Compiling snatch v0.1.1 (file:///home/andres/snatch)
src/download.rs:7:11: 7:19 error: unresolved import `pbr::MultiBar`. There is no `MultiBar` in `pbr` [E0432]
src/download.rs:7 use pbr::{MultiBar, Pipe, ProgressBar, Units};
                            ^~~~~~~~
src/download.rs:7:11: 7:19 help: run `rustc --explain E0432` to see a detailed explanation
src/download.rs:7:21: 7:25 error: unresolved import `pbr::Pipe`. There is no `Pipe` in `pbr` [E0432]
src/download.rs:7 use pbr::{MultiBar, Pipe, ProgressBar, Units};
                                      ^~~~
src/download.rs:7:21: 7:25 help: run `rustc --explain E0432` to see a detailed explanation
error: aborting due to 2 previous errors
error: failed to compile `snatch v0.1.1 (file:///home/andres/snatch)`, intermediate artifacts can be found at `/home/andres/snatch/target`

Caused by:
  Could not compile `snatch`.

To learn more, run the command again with --verbose.

So I guess snatch depends on some bits from pbr that are in higher versions than 0.3.1.

I'm wondering what version of rustc do you guys have? I have 1.11.0.

@k0pernicus
Copy link
Contributor

Hi @knocte,
I think that this error is related to the version of rustc you are using.
The += operator has been added as a stable feature in the 1.13 or 1.14 version - so I suggest you to update your stable version of rustc with rustup update ;-)

@knocte
Copy link
Author

knocte commented Jan 23, 2017

@k0pernicus thanks for your message!

I tried to upgrade my rustc earlier, but it didn't upgrade me to higher versions, is it because 1.11 is considered stable or something like that?

Shouldn't your repo have a sanity check, like a configure phase, which warns about this?

@k0pernicus
Copy link
Contributor

k0pernicus commented Jan 23, 2017

Mmmmh, that's weird...
The current stable version of rustc is 1.14:

λ ~/Code/snatch/ devel rustc --version
rustc 1.14.0 (e8a012324 2016-12-16)

Can you paste the output for your rustup update please ?
Actually, we could test the application using Travis or something like that yes - I will create the issue for that.

@knocte
Copy link
Author

knocte commented Jan 23, 2017

When I said I had tried to update rust before, I did it through the recommended method in https://www.reddit.com/r/rust/comments/3gppup/how_do_i_update_rust_to_the_latest_version_on/, which is the first google result I saw. Apparently, that doesn't work, but doing it through rustup update worked.

Given that updating rust is not so straightforward, would be great to have that configure phase I was talking about ;)

@knocte knocte changed the title Can't compile snatch, seems due to broken build of pbr dependency Can't compile snatch's pbr dependency with rustc 1.11 Jan 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants