Skip to content

PSET Examples broken #156

Open
Open

Description

@stevenroose

It seems that the examples are broken on master. Running this produces various compilation errors:

cargo test --features serde

Activity

  1. apoelstra commented on Nov 22, 2022

    @apoelstra
    Member

    Can you quote the error messages? That command runs cleanly for me and it is run in CI, which has also passed recently.

  2. stevenroose commented on Aug 2, 2023

    @stevenroose
    ContributorAuthor

    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
    
  3. changed the title [-]Examples broken[/-] [+]PSET Examples broken[/+] on Aug 2, 2023
  4. sanket1729 commented on Aug 2, 2023

    @sanket1729
    Contributor

    Hmm, this should definitely be added to the CI.

  5. apoelstra commented on Aug 2, 2023

    @apoelstra
    Member

    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.

  6. delta1 commented on Aug 2, 2023

    @delta1
    Member

    @apoelstra I think they are run as part of test.sh ? or does your local CI not use that script

  7. apoelstra commented on Aug 2, 2023

    @apoelstra
    Member

    @delta1 no, my local CI uses nix so that I can reuse all the dependencies' builds across runs. cargo rebuilds the world every time.

  8. delta1 commented on Aug 2, 2023

    @delta1
    Member

    cool.. maybe a postCheck that calls run-parts ?

  9. apoelstra commented on Aug 2, 2023

    @apoelstra
    Member

    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..

  10. apoelstra commented on Aug 2, 2023

    @apoelstra
    Member

    It looks like the target/debug/examples directory isn't created. I think I would need to modify crate2nix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions