khyperia / weechat-discord

Unmaintained! And also apparently this is against their TOS so DON'T USE THIS -- Weechat plugin for Discord support - https://weechat.org/ https://discordapp.com/
MIT License
51 stars 24 forks source link

cargo build failed #15

Closed banditkroot closed 7 years ago

banditkroot commented 7 years ago

I've got this error when I tried to build.

$ cargo build --release --verbose
failed to parse registry's information for: serde_json
Caused by: the given version requirement is invalid
serfma commented 7 years ago

Came across the same issue. Few months later, but, did you by chance find a solution?

banditkroot commented 7 years ago

No.

LovesTha commented 7 years ago

Issue still exists. I'm trying to build on 16.04 and I think I've never built any other rust things as I had to install cargo to attempt the build in the first place.

Guess I'm off hunting on how to figure this out.

LovesTha commented 7 years ago

Version of Cargo in Ubuntu isn't new enough apparently. A lot more progress with latest from: https://www.rust-lang.org/en-US/install.html

khyperia commented 7 years ago

Thanks for the issue - I had no idea that people other than me and a friend were using this, so I apologize for not checking github issues for a long time.

I've never seen this error before. I'm guessing that the issue of cargo being too old in Ubuntu is related - it's recommended to use rustup to install rustc/cargo.

Alternatively, it might be just because the Ubuntu version of Cargo can't parse the checked-in version of cargo.lock. Try deleting that file and building - you may run into other issues (e.g. source incompatibilities due to versioning issues), but it may be a temporary workaround if it works.

LovesTha commented 7 years ago

Cool, that will be helpful for someone else finding the same issues :) Or me if I try to go back to other routes.

FredrIQ commented 7 years ago

Not sure if I should create a new issue or not (technically not the same issue, but caused by the same thing). I had this issue too, setting up rustup solved that. However. I ended up seeing this instead. Using Ubuntu 16.04LTS:

