nabijaczleweli / cargo-update

A cargo subcommand for checking and applying updates to installed executables
MIT License
1.22k stars 42 forks source link

v1.0 fails to compile on OSX #35

Closed rnleach closed 7 years ago

rnleach commented 7 years ago

It has a problem linking with iconv, which is somewhere in the dependencies of a git package. I'm on OSX 10.9, but it seems like this is a recurring problem on OSX. A quick google search for iconv and mac showed that.

This wasn't a problem 0.8.1, which is the version I still have installed.

Funny thing is, if I run $> cargo install-update -al it doesn't list a version 1.0, but if I run $> cargo install -f cargo-update it does find the 1.0 version and I get the compile error.

It all compiled fine on my ubuntu machine, if I used the second command.

nabijaczleweli commented 7 years ago

I'd be laughing if I wasn't so fucking drained from fighting with linker errors coming from git2. I spent a better part of 7 hours altogether getting that shit working on my machine, and that included editing a good couple of files inside the libgit2-sys dependency's source.

As for cargo-update v1.0.0 not showing up – check in $HOME/.cargo/crates.toml whether you have a line akin to:

"cargo-update 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-install-update-config.exe", "cargo-install-update.exe"]

i.e. whether the crate source is the registry. Rather than installed locally ("git+"..., "path+"...), etc.

rnleach commented 7 years ago

i.e. whether the crate source is the registry. Rather than Looks like your message got cutoff.

I looked insided the .cargo.toml and it had:

"cargo-update 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-install-update", "cargo-install-update-config"]

It looks the same as all the other entries. Should it be any different?

nabijaczleweli commented 7 years ago

Fixed the previous comment; that line's good, I honestly don't know why that'd be, except... When you run cargo install-update..., do you get a line saying "Updating registry...", like this?

D:\Users\nabijaczleweli>cargo install-update -la
    Updating registry `https://github.com/rust-lang/crates.io-index`

Package         Installed  Latest  Needs update
checksums       v0.5.4     v0.5.5  Yes
treesize        v0.3.0     v0.4.0  Yes
racer           v2.0.6     v2.0.7  Yes
cargo-update    v0.8.1     v1.0.0  Yes
cargo-graph     v0.3.0     v0.3.0  No
cargo-navigate  v0.1.1     v0.1.1  No
gen-epub-book   v1.0.0     v1.0.0  No
identicon       v0.1.1     v0.1.1  No
cargo-count     v0.2.2     v0.2.2  No
cargo-outdated  v0.3.0     v0.3.0  No
rnleach commented 7 years ago

Yes, I do see that line.

Is it possible there is some cacheing somewhere I'm not aware of?

On Sat, May 20, 2017 at 10:04 AM, Jędrzej notifications@github.com wrote:

Fixed the previous comment; that line's good, I honestly don't know why that'd be, except... When you run cargo install-update..., do you get a line saying "Updating registry...", like this?

D:\Users\nabijaczleweli>cargo install-update -la Updating registry https://github.com/rust-lang/crates.io-index https://github.com/rust-lang/crates.io-index

Package Installed Latest Needs update checksums v0.5.4 v0.5.5 Yes treesize v0.3.0 v0.4.0 Yes racer v2.0.6 v2.0.7 Yes cargo-update v0.8.1 v1.0.0 Yes cargo-graph v0.3.0 v0.3.0 No cargo-navigate v0.1.1 v0.1.1 No gen-epub-book v1.0.0 v1.0.0 No identicon v0.1.1 v0.1.1 No cargo-count v0.2.2 v0.2.2 No cargo-outdated v0.3.0 v0.3.0 No

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nabijaczleweli/cargo-update/issues/35#issuecomment-302882198, or mute the thread https://github.com/notifications/unsubscribe-auth/AJSF1joN9g2-cVu1Q-B7ZwpOdh_3NrxTks5r7w8jgaJpZM4NhKW6 .

rnleach commented 7 years ago

Also, I had the same issue on ubuntu. Totally different machine. But if did cargo install -f cargo-update it found the correct version.

nabijaczleweli commented 7 years ago

It's possible there's caching neither of us are aware of. I guess the next step would be seeing how many registry indices (in $HOME/.cargo/registry/index) you have and whether the filesystem-reported newest one isn't actually the newest, in which case deletion is the only solution I've come up with.

rnleach commented 7 years ago

Ok,

I blew out the registry, and tried to install cargo-update again using $> cargo install cargo-update --force and I got the original linker error again. Then I tried to run $> RUST_BACKTRACE=1 cargo install-update -al and got the following:

Updating registry 'https://github.com/rust-lang/crates.io-index'

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value',
src/libcore/option.rs:329
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
   1: std::panicking::default_hook::{{closure}}
   2: std::panicking::default_hook
   3: std::panicking::rust_panic_with_hook
   4: std::panicking::begin_panic
   5: std::panicking::begin_panic_fmt
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::panicking::panic
   9: cargo_update::ops::MainRepoPackage::pull_version
  10: cargo_install_update::actual_main
  11: cargo_install_update::main
  12: __rust_maybe_catch_panic
  13: std::rt::lang_start
nabijaczleweli commented 7 years ago

Usually restarts of the same process help in that case, because partially-complete things setting up externally and all, does the problem persist when running the command multiple times?

rnleach commented 7 years ago

Yes, it persists. Any luck with the linker error? I haven't been able to track it down and fix it yet. It seems to be a pretty mac specific problem, at least from what I've found on the web.

On Sun, May 21, 2017 at 2:48 AM, Jędrzej notifications@github.com wrote:

Usually restarts of the same process help in that case, because partially-complete things setting up externally and all, does the problem persist?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nabijaczleweli/cargo-update/issues/35#issuecomment-302923758, or mute the thread https://github.com/notifications/unsubscribe-auth/AJSF1iTzTbYmYOalyn38C3vOmsOsVR0Aks5r7_pxgaJpZM4NhKW6 .

nabijaczleweli commented 7 years ago

If it's a mac-specific problem, then I have no advice for you, really. Sorry.

rnleach commented 7 years ago

Ok, well I updated on ubuntu to 1.0, and I can't update on my mac because of the linker error. I'll just uninstall on my mac, I don't have time work out this iconv stuff. So guess that means I don't really have a problem updating packages anymore. I'll close the ticket.

nabijaczleweli commented 7 years ago

I mean, the only real option I see here is to take it up with the git2 repo, really.

rnleach commented 7 years ago

FYI: the problem may have been related to having an old macports installation AND a homebrew installation on my mac. I recently had some conflicts, so I removed the macports installation and get everything from homebrew now (I hadn't use macports in years anyway). After that it seems to build fine. Unless you made some other change in the last few months?

Thanks for the nice tool!

nabijaczleweli commented 7 years ago

I don't think any changes made fixed anything, so there's high chance this macports thing was breaking something. Cheers.