filter_iter example fails to compile on Windows because it depends on bdk_testenv

Cerrado Apto para principiantes
#2,338 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust

Línea de trabajo

Comienza con crates/bitcoind_rpc/examples/README.md y el ejemplo filter_iter, y luego ejecuta cargo build -p bdk_bitcoind_rpc --example filter_iter en Windows. Inspecciona el import bdk_testenv::anyhow y la ruta de su dev-dependency. Se considera terminado cuando el ejemplo documentado compila sin incorporar el test harness de electrsd exclusivo de Unix; sus requisitos de ejecución existentes deben seguir documentados.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Context

Discovered while using BDK as a new developer: after the bdk_bitcoind_rpc library crate compiled, I followed the in-tree example instructions to run the only official example.

Reproduction

On Windows, from a checkout of this repository:

cargo build -p bdk_bitcoind_rpc
cargo build -p bdk_bitcoind_rpc --example filter_iter

The first command succeeds. The second fails.

crates/bitcoind_rpc/examples/README.md documents the same example as:

cargo run -p bdk_bitcoind_rpc --example filter_iter
Expected behavior

The documented example should compile on a host where bdk_bitcoind_rpc itself compiles. Runtime still needs a local bitcoind (RPC_URL / RPC_COOKIE); that is already documented. Compile should not require the Unix-only test harness.

Actual behavior

Building the example pulls in the bdk_testenv dev-dependency and fails in electrsd 0.38.1's build.rs:

error[E0433]: cannot find `unix` in `os`
  --> electrsd-0.38.1\build.rs:14:18
   |
14 |     use std::os::unix::fs::PermissionsExt;
error[E0599]: no associated function or constant named `from_mode` found for struct `Permissions`
  --> electrsd-0.38.1\build.rs:78:39

The example does not use TestEnv. It only imports anyhow from bdk_testenv:

use anyhow::Context;
use bdk_testenv::anyhow;

Because Cargo examples may use the package's dev-dependencies, that import is enough to compile electrsd.

Environment
  • BDK commit: 0790f0400b108974b538e44d6498dc6fe1157548
  • Crate: bdk_bitcoind_rpc 0.22.0 (filter_iter example)
  • OS: Windows 10 (10.0.26200), x86_64-pc-windows-msvc
  • Rust: rustc 1.97.1 (8bab26f4f 2026-07-14)

Which backend(s) are relevant (if any)?

  • Bitcoin Core RPC

Is this blocking production use?

  • No
Additional context

bdk_testenv depending on electrsd is reasonable for integration tests. It is surprising for this example, because the example talks to an already-running Signet bitcoind and does not start a regtest node.

This is a build/developer-experience issue, not a runtime bug in FilterIter.

Related but different:

  • #1618 / PR #2329 — CI coverage for the example path on Ubuntu
  • #2268 — FilterIter safety
Lenguaje dominante
Rust
Estrellas
1.1k
Forks
520
Merge medio
4 d 1 h
PR fusionados (30 d)
21

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de bitcoindevkit/bdk

Todos los issues de bitcoindevkit/bdk

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.