Closed luckypoem closed 8 years ago
linked-hash-map 编译不过
Ref: https://github.com/contain-rs/linked-hash-map/issues/31
linked-hash-map 已Fixed,但接下来的问题是memmap不能编译,正在等它放到crates.io上。
hi. 我在~/shadowsocks-rust目录里运行cargo build,仍然遇到同样的错误,我看了https://github.com/contain-rs/linked-hash-map/issues/31,它说“Fixed in version 0.0.7.”,我如何把linked-hash-map升级到0.0.7?
cargo update
就好。
另外目前还差memmap
的升级,先等它把新版publish上去
hi.
我遇到另外一个问题,怎么解决?
root@AR:~/shadowsocks-rust# cargo update
Updating registry https://github.com/rust-lang/crates.io-index
Updating git repository https://github.com/zonyitoo/coio-rs.git
Updating git repository https://github.com/zonyitoo/lru-cache.git
Updating git repository https://github.com/zonyitoo/libsodium-sys.git
Updating git repository https://github.com/carllerche/mio.git
Updating git repository https://github.com/zonyitoo/context-rs.git
Updating git repository https://github.com/alexcrichton/miow
Updating git repository https://github.com/carllerche/nix-rust
Updating git repository https://github.com/carllerche/bytes
Adding kernel32-sys v0.2.0
Adding libc v0.2.1
Updating linked-hash-map v0.0.6 -> v0.0.7
root@AR:~/shadowsocks-rust#
root@AR:~/shadowsocks-rust# cargo build
Downloading kernel32-sys v0.2.0
Downloading linked-hash-map v0.0.7
native library kernel32
is being linked to by more than one package, and can only be linked to by one package
kernel32-sys v0.2.0 kernel32-sys v0.1.4 root@AR:~/shadowsocks-rust#
谢谢你
cargo clean
之后再cargo update
hi. 没有用啊。问题依旧:
root@AR:~/shadowsocks-rust# ls
Cargo.lock Cargo.toml examples LICENSE README.md src target
root@AR:~/shadowsocks-rust# cargo clean
root@AR:~/shadowsocks-rust# cargo update
Updating registry https://github.com/rust-lang/crates.io-index
Updating git repository https://github.com/zonyitoo/coio-rs.git
Updating git repository https://github.com/zonyitoo/lru-cache.git
Updating git repository https://github.com/zonyitoo/libsodium-sys.git
Updating git repository https://github.com/carllerche/mio.git
Updating git repository https://github.com/zonyitoo/context-rs.git
Updating git repository https://github.com/carllerche/nix-rust
Updating git repository https://github.com/carllerche/bytes
Updating git repository https://github.com/alexcrichton/miow
Adding kernel32-sys v0.1.4
Adding libc v0.1.12
root@AR:~/shadowsocks-rust# cargo build
native library kernel32
is being linked to by more than one package, and can only be linked to by one package
kernel32-sys v0.1.4 kernel32-sys v0.2.0 root@AR:~/shadowsocks-rust# 谢谢你
已重现,的确是有问题,这里显示有几个crate依赖了kernel32
,我看看是哪个的问题
请 git pull
之后执行 cargo update && cargo build
,编译应该会通过。
hi.
还是不行。
Unpacking objects: 100% (4/4), done.
来自 https://github.com/zonyitoo/shadowsocks-rust
315b288..2974c14 master -> origin/master
更新 315b288..2974c14
Fast-forward
src/lib.rs | 2 +-
1 个文件被修改,插入 1 行(+),删除 1 行(-)
root@AR:~/shadowsocks-rust# cargo update
Updating git repository https://github.com/zonyitoo/coio-rs.git
Updating git repository https://github.com/zonyitoo/lru-cache.git
Updating registry https://github.com/rust-lang/crates.io-index
Updating git repository https://github.com/zonyitoo/libsodium-sys.git
Updating git repository https://github.com/carllerche/mio.git
Updating git repository https://github.com/zonyitoo/context-rs.git
Updating git repository https://github.com/alexcrichton/miow
Updating git repository https://github.com/carllerche/bytes
Updating git repository https://github.com/carllerche/nix-rust
Updating git repository https://github.com/danburkert/memmap-rs
Updating context v0.1.3 (https://github.com/zonyitoo/context-rs.git#53b0a486) -> #fdbe9bed
Updating kernel32-sys v0.2.0 -> v0.1.4
Adding libc v0.2.1
Adding memmap v0.2.1 (https://github.com/danburkert/memmap-rs#a7c08e07)
Removing memmap v0.2.1
root@AR:~/shadowsocks-rust# cargo build
Compiling libc v0.2.1
Compiling rustc-serialize v0.3.16
Compiling pkg-config v0.3.6
Compiling ansi_term v0.6.3
Compiling strsim v0.4.0
Compiling byteorder v0.3.13
Compiling bytes v0.2.10 (https://github.com/carllerche/bytes?rev=7edb577d0a#7edb577d)
Compiling winapi v0.2.4
Compiling bitflags v0.3.2
Compiling winapi-build v0.1.1
Compiling linked-hash-map v0.0.7
/root/.cargo/registry/src/github.com-121aea75f9ef2ce2/linked-hash-map-0.0.7/src/lib.rs:31:1: 31:28 error: #[feature] may not be used on the stable release channel
/root/.cargo/registry/src/github.com-121aea75f9ef2ce2/linked-hash-map-0.0.7/src/lib.rs:31 #![feature(hashmap_hasher)]
^~~~~~~
error: aborting due to previous error
Compiling libc v0.1.12
Compiling slab v0.1.2
Compiling cfg-if v0.1.0
Compiling libsodium-sys v0.1.1 (https://github.com/zonyitoo/libsodium-sys.git#bf59b517)
Compiling clap v1.4.7
Compiling ws2_32-sys v0.1.0
Compiling advapi32-sys v0.1.2
Compiling kernel32-sys v0.1.4
Build failed, waiting for other jobs to finish...
Could not compile linked-hash-map
.
To learn more, run the command again with --verbose. root@AR:~/shadowsocks-rust#
不能干脆删掉linked-hash-map这个组件吗
error: #[feature] may not be used on the stable release channel
你的错误里就告诉了你原因了,要用Rust Nightly,不能用stable。 即使我删掉linked-hash-map也是不行的,因为coio也必须使用Nightly。
hi。 我怎么使用nightly版的程序?
hi. 知道怎么用rust nightly了。先卸载,再装nightly版的rust.不过虽然build成功,但target目录里并未出现sslocal和ssserver文件: root@AR:~/shadowsocks-rust# cargo build Compiling byteorder v0.3.13 Compiling bytes v0.2.10 (https://github.com/carllerche/bytes?rev=7edb577d0a#7edb577d) Compiling cfg-if v0.1.0 Compiling slab v0.1.2 Compiling winapi-build v0.1.1 Compiling ws2_32-sys v0.1.0 Compiling gcc v0.3.19 Compiling winapi v0.2.4 Compiling pkg-config v0.3.6 Compiling strsim v0.4.0 Compiling libsodium-sys v0.1.1 (https://github.com/zonyitoo/libsodium-sys.git#bf59b517) Compiling libc v0.2.1 Compiling libc v0.1.12 Compiling advapi32-sys v0.1.2 Compiling linked-hash-map v0.0.7 Compiling lru-cache v0.0.2 (https://github.com/zonyitoo/lru-cache.git#7688eae5) Compiling ansi_term v0.6.3 Compiling rustc-serialize v0.3.16 Compiling rand v0.3.11 Compiling log v0.3.3 Compiling fern v0.3.5 Compiling kernel32-sys v0.1.4 Compiling time v0.1.33 Compiling fs2 v0.2.0 Compiling memmap v0.2.1 (https://github.com/danburkert/memmap-rs#a7c08e07) Compiling deque v0.2.3 Compiling net2 v0.2.16 Compiling miow v0.1.0 (https://github.com/alexcrichton/miow?rev=2adb93247f#2adb9324) Compiling bitflags v0.3.2 Compiling clap v1.4.7 Compiling nix v0.4.1 (https://github.com/carllerche/nix-rust?rev=ad87c3bdc9#ad87c3bd) Compiling mio v0.5.0-pre (https://github.com/carllerche/mio.git#70298b27) Compiling num v0.1.27 Compiling context v0.1.3 (https://github.com/zonyitoo/context-rs.git#fdbe9bed) Compiling qrcode v0.1.6 Compiling chrono v0.2.16 Compiling coio v0.1.3 (https://github.com/zonyitoo/coio-rs.git#6354839e) Compiling shadowsocks-rust v0.9.13 (file:///root/shadowsocks-rust) root@AR:~/shadowsocks-rust# ls Cargo.lock Cargo.toml examples LICENSE README.md src target root@AR:~/shadowsocks-rust# cd target root@AR:~/shadowsocks-rust/target# ls debug root@AR:~/shadowsocks-rust/target#
怎么回事呢?
在debug
里面,你如果加--release
的话这里还会多出一个release
文件夹。
另外,你可以去用multirust
来装多个rustc版本。
另外,你也不用直接去target/debug
里面去运行的,直接用
cargo run --bin sslocal
就好
hi.
root@AR:~/shadowsocks-rust# cargo run --bin ssserver
Running target/debug/ssserver
[2015-11-07][19:26:05][INFO] ShadowSocks 0.9.13
An unknown error occurred
To learn more, run the command again with --verbose. root@AR:~/shadowsocks-rust# cd target/debug root@AR:~/shadowsocks-rust/target/debug# ls build deps libshadowsocks.rlib socks5-tool ssserver config.json examples native sslocal ssurl root@AR:~/shadowsocks-rust/target/debug# ./ssserver -c config.json [2015-11-07][19:27:24][INFO] ShadowSocks 0.9.13 段错误 root@AR:~/shadowsocks-rust/target/debug#
够折腾的啊。如何解决?
你的是什么系统,什么架构?x86的么?
更新之后还是会出现kernel32-sys
的问题,找到是因为time
没有更新的原因。
Ref: https://github.com/rust-lang-deprecated/time/issues/126
hi.
root@198.x.y.z's password: Linux AR 2.6.32-042stab103.6 #1 SMP Wed Jan 21 13:07:39 MSK 2015 i686
The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. root@AR:~# uname -a Linux AR 2.6.32-042stab103.6 #1 SMP Wed Jan 21 13:07:39 MSK 2015 i686 GNU/Linux root@AR:~#
我的是debian 32bit os.你的意思是你这个程序不支持32位,只支持64位?
是啊。我重新克隆,然后运行cargo build,还是出错,如何解决?
root@AR:~/shadowsocks-rust-new# cargo build
Downloading memmap v0.2.2
native library kernel32
is being linked to by more than one package, and can only be linked to by one package
kernel32-sys v0.2.0 kernel32-sys v0.1.4 root@AR:~/shadowsocks-rust-new#
32位目前是有Bug的,协程库在32位下跑会有问题(https://github.com/zonyitoo/coio-rs/issues/12)。
下面的那个问题就是我讲的在time
里面引用的kernel32-sys
版本冲突的问题。
hi.
那如何解决“在time里面引用的kernel32-sys版本冲突的问题”?
要等https://github.com/rust-lang-deprecated/time/的作者更新kernel32-sys
in dependencies吗
嗯,就他没更新,而其它的人都更新了,导致同一个项目里链接了同一个crate的不同版本
hi. 这位retep998似乎不愿更新,那现在怎么解决kernel32-sys版本冲突的问题?我在:~/shadowsocks-rust/里运行cargo build怎么就解决了kernel32-sys版本冲突的问题呢?怎么把“ ~/shadowsocks-rust/里运行cargo build就解决了kernel32-sys版本冲突的问题”的思路固定下来?
time
已更新 kernel32-sys
的依赖。
hi. 我在另一台64位的vps上运行curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly失败。不知为何?
root@VM:~# uname -a Linux VM 2.6.32-042stab111.11 #1 SMP Tue Sep 1 18:19:12 MSK 2015 x86_64 x86_64 x 86_64 GNU/Linux root@VM:~# curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel =nightly
Welcome to Rust.
WARNING: This script appears to be running as root. While it will work correctly, it is no longer necessary for rustup.sh to run as root.
This script will download the Rust compiler and its package manager, Cargo, and
install them to /usr/local. You may install elsewhere by running this script
with the --prefix=
The installer will run under 'sudo' and may ask you for your password. If you do not want the script to run 'sudo' then pass it the --disable-sudo flag.
You may uninstall later by running /usr/local/lib/rustlib/uninstall.sh, or by running this script again with the --uninstall flag.
Continue? (y/N) y
rustup: gpg available. signatures will be verified rustup: downloading manifest for 'nightly' rustup: downloading toolchain for 'nightly' ######################################################################## 100.0% gpg: Signature made Mon Nov 9 05:12:35 2015 EST using RSA key ID 7B3B09DC gpg: Good signature from "Rust Language (Tag and Release Signing Key) rust-key@rust-lang.org" gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: 108F 6620 5EAE B0AA A8DD 5E1C 85AB 96E6 FA1B E5FE Subkey fingerprint: C134 66B7 E169 A085 1886 3216 5CB4 A934 7B3B 09DC rustup: extracting installer ^[[B^[[Brustup: installing toolchain for 'nightly' sh: 1386: sudo: not found rustup: command failed: sudo sh /root/.rustup/tmp/tmp-15956-10/rust-nightly-x86_64-unknown-linux-gnu/install.sh --prefix=/usr/local rustup: failed to install toolchain root@VM:~# 谢谢你
sh: 1386: sudo: not found
rustup: command failed: sudo sh /root/.rustup/tmp/tmp-15956-10/rust-nightly-x86_64-unknown-linux-gnu/install.sh --prefix=/usr/local
没装 sudo
,加个 --help
看一下参数吧,我记得有个 --disable-sudo
的。
hi. 再次遇到错误。好事多磨啊
root@VM:~/shadowsocks-rust# ls
Cargo.lock Cargo.toml LICENSE README.md examples src
root@VM:~/shadowsocks-rust# cargo update
Updating git repository https://github.com/zonyitoo/libsodium-sys.git
Updating registry https://github.com/rust-lang/crates.io-index
Updating git repository https://github.com/zonyitoo/coio-rs.git
Updating git repository https://github.com/zonyitoo/lru-cache.git
Updating git repository https://github.com/carllerche/mio.git
Updating git repository https://github.com/zonyitoo/context-rs.git
Updating git repository https://github.com/carllerche/bytes
Updating git repository https://github.com/alexcrichton/miow
Updating git repository https://github.com/carllerche/nix-rust
Adding kernel32-sys v0.1.4
Adding libc v0.2.2
Adding ws2_32-sys v0.2.0
root@VM:~/shadowsocks-rust# cargo build
native library ws2_32
is being linked to by more than one package, and can only be linked to by one package
ws2_32-sys v0.2.0 ws2_32-sys v0.1.0 root@VM:~/shadowsocks-rust#
又冲突?cargo update
再build试试
HI. 我上面就是cargo update,然后cargo build后所显示的内容。 不明白怎么回事,才解决 kernel32-sys v0.1.4的问题。怎么又冒出一个ws2_32-sys问题? 这行“Adding ws2_32-sys v0.2.0”,不能想办法去掉它吗
不能,因为依赖的库里面各自依赖了同一个库的不同版本。
那这问题咋解决呢?
miow
和 net2
更新没有同步,net2
先更新了,等几天吧。
昨天还没更新的。
hi. 还没更新吗
你自己试一下嘛,可以了啊
hi. 还是不行。
root@VM:~/shadowsocks-rust# cargo update
Updating registry https://github.com/rust-lang/crates.io-index
Updating git repository https://github.com/zonyitoo/libsodium-sys.git
Updating git repository https://github.com/zonyitoo/lru-cache.git
Updating git repository https://github.com/zonyitoo/coio-rs.git
Updating git repository https://github.com/zonyitoo/context-rs.git
Updating git repository https://github.com/carllerche/mio.git
Updating git repository https://github.com/alexcrichton/miow
Updating git repository https://github.com/carllerche/bytes
Updating git repository https://github.com/carllerche/nix-rust
Updating ansi_term v0.6.3 -> v0.7.0
Updating clap v1.4.7 -> v1.5.2
Updating fs2 v0.2.1 -> v0.2.2
Updating kernel32-sys v0.1.4 -> v0.2.1
Adding libc v0.2.2
Updating mio v0.5.0-pre (https://github.com/carllerche/mio.git#70298b27) -> #ac165e08
Removing miow v0.1.0 (https://github.com/alexcrichton/miow?rev=2adb93247f#2adb9324)
Adding miow v0.1.1 (https://github.com/alexcrichton/miow?rev=b00451dfb1#b00451df)
Adding vec_map v0.4.0
Updating ws2_32-sys v0.2.0 -> v0.2.1
root@VM:~/shadowsocks-rust# cargo build
Downloading fs2 v0.2.2
Downloading ws2_32-sys v0.2.1
Downloading ansi_term v0.7.0
Downloading clap v1.5.2
Downloading vec_map v0.4.0
Compiling ansi_term v0.7.0
Compiling bytes v0.2.10 (https://github.com/carllerche/bytes?rev=7edb577d0a#7edb577d)
Compiling pkg-config v0.3.6
Compiling rustc-serialize v0.3.16
Compiling vec_map v0.4.0
Compiling slab v0.1.2
Compiling bitflags v0.3.2
Compiling cfg-if v0.1.0
Compiling libc v0.2.2
Compiling byteorder v0.3.13
Compiling winapi v0.2.5
Compiling linked-hash-map v0.0.7
/root/.cargo/registry/src/github.com-0a35038f75765ae4/linked-hash-map-0.0.7/src/lib.rs:31:1: 31:28 error: #[feature] may not be used on the stable release channel
/root/.cargo/registry/src/github.com-0a35038f75765ae4/linked-hash-map-0.0.7/src/lib.rs:31 #![feature(hashmap_hasher)]
^~~~~~~
error: aborting due to previous error
Compiling strsim v0.4.0
Compiling libc v0.1.12
Compiling winapi-build v0.1.1
Compiling libsodium-sys v0.1.1 (https://github.com/zonyitoo/libsodium-sys.git#bf59b517)
Build failed, waiting for other jobs to finish...
Could not compile linked-hash-map
.
To learn more, run the command again with --verbose. root@VM:~/shadowsocks-rust#
hi. oh,sorry ,i used the 1.4.0 of rust
用nightly,不要用stable
hi.
root@AR:~/shadowsocks-rust# ls Cargo.toml examples LICENSE README.md src root@AR:~/shadowsocks-rust# cargo build Updating git repository
https://github.com/zonyitoo/libsodium-sys.git
Updating git repositoryhttps://github.com/zonyitoo/coio-rs.git
Updating registryhttps://github.com/rust-lang/crates.io-index
Updating git repositoryhttps://github.com/zonyitoo/lru-cache.git
Updating git repositoryhttps://github.com/carllerche/mio.git
Updating git repositoryhttps://github.com/zonyitoo/context-rs.git
Updating git repositoryhttps://github.com/alexcrichton/miow
Updating git repositoryhttps://github.com/carllerche/bytes
Updating git repositoryhttps://github.com/carllerche/nix-rust
Compiling pkg-config v0.3.6 Compiling slab v0.1.2 Compiling winapi-build v0.1.1 Compiling cfg-if v0.1.0 Compiling libc v0.1.12 Compiling ansi_term v0.6.3 Compiling libc v0.2.1 Compiling bytes v0.2.10 (https://github.com/carllerche/bytes?rev=7edb577d0a#7edb577d) Compiling bitflags v0.3.2 Compiling strsim v0.4.0 Compiling byteorder v0.3.13 Compiling linked-hash-map v0.0.6 /root/.cargo/registry/src/github.com-121aea75f9ef2ce2/linked-hash-map-0.0.6/src/lib.rs:31:1: 31:28 error: #[feature] may not be used on the stable release channel /root/.cargo/registry/src/github.com-121aea75f9ef2ce2/linked-hash-map-0.0.6/src/lib.rs:31 #![feature(hashmap_hasher)] ^~~~~~~ /root/.cargo/registry/src/github.com-121aea75f9ef2ce2/linked-hash-map-0.0.6/src/lib.rs:32:1: 32:21 error: #[feature] may not be used on the stable release channel /root/.cargo/registry/src/github.com-121aea75f9ef2ce2/linked-hash-map-0.0.6/src/lib.rs:32 #![feature(box_raw)] ^~~~~~~~ /root/.cargo/registry/src/github.com-121aea75f9ef2ce2/linked-hash-map-0.0.6/src/lib.rs:33:1: 33:24 error: #[feature] may not be used on the stable release channel /root/.cargo/registry/src/github.com-121aea75f9ef2ce2/linked-hash-map-0.0.6/src/lib.rs:33 #![feature(iter_order)] ^~~~~~~ error: aborting due to 3 previous errors Compiling winapi v0.2.4 Compiling rustc-serialize v0.3.16 Compiling advapi32-sys v0.1.2 Compiling ws2_32-sys v0.1.0 Compiling kernel32-sys v0.1.4 Compiling log v0.3.3 Compiling libsodium-sys v0.1.1 (https://github.com/zonyitoo/libsodium-sys.git#bf59b517) Compiling nix v0.4.1 (https://github.com/carllerche/nix-rust?rev=ad87c3bdc9#ad87c3bd) Compiling clap v1.4.7 Build failed, waiting for other jobs to finish... Could not compilelinked-hash-map
.To learn more, run the command again with --verbose. root@AR:~/shadowsocks-rust#
how to fix it? thanks!