jmacdonald / amp

A complete text editor for your terminal.
https://amp.rs
Other
3.68k stars 105 forks source link

Error compiling on Pop!_OS (Ubuntu 18.04) in libssh2-sys #108

Closed jbrains closed 5 years ago

jbrains commented 6 years ago

I don't know what I'm doing; please be gentle.

I followed the instructions at https://linoxide.com/tools/amp-text-editor-linux-terminal/ for Ubuntu 16.04, even though I'm running Pop!_OS, which is "essentially" Ubuntu 18.04.

$ uname -a
Linux casper 4.15.0-23-generic #25-Ubuntu SMP Wed May 23 18:02:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

No issues with the prerequisite steps. libssl-dev and cargo appear to have installed without incident. Following is the output from my second attempt.

~ cargo install --git https://github.com/jmacdonald/amp/
    Updating git repository `https://github.com/jmacdonald/amp/`
  Installing amp v0.5.0 (https://github.com/jmacdonald/amp/#242e1a77)           
    Updating git repository `https://github.com/jmacdonald/termbox-sys`
    Updating registry `https://github.com/rust-lang/crates.io-index`            
   Compiling byteorder v1.2.6
   Compiling unicode-normalization v0.1.7
   Compiling percent-encoding v1.0.1
   Compiling glob v0.2.11
   Compiling unicode-xid v0.0.4
   Compiling unicode-segmentation v1.0.3
   Compiling unicode-xid v0.1.0
   Compiling winapi v0.2.8
   Compiling term v0.4.6
   Compiling rand_core v0.2.1
   Compiling ryu v0.2.6
   Compiling termbox-sys v0.2.10 (https://github.com/jmacdonald/termbox-sys#aa62b4d0)
   Compiling bitflags v0.2.1
   Compiling version_check v0.1.4
   Compiling rustc-serialize v0.3.24
   Compiling fnv v1.0.6
   Compiling smallvec v0.4.5
   Compiling cfg-if v0.1.5
   Compiling utf8-ranges v0.1.3
   Compiling unicode-width v0.1.5
   Compiling yaml-rust v0.3.5
   Compiling libc v0.2.43
   Compiling openssl-probe v0.1.2
   Compiling plist v0.2.4
   Compiling remove_dir_all v0.5.1
   Compiling safemem v0.2.0
   Compiling fragment v0.3.1
   Compiling rustc-demangle v0.1.9
   Compiling serde v1.0.78
   Compiling itoa v0.4.3
   Compiling num-integer v0.1.39
   Compiling num-traits v0.2.6
   Compiling xdg v2.1.0
   Compiling cc v1.0.25
   Compiling bitflags v0.9.1
   Compiling bitflags v1.0.4
   Compiling regex-syntax v0.4.2
   Compiling bitflags v0.8.2
   Compiling proc-macro2 v0.4.19
   Compiling winapi-build v0.1.1
   Compiling pkg-config v0.3.14
   Compiling linked-hash-map v0.5.1
   Compiling luthor v0.1.7
   Compiling regex-syntax v0.3.9
   Compiling matches v0.1.8
   Compiling same-file v1.0.3
   Compiling lazy_static v1.1.0
   Compiling log v0.4.5
   Compiling pad v0.1.5
   Compiling base64 v0.8.0
   Compiling termion v1.5.1
   Compiling time v0.1.40
   Compiling memchr v0.1.11
   Compiling rand v0.5.5
   Compiling xcb v0.8.2
   Compiling app_dirs v1.2.1
   Compiling xml-rs v0.7.0
   Compiling kernel32-sys v0.2.2
   Compiling yaml-rust v0.4.2
   Compiling syntex_pos v0.58.1
   Compiling miniz-sys v0.1.10
   Compiling cmake v0.1.34
   Compiling backtrace-sys v0.1.24
   Compiling libssh2-sys v0.2.11
error[E0425]: cannot find function `read_to_string` in module `fs`
  --> /home/jbrains/.cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.11/build.rs:99:26
   |
99 |         let config = fs::read_to_string("libssh2/src/libssh2_config_cmake.h.in")
   |                          ^^^^^^^^^^^^^^ did you mean `read_string`?

error[E0425]: cannot find function `read_to_string` in module `fs`
   --> /home/jbrains/.cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.11/build.rs:124:24
    |
124 |     let libssh2h = fs::read_to_string("libssh2/include/libssh2.h").unwrap();
    |                        ^^^^^^^^^^^^^^ did you mean `read_string`?

error[E0425]: cannot find function `read_to_string` in module `fs`
   --> /home/jbrains/.cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.11/build.rs:134:13
    |
134 |         fs::read_to_string("libssh2/libssh2.pc.in")
    |             ^^^^^^^^^^^^^^ did you mean `read_string`?

error[E0658]: use of unstable library feature 'fs_read_write' (see issue #46588)
   --> /home/jbrains/.cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.11/build.rs:105:9
    |
105 |         fs::write(build.join("libssh2_config.h"), &config).unwrap();
    |         ^^^^^^^^^

error[E0658]: use of unstable library feature 'fs_read_write' (see issue #46588)
   --> /home/jbrains/.cargo/registry/src/github.com-1ecc6299db9ec823/libssh2-sys-0.2.11/build.rs:132:5
    |
132 |     fs::write(
    |     ^^^^^^^^^

error: aborting due to 5 previous errors

error: Could not compile `libssh2-sys`.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `amp v0.5.0 (https://github.com/jmacdonald/amp/#242e1a77)`, intermediate artifacts can be found at `/tmp/cargo-install.cwLF7lZmaWEZ`

Caused by:
  build failed

I am in your hands. Thank you.

jbrains commented 6 years ago

OK. This seems related: https://github.com/rust-osdev/bootimage/issues/12

I don't know rust yet. If I've only installed cargo, then can I update the rust compiler? How do I?

Thank you.

jmacdonald commented 6 years ago

Hi @jbrains! The best way to compile Amp is via Rust's most recent stable release. Rust manages versions through rustup; you can find installation instructions here. If you're using a version of Rust provided by your package manager (apt-get if you're Ubuntu/Debian-based), it's likely old. Uninstall that and use rustup as linked above, instead. 🙂

sophiajt commented 6 years ago

Hey - I'm also on Pop! OS here (which I love). You should be able to install amp, once you have a recent Rust (using rustup as mentioned above) with the line:

cargo install --git https://github.com/jmacdonald/amp

If it fails building a package then, you may need to install a few ubuntu packages. I think I had to install a few dependencies, like the developer headers for libssl (which is mentioned in the blog post you link to)

jbrains commented 5 years ago

Thanks, @jonathandturner! I tried the cargo install, but I guess I don't have a recent-enough version of Rust. I'm not looking to learn too much Rust (yet), so I can try installing for the next 20 minutes and see what happens. Between your suggestion and @jmacdonald's advice, I might be able to get amp running.

Thank you both.

jbrains commented 5 years ago

Yay! I installed amp, although not without some microdrama. I've written about that:

https://jb.rainsberger.ca/permalink/installing-amp-a-text-editor

Thank you both for your help. I look forward to trying amp.