error: failed to run custom build command for `weecord v0.1.0 (file:///home/fiq/weechat-discord)`
process didn't exit successfully: `/home/fiq/weechat-discord/target/release/build/weecord-
458f19d304f32adf/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Failure { command: "\"pkg-config\" 
\"--libs\" \"--cflags\" \"weechat\"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: 
"Package weechat was not found in the pkg-config search path.\nPerhaps you should add the directory 
containing `weechat.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'weechat\' 
found\n" } }', /checkout/src/libcore/result.rs:860
note: Run with `RUST_BACKTRACE=1` for a backtrace.
yfery commented 7 years ago

weechat-discord needs weechat plugin header. It tries to get this header path with pkg-config.

FredrIQ commented 7 years ago

I'm on weechat 1.4. This is what the latter returns:

[2013][fiq@fiq ~/weechat-discord]$ pkg-config --cflags weechat
Package weechat was not found in the pkg-config search path.
Perhaps you should add the directory containing `weechat.pc'
to the PKG_CONFIG_PATH environment variable
No package 'weechat' found

$PKG_CONFIG_PATH is empty.

EDIT: Installing weechat-dev seems to have done the trick for that error, but I still have issues.

error: failed to run custom build command for `weecord v0.1.0 (file:///home/fiq/weechat-discord)`
process didn't exit successfully: `/home/fiq/weechat-discord/target/release/build/weecord-458f19d304f32adf/build-script-build` (exit code: 101)
--- stdout
TARGET = Some("i686-unknown-linux-gnu")
OPT_LEVEL = Some("3")
TARGET = Some("i686-unknown-linux-gnu")
HOST = Some("i686-unknown-linux-gnu")
TARGET = Some("i686-unknown-linux-gnu")
TARGET = Some("i686-unknown-linux-gnu")
HOST = Some("i686-unknown-linux-gnu")
CC_i686-unknown-linux-gnu = None
CC_i686_unknown_linux_gnu = None
HOST_CC = None
CC = None
HOST = Some("i686-unknown-linux-gnu")
TARGET = Some("i686-unknown-linux-gnu")
HOST = Some("i686-unknown-linux-gnu")
CFLAGS_i686-unknown-linux-gnu = None
CFLAGS_i686_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
PROFILE = Some("release")
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m32" "-march=i686" "-I" "/usr/include/weechat" "-Wall" "-Wextra" "-Werror" "-o" "/home/fiq/weechat-discord/target/release
/build/weecord-cc13657c4b9030f3/out/src/weecord.o" "-c" "src/weecord.c"
cargo:warning=src/weecord.c: In function ‘wdc_hook_command’:
cargo:warning=src/weecord.c:60:35: error: macro "weechat_hook_command" passed 8 arguments, but takes just 7
cargo:warning=                               NULL);
cargo:warning=                                   ^
cargo:warning=src/weecord.c:53:10: error: ‘weechat_hook_command’ undeclared (first use in this function)
cargo:warning=   return weechat_hook_command(command,
cargo:warning=          ^
cargo:warning=src/weecord.c:53:10: note: each undeclared identifier is reported only once for each function it appears in
cargo:warning=src/weecord.c:40:30: error: unused parameter ‘command’ [-Werror=unused-parameter]
cargo:warning= wdc_hook_command(const char* command,
cargo:warning=                              ^
cargo:warning=src/weecord.c:41:30: error: unused parameter ‘description’ [-Werror=unused-parameter]
cargo:warning=                  const char* description,
cargo:warning=                              ^
cargo:warning=src/weecord.c:42:30: error: unused parameter ‘args’ [-Werror=unused-parameter]
cargo:warning=                  const char* args,
cargo:warning=                              ^
cargo:warning=src/weecord.c:43:30: error: unused parameter ‘args_description’ [-Werror=unused-parameter]
cargo:warning=                  const char* args_description,
cargo:warning=                              ^
cargo:warning=src/weecord.c:44:30: error: unused parameter ‘completion’ [-Werror=unused-parameter]
cargo:warning=                  const char* completion,
cargo:warning=                              ^
cargo:warning=src/weecord.c:45:30: error: unused parameter ‘pointer’ [-Werror=unused-parameter]
cargo:warning=                  const void* pointer,
cargo:warning=                              ^
cargo:warning=src/weecord.c:46:24: error: unused parameter ‘callback’ [-Werror=unused-parameter]
cargo:warning=                  int (*callback)(const void* pointer,
cargo:warning=                        ^
cargo:warning=src/weecord.c: In function ‘wdc_buffer_new’:
cargo:warning=src/weecord.c:117:71: error: macro "weechat_buffer_new" passed 7 arguments, but takes just 5
cargo:warning=     name, input_callback, pointer, NULL, close_callback, pointer, NULL);
cargo:warning=                                                                       ^
cargo:warning=src/weecord.c:116:10: error: ‘weechat_buffer_new’ undeclared (first use in this function)
cargo:warning=   return weechat_buffer_new(
cargo:warning=          ^
cargo:warning=src/weecord.c:106:28: error: unused parameter ‘name’ [-Werror=unused-parameter]
cargo:warning= wdc_buffer_new(const char* name,
cargo:warning=                            ^
cargo:warning=src/weecord.c:107:28: error: unused parameter ‘pointer’ [-Werror=unused-parameter]
cargo:warning=                const void* pointer,
cargo:warning=                            ^
cargo:warning=src/weecord.c:108:22: error: unused parameter ‘input_callback’ [-Werror=unused-parameter]
cargo:warning=                int (*input_callback)(const void* pointer,
cargo:warning=                      ^
cargo:warning=src/weecord.c:112:22: error: unused parameter ‘close_callback’ [-Werror=unused-parameter]
cargo:warning=                int (*close_callback)(const void* pointer,
cargo:warning=                      ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_fd’:
cargo:warning=src/weecord.c:147:62: error: macro "weechat_hook_fd" passed 7 arguments, but takes just 6
cargo:warning=   return weechat_hook_fd(fd, 1, 0, 0, callback, pointer, NULL);
cargo:warning=                                                              ^
cargo:warning=src/weecord.c:147:10: error: ‘weechat_hook_fd’ undeclared (first use in this function)
cargo:warning=   return weechat_hook_fd(fd, 1, 0, 0, callback, pointer, NULL);
cargo:warning=          ^
cargo:warning=src/weecord.c:143:17: error: unused parameter ‘fd’ [-Werror=unused-parameter]
cargo:warning= wdc_hook_fd(int fd,
cargo:warning=                 ^
cargo:warning=src/weecord.c:144:25: error: unused parameter ‘pointer’ [-Werror=unused-parameter]
cargo:warning=             const void* pointer,
cargo:warning=                         ^
cargo:warning=src/weecord.c:145:19: error: unused parameter ‘callback’ [-Werror=unused-parameter]
cargo:warning=             int (*callback)(const void* pointer, void* data, int fd))
cargo:warning=                   ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_completion’:
cargo:warning=src/weecord.c:231:67: error: macro "weechat_hook_completion" passed 5 arguments, but takes just 4
cargo:warning=     completion_item, description, callback, callback_pointer, NULL);
cargo:warning=                                                                   ^
cargo:warning=src/weecord.c:230:10: error: ‘weechat_hook_completion’ undeclared (first use in this function)
cargo:warning=   return weechat_hook_completion(
cargo:warning=          ^
cargo:warning=src/weecord.c:221:33: error: unused parameter ‘completion_item’ [-Werror=unused-parameter]
cargo:warning= wdc_hook_completion(const char* completion_item,
cargo:warning=                                 ^
cargo:warning=src/weecord.c:222:33: error: unused parameter ‘description’ [-Werror=unused-parameter]
cargo:warning=                     const char* description,
cargo:warning=                                 ^
cargo:warning=src/weecord.c:223:33: error: unused parameter ‘callback_pointer’ [-Werror=unused-parameter]
cargo:warning=                     const void* callback_pointer,
cargo:warning=                                 ^
cargo:warning=src/weecord.c:224:27: error: unused parameter ‘callback’ [-Werror=unused-parameter]
cargo:warning=                     int (*callback)(const void*,
cargo:warning=                           ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_command’:
cargo:warning=src/weecord.c:61:1: error: control reaches end of non-void function [-Werror=return-type]
cargo:warning= }
cargo:warning= ^
cargo:warning=src/weecord.c: In function ‘wdc_buffer_new’:
cargo:warning=src/weecord.c:118:1: error: control reaches end of non-void function [-Werror=return-type]
cargo:warning= }
cargo:warning= ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_fd’:
cargo:warning=src/weecord.c:148:1: error: control reaches end of non-void function [-Werror=return-type]
cargo:warning= }
cargo:warning= ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_completion’:
cargo:warning=src/weecord.c:232:1: error: control reaches end of non-void function [-Werror=return-type]
cargo:warning= }
cargo:warning= ^
cargo:warning=cc1: all warnings being treated as errors
exit code: 1

command did not execute successfully, got: exit code: 1

--- stderr
thread 'main' panicked at 'explicit panic', /home/fiq/.cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.50/src/lib.rs:1210
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Is this a matter of my weechat version being too old?

yfery commented 7 years ago

Yep, your version seems too old. See ticket https://github.com/khyperia/weechat-discord/issues/23

khyperia commented 7 years ago

Probably should have reported a new issue in the general case, but in this case, that exact error has been reported twice now (three times if you count this report). Closing this issue since the original issue seems to have been resolved by upgrading cargo :smile: