local-redir will not be set by default

This commit is contained in:
zonyitoo
2020-05-14 22:17:51 +08:00
parent e0806a17d0
commit bb3369ebc1
5 changed files with 20 additions and 14 deletions

View File

@@ -25,7 +25,7 @@ jobs:
- restore_cache:
key: cargo-cache-{{ arch }}-{{ checksum "rust-version" }}-{{ checksum "Cargo.lock" }}
- run:
command: BUILD_EXTRA_FEATURES="openssl-vendored" ./build-host-release
command: BUILD_EXTRA_FEATURES="openssl-vendored local-redir" ./build-host-release
no_output_timeout: 1h
- save_cache:
paths:

View File

@@ -57,6 +57,12 @@ install:
script:
- cargo test --no-fail-fast
- cargo test --no-fail-fast --features aes-pmac-siv
- cargo test --no-fail-fast --no-default-features
- cargo test --no-fail-fast --features aes-pmac-siv
- cargo test --no-fail-fast --features single-threaded
- cargo test --no-fail-fast --features openssl-vendored
- cargo test --no-fail-fast --features local-dns-relay
- cargo test --no-fail-fast --no-default-features --features "local-http local-http-rustls"
- if [ "${TRAVIS_OS_NAME}" = "linux" -o "${TRAVIS_OS_NAME}" = "osx" ]; then
cargo test --no-fail-fast --features local-redir
fi

View File

@@ -9,6 +9,12 @@ keywords = ["shadowsocks", "proxy", "socks", "socks5", "firewall"]
license = "MIT"
edition = "2018"
[badges]
appveyor = { repository = "shadowsocks/shadowsocks-rust", branch = "master", service = "github" }
circle-ci = { repository = "shadowsocks/shadowsocks-rust", branch = "master" }
travis-ci = { repository = "shadowsocks/shadowsocks-rust", branch = "master" }
maintenance = { status = "passively-maintained" }
[lib]
name = "shadowsocks"

View File

@@ -1,11 +0,0 @@
fn main() {
// Enable redir (transparent proxy) for these targets
if cfg!(any(
target_os = "linux",
target_os = "macos",
target_os = "freebsd",
target_os = "openbsd"
)) {
println!("cargo:rustc-cfg=feature=\"local-redir\"")
}
}

View File

@@ -31,8 +31,13 @@ function build() {
RELEASE_DIR="target/${TARGET}/release"
EXTRA_FEATURES=""
if [[ "$TARGET" == *"-linux-"* || "$TARGET" == *"-darwin" ]]; then
EXTRA_FEATURES="local-redir"
fi
cross build --target "${TARGET}" \
--features "aes-pmac-siv openssl-vendored" \
--features "aes-pmac-siv openssl-vendored ${EXTRA_FEATURES}" \
--release
if [[ $? != "0" ]]; then