From f13b3aeaf4f4fb4103b510c2711028d892d4ecbe Mon Sep 17 00:00:00 2001 From: mohanson Date: Mon, 8 Jul 2024 10:50:02 +0800 Subject: [PATCH] Remove syscall_stdio feature --- .github/workflows/rust.yml | 11 ++++++++++- ckb-debugger/Cargo.toml | 3 +-- ckb-debugger/src/lib.rs | 4 ++-- ckb-debugger/src/main.rs | 4 ++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 469889f..5ae525b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -10,7 +10,7 @@ env: CARGO_TERM_COLOR: always jobs: - build: + build-linux: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -18,3 +18,12 @@ jobs: run: cargo build - name: Build ckb-vm-signal-profiler example run: cargo build --examples --package ckb-vm-signal-profiler + + build-windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - name: Build + run: cargo build + - name: Build ckb-vm-signal-profiler example + run: cargo build --examples --package ckb-vm-signal-profiler diff --git a/ckb-debugger/Cargo.toml b/ckb-debugger/Cargo.toml index 952d987..3e92662 100644 --- a/ckb-debugger/Cargo.toml +++ b/ckb-debugger/Cargo.toml @@ -8,7 +8,6 @@ edition = "2021" [features] default = [] -syscall_stdio = ["nix"] [dependencies] addr2line = "0.17" @@ -29,7 +28,7 @@ goblin = "0.4" hex = "0.4" libc = "0.2.132" log = "0.4.0" -nix = { version = "0.26.2", optional = true } +nix = "0.26.2" probe = "0.5" rand = "0.8.5" regex = "1" diff --git a/ckb-debugger/src/lib.rs b/ckb-debugger/src/lib.rs index 5408442..656be0e 100644 --- a/ckb-debugger/src/lib.rs +++ b/ckb-debugger/src/lib.rs @@ -4,7 +4,7 @@ mod machine_gdb; mod misc; mod syscall_all; mod syscall_elf_dumper; -#[cfg(feature = "syscall_stdio")] +#[cfg(target_family = "unix")] mod syscall_stdio; pub use machine_analyzer::{MachineAnalyzer, MachineOverlap, MachineProfile, MachineStepLog}; @@ -13,5 +13,5 @@ pub use machine_gdb::{GdbStubHandler, GdbStubHandlerEventLoop}; pub use misc::{get_script_hash_by_index, pre_check, DummyResourceLoader, Embed, HumanReadableCycles}; pub use syscall_all::{FileOperation, FileStream, Random, TimeNow}; pub use syscall_elf_dumper::ElfDumper; -#[cfg(feature = "syscall_stdio")] +#[cfg(target_family = "unix")] pub use syscall_stdio::Stdio; diff --git a/ckb-debugger/src/main.rs b/ckb-debugger/src/main.rs index 9dcd663..fa7c167 100644 --- a/ckb-debugger/src/main.rs +++ b/ckb-debugger/src/main.rs @@ -1,5 +1,5 @@ use ckb_chain_spec::consensus::ConsensusBuilder; -#[cfg(feature = "syscall_stdio")] +#[cfg(target_family = "unix")] use ckb_debugger::Stdio; use ckb_debugger::{ get_script_hash_by_index, pre_check, DummyResourceLoader, ElfDumper, FileOperation, FileStream, @@ -376,7 +376,7 @@ fn main() -> Result<(), Box> { machine_assign.expand_syscalls.push(Box::new(FileStream::new(name))); } machine_assign.expand_syscalls.push(Box::new(Random::new())); - #[cfg(feature = "syscall_stdio")] + #[cfg(target_family = "unix")] machine_assign.expand_syscalls.push(Box::new(Stdio::new(false))); machine_assign.expand_syscalls.push(Box::new(TimeNow::new())); machine_assign.wait()?;