PSET Examples broken
stevenroose opened this issue · comments
It seems that the examples are broken on master. Running this produces various compilation errors:
cargo test --features serde
Can you quote the error messages? That command runs cleanly for me and it is run in CI, which has also passed recently.
Hmm, came here to report this again, but probably different broken. The PSET ones are broken now. Many errors about private fields:
Some errors have detailed explanations: E0308, E0433, E0599, E0609, E0616.
For more information about an error, try `rustc --explain E0308`.
error[E0616]: field `inputs` of struct `elements::pset::PartiallySignedTransaction` is private
--> examples/pset.rs:298:10
|
298 | pset.inputs[0].partial_sigs.clear();
| ^^^^^^ private field
|
help: a method `inputs` also exists, call it with parentheses
|
298 | pset.inputs()[0].partial_sigs.clear();
| ++
error[E0616]: field `inputs` of struct `elements::pset::PartiallySignedTransaction` is private
--> examples/pset.rs:299:10
|
299 | pset.inputs[0].final_script_witness = Some(vec![
| ^^^^^^ private field
Hmm, this should definitely be added to the CI.
Yes, and I need to figure out how to run the examples in my local CI.
I think we want to add --all-targets
to our cargo test
invocations.
@apoelstra I think they are run as part of test.sh
? or does your local CI not use that script
@delta1 no, my local CI uses nix so that I can reuse all the dependencies' builds across runs. cargo
rebuilds the world every time.
cool.. maybe a postCheck
that calls run-parts
?
I guess you mean using run-parts
to call the contrib scripts? No, because the contrib scripts call cargo
which will rebuild the world and take 10x as long.
I think to run examples I would need nix-community/crate2nix#284 -- it looks like there is a draft PR open so I can crib code from that.
Edit ah, you mean to run run-parts ./target/debug/examples
as is done in contrib/test.sh ... lemme see if that'll work, it would be super easy and nice if it would..
It looks like the target/debug/examples
directory isn't created. I think I would need to modify crate2nix.