From 26d894222a1af122cdad31f1ced81993b87bbbe2 Mon Sep 17 00:00:00 2001 From: QuantumEntangledAndy Date: Wed, 3 May 2023 16:00:25 +0700 Subject: [PATCH] Build this way --- .github/workflows/build.yml | 5 +---- Cargo.toml | 2 +- crates/core/Cargo.toml | 2 +- src/main.rs | 6 ++++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7b7728c..a842065 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -136,8 +136,6 @@ jobs: - name: Install rustup run: | curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path --quiet -y - . "$HOME/.cargo/env" - rustup toolchain install nightly echo "${HOME}/.cargo/bin" >> "${GITHUB_PATH}" - name: Install ${{ matrix.arch }} Rust toolchain run: | @@ -146,13 +144,12 @@ jobs: TARGET: ${{ matrix.target }} - name: Build run: | - cargo +nightly build --verbose --release --all-features --target=${TARGET} + cargo build --verbose --release --all-features --target=${TARGET} env: # Retarget pkg-config as described in https://www.freedesktop.org/wiki/Software/pkg-config/CrossCompileProposal/ PKG_CONFIG_ALLOW_CROSS: 1 PKG_CONFIG_LIBDIR: /usr/lib/${{ matrix.pkgconfig }}/pkgconfig TARGET: ${{ matrix.target }} - RUSTFLAGS: "--cfg tokio_unstable" - uses: actions/upload-artifact@v3 with: name: release-${{ matrix.arch }}-bullseye diff --git a/Cargo.toml b/Cargo.toml index 39e70d4..aa751d2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ regex = "1.7.3" rumqttc = "0.20.0" serde = { version = "1.0.160", features = ["derive"] } time = "0.3.20" -tokio = { version = "1.27.0", features = ["rt", "macros", "io-util"] } # rt-multi-thread +tokio = { version = "1.27.0", features = ["rt-multi-thread", "macros", "io-util", "tracing"] } tokio-stream = "0.1.12" toml = "0.7.3" validator = "0.16.0" diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index 9a6ecb4..079047c 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -28,7 +28,7 @@ serde = { version = "1.0.106", features = ["derive"] } time = { version = "0.3.20" , features = [ "macros", "parsing", "local-offset" ]} tokio = { version = "1.27.0", features = ["full"] } tokio-stream = { version = "0.1.12", features = ["sync", "time", "net"] } -tokio-util = { version = "0.7.7", features = ["full"] } +tokio-util = { version = "0.7.7", features = ["full", "tracing"] } yaserde = "0.8.0" yaserde_derive = "0.8.0" diff --git a/src/main.rs b/src/main.rs index 47c02aa..ae2c2ec 100644 --- a/src/main.rs +++ b/src/main.rs @@ -51,12 +51,14 @@ fn tokio_console_enable() { } #[cfg(not(tokio_unstable))] -fn tokio_console_enable() {} +fn tokio_console_enable() { + debug!("Tokio Console Disabled"); +} #[tokio::main] async fn main() -> Result<()> { - tokio_console_enable(); env_logger::Builder::from_env(Env::default().default_filter_or("info")).init(); + tokio_console_enable(); info!( "Neolink {} {}",