Skip to content

Commit 65a085e

Browse files
committed
Bump version 0.1.13
1 parent 9bd223d commit 65a085e

File tree

7 files changed

+42
-7
lines changed

7 files changed

+42
-7
lines changed

.github/workflows/publish-exe.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ jobs:
6969
elif [[ "${{ matrix.host_os }}" == "macos-latest" ]]; then
7070
zip -j mypubdir4/socks-hub-${{ matrix.target }}.zip target/${{ matrix.target }}/release/socks-hub ./README.md ./socks_hub_ffi.h target/${{ matrix.target }}/release/libsocks_hub.dylib
7171
if [[ "${{ matrix.target }}" == "x86_64-apple-darwin" ]]; then
72+
./build-aarch64-apple-ios.sh
73+
zip -r mypubdir4/socks-hub-aarch64-apple-ios-xcframework.zip ./socks-hub.xcframework/
7274
./build-apple.sh
7375
zip -r mypubdir4/socks-hub-apple-xcframework.zip ./socks-hub.xcframework/
7476
fi

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "socks-hub"
3-
version = "0.1.12"
3+
version = "0.1.13"
44
license = "MIT"
55
repository = "https://github.com/ssrlive/socks-hub"
66
homepage = "https://github.com/ssrlive/socks-hub"

build-apple-debug.sh renamed to build-aarch64-apple-ios-debug.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ echo "Generating includes..."
1111
mkdir -p target/include/
1212
rm -rf target/include/*
1313
cbindgen --config cbindgen.toml -l C -o target/include/socks-hub.h
14-
cat > target/include/module.modulemap <<EOF
14+
cat > target/include/socks-hub.modulemap <<EOF
1515
framework module socks-hub {
1616
umbrella header "socks-hub.h"
1717

build-aarch64-apple-ios.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#! /bin/sh
2+
3+
echo "Setting up the rust environment..."
4+
rustup target add aarch64-apple-ios
5+
cargo install cbindgen
6+
7+
echo "Building target aarch64-apple-ios..."
8+
cargo build --release --target aarch64-apple-ios
9+
10+
echo "Generating includes..."
11+
mkdir -p target/include/
12+
rm -rf target/include/*
13+
cbindgen --config cbindgen.toml -l C -o target/include/socks-hub.h
14+
cat > target/include/socks-hub.modulemap <<EOF
15+
framework module socks-hub {
16+
umbrella header "socks-hub.h"
17+
18+
export *
19+
module * { export * }
20+
}
21+
EOF
22+
23+
echo "Creating XCFramework"
24+
rm -rf ./socks-hub.xcframework
25+
xcodebuild -create-xcframework \
26+
-library ./target/aarch64-apple-ios/release/libsocks_hub.a -headers ./target/include/ \
27+
-output ./socks-hub.xcframework

build-apple.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ echo "Generating includes..."
2525
mkdir -p target/include/
2626
rm -rf target/include/*
2727
cbindgen --config cbindgen.toml -l C -o target/include/socks-hub.h
28-
cat > target/include/module.modulemap <<EOF
28+
cat > target/include/socks-hub.modulemap <<EOF
2929
framework module socks-hub {
3030
umbrella header "socks-hub.h"
3131

cbindgen.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ language = "C"
22

33
[export]
44
include = ["socks_hub_run", "socks_hub_set_log_callback", "socks_hub_stop"]
5-
# exclude = ["Java_com_github_shadowsocks_bg_run", "Java_com_github_shadowsocks_bg_stop"]
5+
exclude = []
66

7-
[defines]
8-
# "feature = sockshub" = "DEFINE_SOCKSHUB"
7+
[export.rename]
8+
"ArgVerbosity" = "SocksHubVerbosity"
9+
"ProxyType" = "SocksHubProxyType"
10+
11+
[enum]
12+
prefix_with_name = true

src/ffi.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ pub unsafe extern "C" fn socks_hub_run(
3939
ctx: *mut c_void,
4040
) -> c_int {
4141
log::set_max_level(verbosity.into());
42-
log::set_boxed_logger(Box::<crate::dump_logger::DumpLogger>::default()).unwrap();
42+
if let Err(err) = log::set_boxed_logger(Box::<crate::dump_logger::DumpLogger>::default()) {
43+
log::error!("Failed to set logger: {}", err);
44+
}
4345

4446
let local_addr = std::ffi::CStr::from_ptr(local_addr).to_str().unwrap();
4547
let local_addr = local_addr.parse().unwrap();

0 commit comments

Comments
 (0)