oppiliappan/dijo

0.2.1 not compiling on MacOS

peterjbachman opened this issue · 1 comments

I'm having issues installing dijo 0.2.1 on MacOS 10.15.5. It looks like when I run

cargo install dijo

I get the following output:

error[E0425]: cannot find value `s` in this scope
  --> /Users/XXXX/.cargo/registry/src/github.com-1ecc6299db9ec823/dijo-0.2.1/src/main.rs:82:9
   |
82 |         s.add_layer(layout);
   |         ^ not found in this scope

error[E0425]: cannot find value `s` in this scope
  --> /Users/XXXX/.cargo/registry/src/github.com-1ecc6299db9ec823/dijo-0.2.1/src/main.rs:83:9
   |
83 |         s.add_global_callback(':', |s| open_command_window(s));
   |         ^ not found in this scope

error[E0425]: cannot find value `s` in this scope
  --> /Users/XXXX/.cargo/registry/src/github.com-1ecc6299db9ec823/dijo-0.2.1/src/main.rs:85:9
   |
85 |         s.set_theme(theme::theme_gen());
   |         ^ not found in this scope

error[E0425]: cannot find value `s` in this scope
  --> /Users/XXXX/.cargo/registry/src/github.com-1ecc6299db9ec823/dijo-0.2.1/src/main.rs:86:9
   |
86 |         s.run();
   |         ^ not found in this scope

error: aborting due to 4 previous errors

But looking at main.rs it looks like MacOS wasn't specified, since where it says

#[cfg(any(target_os = "linux", target_os = "macos"))]
use cursive::termion;

#[cfg(target_os = "windows")]
use cursive::crossterm;

on lines 16-20 and

        #[cfg(target_os = "windows")]
        let mut s = crossterm().unwrap();

        #[cfg(any(target_os = "linux", target_os = "macos"))]
        let mut s = termion().unwrap();

on lines 71 - 75 in the current code, the file I downloaded has the following

#[cfg(target_os = "linux")]
use cursive::termion;

#[cfg(target_os = "windows")]
use cursive::crossterm;

and

        #[cfg(target_os = "windows")]
        let mut s = crossterm().unwrap();

        #[cfg(target_os = "linux")]
        let mut s = termion().unwrap();

I was able to fix this by copying the current main.rs and then trying to install dijo again.

I'm not sure how you would fix this, but I wanted to make you aware of it. Thanks for making a great habit tracker!

Yep, I messed up that release, I should probably yank that from crates.io. However, this has been fixed as of v0.2.2-alpha, and you can get the binary (for macOS) from GitHub releases.

Cheers!