gfreezy/seeker

在mac上,安装遇错

luckypoem opened this issue · 15 comments

git clone https://github.com/gfreezy/seeker/
cd seeker
cargo build --release
显示:
...
error[E0658]: slice pattern syntax is experimental (see issue #23121)
--> /Users/yuming/.cargo/registry/src/github.com-1ecc6299db9ec823/arc-swap-0.3.11/src/lib.rs:1138:32
|
1138 | .fold([0, 0], |[a1, a2], s| {
| ^^^^^^^^
|
= help: add #![feature(slice_patterns)] to the crate attributes to enable

error[E0658]: slice pattern syntax is experimental (see issue #23121)
--> /Users/yuming/.cargo/registry/src/github.com-1ecc6299db9ec823/arc-swap-0.3.11/src/lib.rs:1139:25
|
1139 | let [v1, v2] = s.snapshot();
| ^^^^^^^^
|
= help: add #![feature(slice_patterns)] to the crate attributes to enable

error: aborting due to 2 previous errors

error: Could not compile arc-swap.
warning: build failed, waiting for other jobs to finish...
error: build failed

如何解决?

之前的代码有问题。重新pull下试一下,昨天更新了。

hi.

yudeMacBook-Air:seeker brite$ ls
Cargo.lock README.md seeker.iml
Cargo.toml sample_config.yml src
yudeMacBook-Air:seeker brite$ cargo install
Installing seeker v0.1.0 (file:///Users/brite/seeker)
Downloading tracing v0.1.6
Downloading tracing-futures v0.0.1-alpha.1
Downloading tracing-fmt v0.0.1-alpha.3
Downloading spin v0.5.1
Downloading tracing-core v0.1.5
Downloading tracing-attributes v0.1.2
Downloading quote v1.0.2
Downloading syn v1.0.3
Downloading proc-macro2 v1.0.1
Downloading unicode-xid v0.2.0
Downloading tracing-log v0.0.1-alpha.1
Downloading tracing-subscriber v0.0.1-alpha.2
Downloading matchers v0.0.1
Downloading regex-automata v0.1.8
Compiling unicode-xid v0.2.0
Compiling data-encoding v2.1.2
Compiling smallvec v0.6.10
Compiling syn v0.15.42
error[E0658]: crate in paths is experimental (see issue #45477)
--> /Users/brite/.cargo/registry/src/github.com-1ecc6299db9ec823/data-encoding-2.1.2/src/lib.rs:826:5
|
826 | use crate::BitOrder::*;
| ^^^^^
|
= help: add #![feature(crate_in_paths)] to the crate attributes to enable

error[E0658]: crate in paths is experimental (see issue #45477)
--> /Users/brite/.cargo/registry/src/github.com-1ecc6299db9ec823/data-encoding-2.1.2/src/lib.rs:1505:5
|
1505 | use crate::SpecificationErrorImpl::*;
| ^^^^^
|
= help: add #![feature(crate_in_paths)] to the crate attributes to enable

error: aborting due to 2 previous errors

error: Could not compile data-encoding.
warning: build failed, waiting for other jobs to finish...
error: failed to compile seeker v0.1.0 (file:///Users/brite/seeker), intermediate artifacts can be found at /Users/brite/seeker/target

Caused by:
build failed
yudeMacBook-Air:seeker brite$

还是不行

rust 版本太低了。更新到最新的 stable。

rustup update stable

运行了rustup update stable

yudeMacBook-Air:seeker brite$ cargo build --release
warning: unused manifest key: package.edition
Compiling itoa v0.4.4
Compiling ucd-util v0.1.3
Compiling unicode-xid v0.1.0
Compiling nodrop v0.1.13
Compiling serde v1.0.99
Compiling memchr v2.2.1
Compiling bitflags v1.1.0
Compiling syn v1.0.3
Compiling scopeguard v1.0.0
Compiling rustc-demangle v0.1.15
Compiling log v0.4.7
Compiling crc32fast v1.2.0
Compiling fallible-streaming-iterator v0.1.9
Compiling fnv v1.0.6
Compiling stable_deref_trait v1.1.1
Compiling proc-macro2 v1.0.1
Compiling ucd-trie v0.1.2
Compiling openssl v0.10.24
Compiling rand_core v0.4.0
Compiling semver-parser v0.7.0
Compiling foreign-types-shared v0.1.1
Compiling managed v0.7.1
Compiling nibble_vec v0.0.4
error[E0432]: unresolved import core::ops::Bound
--> /Users/brite/.cargo/registry/src/github.com-1ecc6299db9ec823/managed-0.7.1/src/map.rs:5:17
|
5 | use core::ops::{Bound, RangeBounds};
| ^^^^^ no Bound in ops

error[E0432]: unresolved import core::ops::RangeBounds
--> /Users/brite/.cargo/registry/src/github.com-1ecc6299db9ec823/managed-0.7.1/src/map.rs:5:24
|
5 | use core::ops::{Bound, RangeBounds};
| ^^^^^^^^^^^ no RangeBounds in ops

error: cannot continue compilation due to previous error

error: Could not compile managed.
warning: build failed, waiting for other jobs to finish...
error: build failed
yudeMacBook-Air:seeker brite$

还是不行

cargo version 返回什么

cargo version
cargo 0.26.0-nightly (1d6dfea44 2018-01-26)
版本不对吗

不对,你这是 2018 年的 nightly 版本,一年多前的版本了。

rustup update
rustup override set stable

hi.

yudeMacBook-Air:seeker brite$ sudo cargo build --release
显示:
....
Compiling tracing-attributes v0.1.2
error: failed to run custom build command for libsodium-ffi v0.1.17
Caused by:
process didn't exit successfully: /Users/yuming/seeker/target/release/build/libsodium-ffi-c1ab3d35ff0b5c03/build-script-build (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=SODIUM_LIB_DIR
cargo:rerun-if-env-changed=SODIUM_STATIC
cargo:rerun-if-env-changed=SODIUM_BUILD_STATIC
--- stderr
thread 'main' panicked at 'Missing libsodium library in your system, try to use SODIUM_BUILD_STATIC=yes to build it from source', /Users/yuming/.cargo/registry/src/github.com-1ecc6299db9ec823/libsodium-ffi-0.1.17/build.rs:50:24
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace.
warning: build failed, waiting for other jobs to finish...
error: build failed
yudeMacBook-Air:seeker brite$

我用brew install libsodium安装了libsodium,为何还会出现上面的错误,好像libsodium没有安装似的。

哦,

yudeMacBook-Air:seeker brite$ sudo SODIUM_BUILD_STATIC=yes cargo build --release
显示:
...
Finished release [optimized] target(s) in 9m 30s
yudeMacBook-Air:seeker brite$
yudeMacBook-Air:seeker brite$ ls
Cargo.lock sample_config.yml target
Cargo.toml seeker.iml
README.md src
yudeMacBook-Air:seeker brite$ cd target
yudeMacBook-Air:target brite$ ls
debug release
yudeMacBook-Air:target brite$ cd release
yudeMacBook-Air:release brite$ ls
build examples seeker
deps incremental seeker.d
yudeMacBook-Air:release brite$ ./seeker -h

Backtrace omitted. Run with RUST_BACKTRACE=1 to display it.
Run with RUST_BACKTRACE=full to include source snippets.

The application panicked (crashed).
called Option::unwrap() on a None value
in src/libcore/option.rs, line 378
thread: main
yudeMacBook-Air:release brite$

这个可执行文件seeker崩溃了,怎么解决?

没有实现 -h,只支持 seeker —config config.yml

hi。

yudeMacBook-Air:release brite$ ./seeker --config config.yml

Backtrace omitted. Run with RUST_BACKTRACE=1 to display it.
Run with RUST_BACKTRACE=full to include source snippets.

The application panicked (crashed).
open tun: Connect("Operation not permitted(did you run with sudo?)")
in src/libcore/result.rs, line 1084
thread: main
yudeMacBook-Air:release brite$

一样的错误。你那个releases里的可执行文件运行起来也是crashed,我怀疑没有真正build成功。

release有bug。上面你的命令要sudo运行。错误信息已经写了

hi.

yudeMacBook-Air:release brite$ sudo ./seeker --config config.yml

Backtrace omitted. Run with RUST_BACKTRACE=1 to display it.
Run with RUST_BACKTRACE=full to include source snippets.

The application panicked (crashed).
called Result::unwrap() on an Err value: Os { code: 48, kind: AddrInUse, message: "Address already in use" }
in src/libcore/result.rs, line 1084
thread: main
yudeMacBook-Air:release brite$

这里的提示:"Address already in use" ,是指哪个地址/端口已被占用呢?

seeker会监听本地udp 53端口,看下是不是本地启动了什么dns服务器

重新发了个release,现在可以直接运行了