You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason, after I moved the location of my repository which uses bitcoind in its dev-dependencies, downloaded_exe_path() continues returning the old path. Everything from target/... onwards is correct - I've verified that there is indeed a bitcoind binary in that location - but the path to the repo seems to remain constant even across system restarts.
[dev-dependencies]
bitcoind = { version = "0.26", features = [ "22_0" ] }
Ensure that OUT_DIR is not set in env vars
echo$OUT_DIR
Have this test:
#[cfg(test)]mod test {fnbitcoind_fails(){let conf = Conf::default();let exe_path = bitcoind::downloaded_exe_path().expect("Didn't specify bitcoind version in feature flags");// This prints// [node/src/command/test/mod.rs:72] &exe_path = "<path_to_OLD_repo_location>/target/debug/build/bitcoind-65c3b20abafd4893/out/bitcoin/bitcoin-22.0/bin/bitcoind"// Aside from the path to the repo, everything else is correctdbg!(&exe_path);// This causes the code not to compile// let out_dir = std::env!("OUT_DIR");// This panics// let out_dir = std::env::var_os("OUT_DIR").unwrap();// This panics when running from new repository locationlet bitcoind = BitcoinD::with_conf(exe_path,&conf).expect("Failed to init bitcoind");}}
Run the test (should pass)
Move the repository, e.g. from $HOME/dev/myrepo to $HOME/dev/bitcoin/myrepo
Rerun the test (should fail)
What I've tried, but which still produce the same error
cargo clean
rm -rf <path_to_repo>/target
rm -rf ~/.cargo/registry
rm -rf ~/.cargo/git
cargo cache -e
Cloning the repo to a new location on the same computer
Even restarting my computer
Workarounds which prevent the panic (but which don't solve the problem)
Downgrading to 0_21_0 in Cargo.toml: bitcoind = { version = "0.26", features = [ "0_21_0" ] }
Specifying bitcoind using a relative path bitcoind = { path = "../../../github/bitcoind", version = "0.26", features = [ "22_0" ] }
Moving the repo back to its original location
Any idea what could be going on?
The text was updated successfully, but these errors were encountered:
I have no idea what the cause was, but nuking the whole repository and recloning it (to the same, new location) appears to have fixed it. Maybe there was some magic git caching going on, idk
For some reason, after I moved the location of my repository which uses
bitcoind
in its dev-dependencies,downloaded_exe_path()
continues returning the old path. Everything fromtarget/...
onwards is correct - I've verified that there is indeed abitcoind
binary in that location - but the path to the repo seems to remain constant even across system restarts.How to reproduce
Platform: macOS
Rust version: nightly-2022-06-27-x86_64-apple-darwin
bitcoind crate version: 0.26.1
Have this in
Cargo.toml
:Ensure that
OUT_DIR
is not set in env varsHave this test:
Run the test (should pass)
Move the repository, e.g. from
$HOME/dev/myrepo
to$HOME/dev/bitcoin/myrepo
Rerun the test (should fail)
What I've tried, but which still produce the same error
cargo clean
rm -rf <path_to_repo>/target
rm -rf ~/.cargo/registry
rm -rf ~/.cargo/git
cargo cache -e
Workarounds which prevent the panic (but which don't solve the problem)
0_21_0
inCargo.toml
:bitcoind = { version = "0.26", features = [ "0_21_0" ] }
bitcoind
using a relative pathbitcoind = { path = "../../../github/bitcoind", version = "0.26", features = [ "22_0" ] }
Any idea what could be going on?
The text was updated successfully, but these errors were encountered: