Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDI version references break now that there's 0.X.X versions #1596

Closed
Connoropolous opened this issue Sep 28, 2022 · 3 comments · Fixed by #1605
Closed

HDI version references break now that there's 0.X.X versions #1596

Connoropolous opened this issue Sep 28, 2022 · 3 comments · Fixed by #1605
Assignees
Labels
bug Something isn't working

Comments

@Connoropolous
Copy link
Contributor

Connoropolous commented Sep 28, 2022

Symptoms

See the comment below, with the full output

Steps to reproduce

cargo init a new cargo crate
set hdk = "0.0.152" as a dependency
run cargo build.

Analysis

This hasn't previously been an issue when using 0.0.X dependencies because every version was treated as incompatible with other 0.0.X versions, due to being the left-most non-zero number.

hdi = { version = "0.1.2", path = "../hdi", features = ["trace"] }

cargo actually resolves this to 0.1.3 when 0.1.3 has been released, or 0.1.4 when that's released, etc.

I had already dealt with the same or similar thing in holochain-open-dev/dna-auth-resolver and it's an issue that comes up when you change to using minor versions in SemVer from just using patch versions.

I had to analyze this confusing situation we had, and found this:
https://doc.rust-lang.org/cargo/reference/resolver.html#semver-compatibility

I've done some digging... in the cargo dep resolution book:
"Versions are considered compatible if their left-most non-zero major/minor/patch component is the same. For example, 1.0.3 and 1.1.0 are considered compatible, and thus it should be safe to update from the older release to the newer one. However, an update from 1.1.0 to 2.0.0 would not be allowed to be made automatically. This convention also applies to versions with leading zeros. For example, 0.1.0 and 0.1.2 are compatible, but 0.1.0 and 0.2.0 are not. Similarly, 0.0.1 and 0.0.2 are not compatible."
That part at the end is key.
"Similarly, 0.0.1 and 0.0.2 are not compatible."
It also says:
"If multiple packages have a common dependency with semver-incompatible versions, then Cargo will allow this, but will build two separate copies of the dependency. "

Fix Suggestion

switch to =0.1.2 or equivalent

Update

I figured out that in the short run we can workaround this with this command:

cargo update -p hdi --precise 0.1.2

but that will not be easy or intuitive for anyone to figure out

@Connoropolous
Copy link
Contributor Author

Here is the full:

MacBook-Pro:test-hdk connor$ cargo build
    Updating crates.io index
  Downloaded proc-macro2 v1.0.44
  Downloaded thiserror v1.0.37
  Downloaded thiserror-impl v1.0.37
  Downloaded serde v1.0.145
  Downloaded iana-time-zone v0.1.50
  Downloaded syn v1.0.101
  Downloaded kitsune_p2p_dht_arc v0.0.16
  Downloaded holo_hash v0.0.33
  Downloaded holochain_integrity_types v0.0.20
  Downloaded hdi v0.1.3
  Downloaded hdk_derive v0.0.50
  Downloaded serde_derive v1.0.145
  Downloaded semver v1.0.14
  Downloaded lock_api v0.4.9
  Downloaded 14 crates (649.8 KB) in 0.62s
   Compiling proc-macro2 v1.0.44
   Compiling unicode-ident v1.0.4
   Compiling quote v1.0.21
   Compiling syn v1.0.101
   Compiling autocfg v1.1.0
   Compiling libc v0.2.133
   Compiling cfg-if v1.0.0
   Compiling serde_derive v1.0.145
   Compiling serde v1.0.145
   Compiling version_check v0.9.4
   Compiling once_cell v1.15.0
   Compiling thiserror v1.0.37
   Compiling fnv v1.0.7
   Compiling ident_case v1.0.1
   Compiling memchr v2.5.0
   Compiling serde_json v1.0.85
   Compiling paste v1.0.5
   Compiling byteorder v1.4.3
   Compiling ryu v1.0.11
   Compiling itoa v1.0.3
   Compiling cc v1.0.73
   Compiling bytecheck v0.6.9
   Compiling bit-vec v0.6.3
   Compiling convert_case v0.4.0
   Compiling rustversion v1.0.9
   Compiling trilean v1.1.0
   Compiling rend v0.3.6
   Compiling smallvec v1.9.0
   Compiling rkyv v0.7.39
   Compiling log v0.4.17
   Compiling target-lexicon v0.12.4
   Compiling gimli v0.26.2
   Compiling adler v1.0.2
   Compiling seahash v4.1.0
   Compiling bitflags v1.3.2
   Compiling crossbeam-utils v0.8.11
   Compiling rustc-demangle v0.1.21
   Compiling more-asserts v0.2.2
   Compiling cranelift-entity v0.76.0
   Compiling scopeguard v1.1.0
   Compiling wasmparser v0.78.2
   Compiling cranelift-codegen-shared v0.76.0
   Compiling rayon-core v1.9.3
   Compiling leb128 v0.2.5
   Compiling hashbrown v0.12.3
   Compiling crc32fast v1.3.2
   Compiling pin-project-lite v0.2.9
   Compiling either v1.8.0
   Compiling core-foundation-sys v0.8.3
   Compiling rustc-hash v1.1.0
   Compiling fallible-iterator v0.2.0
   Compiling stable_deref_trait v1.2.0
   Compiling lazy_static v1.4.0
   Compiling subtle v2.4.1
   Compiling fastrand v1.8.0
   Compiling remove_dir_all v0.5.3
   Compiling unicode-width v0.1.10
   Compiling wasmer-compiler-cranelift v2.2.0
   Compiling strsim v0.10.0
   Compiling parking_lot_core v0.8.5
   Compiling heck v0.4.0
   Compiling libloading v0.7.3
   Compiling instant v0.1.12
   Compiling tracing-core v0.1.29
   Compiling ahash v0.7.6
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling num-traits v0.2.15
   Compiling indexmap v1.9.1
   Compiling num-integer v0.1.45
   Compiling memoffset v0.6.5
   Compiling crossbeam-epoch v0.9.10
   Compiling rayon v1.5.3
   Compiling lock_api v0.4.9
   Compiling bit-set v0.5.3
   Compiling miniz_oxide v0.5.4
   Compiling wasm-encoder v0.17.0
   Compiling cranelift-codegen-meta v0.76.0
   Compiling cranelift-bforest v0.76.0
   Compiling backtrace v0.3.66
   Compiling wasmer-vm v2.2.0
   Compiling addr2line v0.17.0
   Compiling regalloc v0.0.31
   Compiling getrandom v0.2.7
   Compiling mach v0.3.2
   Compiling num_cpus v1.13.1
   Compiling memmap2 v0.5.7
   Compiling tempfile v3.3.0
   Compiling which v4.3.0
   Compiling time v0.1.44
   Compiling iana-time-zone v0.1.50
   Compiling object v0.29.0
   Compiling wast v47.0.0
   Compiling crossbeam-channel v0.5.6
   Compiling parking_lot v0.11.2
   Compiling region v3.0.0
   Compiling crossbeam-deque v0.8.2
   Compiling hashbrown v0.11.2
   Compiling rmp v0.8.11
   Compiling gcollections v1.5.0
   Compiling intervallum v1.4.0
   Compiling cranelift-codegen v0.76.0
   Compiling darling_core v0.13.4
   Compiling darling_core v0.14.1
   Compiling wat v1.0.49
   Compiling thiserror-impl v1.0.37
   Compiling ptr_meta_derive v0.1.4
   Compiling derive_more v0.99.17
   Compiling holochain_serialized_bytes_derive v0.0.51
   Compiling bytecheck_derive v0.6.9
   Compiling loupe-derive v0.1.3
   Compiling rkyv_derive v0.7.39
   Compiling enum-iterator-derive v0.7.0
   Compiling tracing-attributes v0.1.22
   Compiling wasmer-derive v2.2.0
   Compiling ptr_meta v0.1.4
   Compiling darling_macro v0.14.1
   Compiling darling_macro v0.13.4
   Compiling enum-iterator v0.7.0
   Compiling darling v0.14.1
   Compiling darling v0.13.4
   Compiling enumset_derive v0.6.0
   Compiling tracing v0.1.36
   Compiling enumset v1.0.11
   Compiling serde_bytes v0.11.7
   Compiling serde-transcode v1.1.1
   Compiling rmp-serde v0.15.5
   Compiling kitsune_p2p_dht_arc v0.0.16
   Compiling kitsune_p2p_dht_arc v0.0.15
   Compiling kitsune_p2p_timestamp v0.0.14
   Compiling chrono v0.4.22
   Compiling loupe v0.1.3
   Compiling gimli v0.25.0
   Compiling object v0.28.4
   Compiling wasmer-types v2.2.0
   Compiling holochain_serialized_bytes v0.0.51
   Compiling holo_hash v0.0.33
   Compiling holo_hash v0.0.32
   Compiling holochain_integrity_types v0.0.19
   Compiling holochain_integrity_types v0.0.20
   Compiling wasmer-compiler v2.2.0
   Compiling wasmer-engine v2.2.0
   Compiling wasmer-object v2.2.0
   Compiling wasmer-engine-dylib v2.2.0
   Compiling wasmer-engine-universal v2.2.0
   Compiling hdk_derive v0.0.49
   Compiling hdk_derive v0.0.50
   Compiling cranelift-frontend v0.76.0
   Compiling wasmer v2.2.0
   Compiling holochain_wasmer_common v0.0.80
   Compiling holochain_zome_types v0.0.48
   Compiling holochain_wasmer_guest v0.0.80
   Compiling hdi v0.1.3
   Compiling hdk v0.0.152
error[E0053]: method `verify_signature` has an incompatible type for trait
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hdk.rs:208:51
    |
208 |     fn verify_signature(&self, _verify_signature: VerifySignature) -> ExternResult<bool> {
    |                                                   ^^^^^^^^^^^^^^^
    |                                                   |
    |                                                   expected struct `hdi::prelude::VerifySignature`, found struct `holochain_zome_types::VerifySignature`
    |                                                   help: change the parameter type to match the trait: `hdi::prelude::VerifySignature`
    |
    = note: expected fn pointer `fn(&ErrHdk, hdi::prelude::VerifySignature) -> Result<_, _>`
               found fn pointer `fn(&ErrHdk, holochain_zome_types::VerifySignature) -> Result<_, _>`

error[E0053]: method `hash` has an incompatible type for trait
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hdk.rs:212:33
    |
212 |     fn hash(&self, _hash_input: HashInput) -> ExternResult<HashOutput> {
    |                                 ^^^^^^^^^
    |                                 |
    |                                 expected enum `hdi::prelude::HashInput`, found enum `holochain_zome_types::HashInput`
    |                                 help: change the parameter type to match the trait: `hdi::prelude::HashInput`
    |
    = note: expected fn pointer `fn(&ErrHdk, hdi::prelude::HashInput) -> Result<hdi::prelude::HashOutput, _>`
               found fn pointer `fn(&ErrHdk, holochain_zome_types::HashInput) -> Result<holochain_zome_types::HashOutput, _>`

error[E0053]: method `must_get_entry` has an incompatible type for trait
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hdk.rs:218:32
    |
218 |         _must_get_entry_input: MustGetEntryInput,
    |                                ^^^^^^^^^^^^^^^^^
    |                                |
    |                                expected struct `hdi::prelude::MustGetEntryInput`, found struct `holochain_zome_types::MustGetEntryInput`
    |                                help: change the parameter type to match the trait: `hdi::prelude::MustGetEntryInput`
    |
    = note: expected fn pointer `fn(&ErrHdk, hdi::prelude::MustGetEntryInput) -> Result<hdi::prelude::HoloHashed<hdi::prelude::Entry>, _>`
               found fn pointer `fn(&ErrHdk, holochain_zome_types::MustGetEntryInput) -> Result<holo_hash::HoloHashed<holochain_zome_types::Entry>, _>`

error[E0053]: method `must_get_action` has an incompatible type for trait
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hdk.rs:225:33
    |
225 |         _must_get_action_input: MustGetActionInput,
    |                                 ^^^^^^^^^^^^^^^^^^
    |                                 |
    |                                 expected struct `hdi::prelude::MustGetActionInput`, found struct `holochain_zome_types::MustGetActionInput`
    |                                 help: change the parameter type to match the trait: `hdi::prelude::MustGetActionInput`
    |
    = note: expected fn pointer `fn(&ErrHdk, hdi::prelude::MustGetActionInput) -> Result<hdi::prelude::SignedHashed<hdi::prelude::Action>, _>`
               found fn pointer `fn(&ErrHdk, holochain_zome_types::MustGetActionInput) -> Result<holochain_zome_types::SignedHashed<holochain_zome_types::Action>, _>`

error[E0053]: method `must_get_valid_record` has an incompatible type for trait
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hdk.rs:232:39
    |
232 |         _must_get_valid_record_input: MustGetValidRecordInput,
    |                                       ^^^^^^^^^^^^^^^^^^^^^^^
    |                                       |
    |                                       expected struct `hdi::prelude::MustGetValidRecordInput`, found struct `holochain_zome_types::MustGetValidRecordInput`
    |                                       help: change the parameter type to match the trait: `hdi::prelude::MustGetValidRecordInput`
    |
    = note: expected fn pointer `fn(&ErrHdk, hdi::prelude::MustGetValidRecordInput) -> Result<hdi::prelude::Record, _>`
               found fn pointer `fn(&ErrHdk, holochain_zome_types::MustGetValidRecordInput) -> Result<holochain_zome_types::Record, _>`

error[E0053]: method `must_get_agent_activity` has an incompatible type for trait
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hdk.rs:239:12
    |
239 |         _: MustGetAgentActivityInput,
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^
    |            |
    |            expected struct `hdi::prelude::MustGetAgentActivityInput`, found struct `holochain_zome_types::MustGetAgentActivityInput`
    |            help: change the parameter type to match the trait: `hdi::prelude::MustGetAgentActivityInput`
    |
    = note: expected fn pointer `fn(&ErrHdk, hdi::prelude::MustGetAgentActivityInput) -> Result<Vec<hdi::prelude::RegisterAgentActivity>, _>`
               found fn pointer `fn(&ErrHdk, holochain_zome_types::MustGetAgentActivityInput) -> Result<Vec<holochain_zome_types::RegisterAgentActivity>, _>`

error[E0053]: method `dna_info` has an incompatible type for trait
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hdk.rs:244:48
    |
244 |     fn dna_info(&self, _dna_info_input: ()) -> ExternResult<DnaInfo> {
    |                                                ^^^^^^^^^^^^^^^^^^^^^
    |                                                |
    |                                                expected struct `hdi::prelude::DnaInfo`, found struct `holochain_zome_types::DnaInfo`
    |                                                help: change the output type to match the trait: `Result<hdi::prelude::DnaInfo, holochain_wasmer_guest::WasmError>`
    |
    = note: expected fn pointer `fn(&ErrHdk, ()) -> Result<hdi::prelude::DnaInfo, _>`
               found fn pointer `fn(&ErrHdk, ()) -> Result<holochain_zome_types::DnaInfo, _>`

error[E0053]: method `zome_info` has an incompatible type for trait
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hdk.rs:248:50
    |
248 |     fn zome_info(&self, _zome_info_input: ()) -> ExternResult<ZomeInfo> {
    |                                                  ^^^^^^^^^^^^^^^^^^^^^^
    |                                                  |
    |                                                  expected struct `hdi::prelude::ZomeInfo`, found struct `holochain_zome_types::ZomeInfo`
    |                                                  help: change the output type to match the trait: `Result<hdi::prelude::ZomeInfo, holochain_wasmer_guest::WasmError>`
    |
    = note: expected fn pointer `fn(&ErrHdk, ()) -> Result<hdi::prelude::ZomeInfo, _>`
               found fn pointer `fn(&ErrHdk, ()) -> Result<holochain_zome_types::ZomeInfo, _>`

error[E0053]: method `trace` has an incompatible type for trait
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hdk.rs:252:24
    |
252 |     fn trace(&self, _: TraceMsg) -> ExternResult<()> {
    |                        ^^^^^^^^
    |                        |
    |                        expected struct `hdi::prelude::TraceMsg`, found struct `holochain_zome_types::TraceMsg`
    |                        help: change the parameter type to match the trait: `hdi::prelude::TraceMsg`
    |
    = note: expected fn pointer `fn(&ErrHdk, hdi::prelude::TraceMsg) -> Result<_, _>`
               found fn pointer `fn(&ErrHdk, holochain_zome_types::TraceMsg) -> Result<_, _>`

error[E0053]: method `x_salsa20_poly1305_decrypt` has an incompatible type for trait
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hdk.rs:258:38
    |
258 |         _x_salsa20_poly1305_decrypt: XSalsa20Poly1305Decrypt,
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^
    |                                      |
    |                                      expected struct `hdi::prelude::XSalsa20Poly1305Decrypt`, found struct `holochain_zome_types::XSalsa20Poly1305Decrypt`
    |                                      help: change the parameter type to match the trait: `hdi::prelude::XSalsa20Poly1305Decrypt`
    |
    = note: expected fn pointer `fn(&ErrHdk, hdi::prelude::XSalsa20Poly1305Decrypt) -> Result<std::option::Option<hdi::prelude::XSalsa20Poly1305Data>, _>`
               found fn pointer `fn(&ErrHdk, holochain_zome_types::XSalsa20Poly1305Decrypt) -> Result<std::option::Option<holochain_zome_types::XSalsa20Poly1305Data>, _>`

error[E0053]: method `x_25519_x_salsa20_poly1305_decrypt` has an incompatible type for trait
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hdk.rs:265:46
    |
265 |         _x_25519_x_salsa20_poly1305_decrypt: X25519XSalsa20Poly1305Decrypt,
    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                                              |
    |                                              expected struct `hdi::prelude::X25519XSalsa20Poly1305Decrypt`, found struct `holochain_zome_types::X25519XSalsa20Poly1305Decrypt`
    |                                              help: change the parameter type to match the trait: `hdi::prelude::X25519XSalsa20Poly1305Decrypt`
    |
    = note: expected fn pointer `fn(&ErrHdk, hdi::prelude::X25519XSalsa20Poly1305Decrypt) -> Result<std::option::Option<hdi::prelude::XSalsa20Poly1305Data>, _>`
               found fn pointer `fn(&ErrHdk, holochain_zome_types::X25519XSalsa20Poly1305Decrypt) -> Result<std::option::Option<holochain_zome_types::XSalsa20Poly1305Data>, _>`

error[E0277]: the trait bound `hdi::prelude::Entry: From<holochain_zome_types::Entry>` is not satisfied
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hash_path/path.rs:15:5
    |
15  |     hash_entry(Entry::App(
    |     ^^^^^^^^^^ the trait `From<holochain_zome_types::Entry>` is not implemented for `hdi::prelude::Entry`
    |
    = help: the trait `From<hdi::prelude::HoloHashed<hdi::prelude::Entry>>` is implemented for `hdi::prelude::Entry`
    = note: required because of the requirements on the impl of `Into<hdi::prelude::Entry>` for `holochain_zome_types::Entry`
    = note: required because of the requirements on the impl of `holochain_wasmer_guest::TryFrom<holochain_zome_types::Entry>` for `hdi::prelude::Entry`
note: required by a bound in `hdi::hash::hash_entry`
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdi-0.1.3/src/hash.rs:198:12
    |
198 |     Entry: TryFrom<I, Error = E>,
    |            ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `hdi::hash::hash_entry`

error[E0277]: the trait bound `holo_hash::HoloHash<holo_hash::hash_type::AnyLinkable>: From<hdi::prelude::HoloHash<hdi::prelude::holo_hash::hash_type::Entry>>` is not satisfied
  --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hash_path/path.rs:15:5
   |
15 | /     hash_entry(Entry::App(
16 | |         AppEntryBytes::try_from(SerializedBytes::from(UnsafeBytes::from(ROOT.to_vec())))
17 | |             .expect("This cannot fail as it's under the max entry bytes"),
18 | |     ))
19 | |     .map(Into::into)
   | |____________________^ the trait `From<hdi::prelude::HoloHash<hdi::prelude::holo_hash::hash_type::Entry>>` is not implemented for `holo_hash::HoloHash<holo_hash::hash_type::AnyLinkable>`
   |
   = help: the following other types implement trait `From<T>`:
             <holo_hash::HoloHash<holo_hash::hash_type::Action> as From<holo_hash::HoloHash<holo_hash::hash_type::AnyDht>>>
             <holo_hash::HoloHash<holo_hash::hash_type::Action> as From<holo_hash::HoloHash<holo_hash::hash_type::AnyLinkable>>>
             <holo_hash::HoloHash<holo_hash::hash_type::Agent> as From<holo_hash::HoloHash<holo_hash::hash_type::Entry>>>
             <holo_hash::HoloHash<holo_hash::hash_type::AnyDht> as From<holo_hash::HoloHash<holo_hash::hash_type::Action>>>
             <holo_hash::HoloHash<holo_hash::hash_type::AnyDht> as From<holo_hash::HoloHash<holo_hash::hash_type::Agent>>>
             <holo_hash::HoloHash<holo_hash::hash_type::AnyDht> as From<holo_hash::HoloHash<holo_hash::hash_type::AnyLinkable>>>
             <holo_hash::HoloHash<holo_hash::hash_type::AnyDht> as From<holo_hash::HoloHash<holo_hash::hash_type::Entry>>>
             <holo_hash::HoloHash<holo_hash::hash_type::AnyLinkable> as From<holo_hash::HoloHash<holo_hash::hash_type::Action>>>
           and 7 others
   = note: required because of the requirements on the impl of `Into<holo_hash::HoloHash<holo_hash::hash_type::AnyLinkable>>` for `hdi::prelude::HoloHash<hdi::prelude::holo_hash::hash_type::Entry>`

error[E0277]: the trait bound `holo_hash::HoloHash<holo_hash::hash_type::AnyLinkable>: From<hdi::prelude::HoloHash<hdi::prelude::holo_hash::hash_type::Entry>>` is not satisfied
  --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hash_path/path.rs:19:10
   |
19 |     .map(Into::into)
   |          ^^^^^^^^^^ the trait `From<hdi::prelude::HoloHash<hdi::prelude::holo_hash::hash_type::Entry>>` is not implemented for `holo_hash::HoloHash<holo_hash::hash_type::AnyLinkable>`
   |
   = help: the following other types implement trait `From<T>`:
             <holo_hash::HoloHash<holo_hash::hash_type::Action> as From<holo_hash::HoloHash<holo_hash::hash_type::AnyDht>>>
             <holo_hash::HoloHash<holo_hash::hash_type::Action> as From<holo_hash::HoloHash<holo_hash::hash_type::AnyLinkable>>>
             <holo_hash::HoloHash<holo_hash::hash_type::Agent> as From<holo_hash::HoloHash<holo_hash::hash_type::Entry>>>
             <holo_hash::HoloHash<holo_hash::hash_type::AnyDht> as From<holo_hash::HoloHash<holo_hash::hash_type::Action>>>
             <holo_hash::HoloHash<holo_hash::hash_type::AnyDht> as From<holo_hash::HoloHash<holo_hash::hash_type::Agent>>>
             <holo_hash::HoloHash<holo_hash::hash_type::AnyDht> as From<holo_hash::HoloHash<holo_hash::hash_type::AnyLinkable>>>
             <holo_hash::HoloHash<holo_hash::hash_type::AnyDht> as From<holo_hash::HoloHash<holo_hash::hash_type::Entry>>>
             <holo_hash::HoloHash<holo_hash::hash_type::AnyLinkable> as From<holo_hash::HoloHash<holo_hash::hash_type::Action>>>
           and 7 others
   = note: required because of the requirements on the impl of `Into<holo_hash::HoloHash<holo_hash::hash_type::AnyLinkable>>` for `hdi::prelude::HoloHash<hdi::prelude::holo_hash::hash_type::Entry>`

error[E0277]: the trait bound `hdi::prelude::Entry: From<holochain_zome_types::Entry>` is not satisfied
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hash_path/path.rs:279:9
    |
279 |         hash_entry(Entry::App(AppEntryBytes(
    |         ^^^^^^^^^^ the trait `From<holochain_zome_types::Entry>` is not implemented for `hdi::prelude::Entry`
    |
    = help: the trait `From<hdi::prelude::HoloHashed<hdi::prelude::Entry>>` is implemented for `hdi::prelude::Entry`
    = note: required because of the requirements on the impl of `Into<hdi::prelude::Entry>` for `holochain_zome_types::Entry`
    = note: required because of the requirements on the impl of `holochain_wasmer_guest::TryFrom<holochain_zome_types::Entry>` for `hdi::prelude::Entry`
note: required by a bound in `hdi::hash::hash_entry`
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdi-0.1.3/src/hash.rs:198:12
    |
198 |     Entry: TryFrom<I, Error = E>,
    |            ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `hdi::hash::hash_entry`

error[E0308]: mismatched types
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hash_path/path.rs:279:9
    |
278 |       pub fn path_entry_hash(&self) -> ExternResult<holo_hash::EntryHash> {
    |                                        ---------------------------------- expected `Result<holo_hash::HoloHash<holo_hash::hash_type::Entry>, holochain_wasmer_guest::WasmError>` because of return type
279 | /         hash_entry(Entry::App(AppEntryBytes(
280 | |             SerializedBytes::try_from(self).map_err(|e| wasm_error!(e.into()))?,
281 | |         )))
    | |___________^ expected struct `holo_hash::HoloHash`, found struct `hdi::prelude::HoloHash`
    |
    = note: expected enum `Result<holo_hash::HoloHash<holo_hash::hash_type::Entry>, _>`
               found enum `Result<hdi::prelude::HoloHash<hdi::prelude::holo_hash::hash_type::Entry>, _>`
    = note: perhaps two different versions of crate `holo_hash` are being used?

error[E0277]: the trait bound `holochain_zome_types::LinkTypeFilter: hdi::prelude::LinkTypeFilterExt` is not satisfied
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hash_path/path.rs:327:26
    |
327 |             let exists = get_links(
    |                          ^^^^^^^^^ the trait `hdi::prelude::LinkTypeFilterExt` is not implemented for `holochain_zome_types::LinkTypeFilter`
    |
    = help: the following other types implement trait `hdi::prelude::LinkTypeFilterExt`:
              &[T; N]
              &[T]
              RangeFull
              Vec<T>
              [T; N]
              hdi::prelude::LinkTypeFilter
note: required by a bound in `link::get_links`
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/link.rs:144:21
    |
142 | pub fn get_links(
    |        --------- required by a bound in this
143 |     base: impl Into<AnyLinkableHash>,
144 |     link_type: impl LinkTypeFilterExt,
    |                     ^^^^^^^^^^^^^^^^^ required by this bound in `link::get_links`

error[E0277]: the trait bound `holochain_zome_types::LinkTypeFilter: hdi::prelude::LinkTypeFilterExt` is not satisfied
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hash_path/path.rs:340:26
    |
340 |             let exists = get_links(
    |                          ^^^^^^^^^ the trait `hdi::prelude::LinkTypeFilterExt` is not implemented for `holochain_zome_types::LinkTypeFilter`
    |
    = help: the following other types implement trait `hdi::prelude::LinkTypeFilterExt`:
              &[T; N]
              &[T]
              RangeFull
              Vec<T>
              [T; N]
              hdi::prelude::LinkTypeFilter
note: required by a bound in `link::get_links`
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/link.rs:144:21
    |
142 | pub fn get_links(
    |        --------- required by a bound in this
143 |     base: impl Into<AnyLinkableHash>,
144 |     link_type: impl LinkTypeFilterExt,
    |                     ^^^^^^^^^^^^^^^^^ required by this bound in `link::get_links`

error[E0277]: the trait bound `holochain_zome_types::LinkTypeFilter: hdi::prelude::LinkTypeFilterExt` is not satisfied
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hash_path/path.rs:389:29
    |
389 |         let mut unwrapped = get_links(
    |                             ^^^^^^^^^ the trait `hdi::prelude::LinkTypeFilterExt` is not implemented for `holochain_zome_types::LinkTypeFilter`
    |
    = help: the following other types implement trait `hdi::prelude::LinkTypeFilterExt`:
              &[T; N]
              &[T]
              RangeFull
              Vec<T>
              [T; N]
              hdi::prelude::LinkTypeFilter
note: required by a bound in `link::get_links`
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/link.rs:144:21
    |
142 | pub fn get_links(
    |        --------- required by a bound in this
143 |     base: impl Into<AnyLinkableHash>,
144 |     link_type: impl LinkTypeFilterExt,
    |                     ^^^^^^^^^^^^^^^^^ required by this bound in `link::get_links`

error[E0277]: the trait bound `holochain_zome_types::LinkTypeFilter: hdi::prelude::LinkTypeFilterExt` is not satisfied
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/hash_path/path.rs:438:9
    |
438 |         get_link_details(
    |         ^^^^^^^^^^^^^^^^ the trait `hdi::prelude::LinkTypeFilterExt` is not implemented for `holochain_zome_types::LinkTypeFilter`
    |
    = help: the following other types implement trait `hdi::prelude::LinkTypeFilterExt`:
              &[T; N]
              &[T]
              RangeFull
              Vec<T>
              [T; N]
              hdi::prelude::LinkTypeFilter
note: required by a bound in `link::get_link_details`
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/link.rs:185:21
    |
183 | pub fn get_link_details(
    |        ---------------- required by a bound in this
184 |     base: impl Into<AnyLinkableHash>,
185 |     link_type: impl LinkTypeFilterExt,
    |                     ^^^^^^^^^^^^^^^^^ required by this bound in `link::get_link_details`

error[E0308]: mismatched types
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/link.rs:151:65
    |
151 |                 .get_links(vec![GetLinksInput::new(base.into(), link_type, link_tag)])
    |                                 ------------------              ^^^^^^^^^ expected enum `holochain_zome_types::LinkTypeFilter`, found enum `hdi::prelude::LinkTypeFilter`
    |                                 |
    |                                 arguments to this function are incorrect
    |
    = note: perhaps two different versions of crate `holochain_integrity_types` are being used?
note: associated function defined here
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/holochain_zome_types-0.0.48/src/link.rs:93:12
    |
93  |     pub fn new(
    |            ^^^

error[E0308]: mismatched types
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/link.rs:192:72
    |
192 |                 .get_link_details(vec![GetLinksInput::new(base.into(), link_type, link_tag)])
    |                                        ------------------              ^^^^^^^^^ expected enum `holochain_zome_types::LinkTypeFilter`, found enum `hdi::prelude::LinkTypeFilter`
    |                                        |
    |                                        arguments to this function are incorrect
    |
    = note: perhaps two different versions of crate `holochain_integrity_types` are being used?
note: associated function defined here
   --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/holochain_zome_types-0.0.48/src/link.rs:93:12
    |
93  |     pub fn new(
    |            ^^^

error[E0308]: mismatched types
  --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdk-0.0.152/src/trace.rs:70:24
   |
70 |                   .trace(TraceMsg {
   |  __________________-----_^
   | |                  |
   | |                  arguments to this function are incorrect
71 | |                     level: event.metadata().level().into(),
72 | |                     msg: format!(
73 | |                         "{}:{}:{} {}{}",
...  |
79 | |                     ),
80 | |                 })
   | |_________________^ expected struct `hdi::prelude::TraceMsg`, found struct `holochain_zome_types::TraceMsg`
   |
   = note: perhaps two different versions of crate `holochain_integrity_types` are being used?
note: associated function defined here
  --> /Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/hdi-0.1.3/src/hdi.rs:43:8
   |
43 |     fn trace(&self, trace_msg: TraceMsg) -> ExternResult<()>;
   |        ^^^^^

Some errors have detailed explanations: E0053, E0277, E0308.
For more information about an error, try `rustc --explain E0053`.
error: could not compile `hdk` due to 23 previous errors

@Connoropolous Connoropolous changed the title HDI version references break now that there's minor versions HDI version references break now that there's 0.X.X versions Sep 30, 2022
@steveej steveej self-assigned this Sep 30, 2022
@steveej steveej added the bug Something isn't working label Sep 30, 2022
@steveej
Copy link
Member

steveej commented Oct 4, 2022

I figured out that in the short run we can workaround this with this command:

cargo update -p hdi --precise 0.1.2

but that will not be easy or intuitive for anyone to figure out

thinking this through, i suspect it's also not an entirely effective workaround.

the only way i see is that we pin all dependencies in the hdi and all its local dependencies recursively. all else leaves wiggle room for the resolver. @Connoropolous i would appreciate your thoughts on this.

@steveej
Copy link
Member

steveej commented Oct 4, 2022

thinking about build reproducibility, which is the ultimate desired outcome for happ builds, the hdi crate relates to this as follows:

  • the hdi is always pinned when used as a dependency. we partially control this in the tree, and we should do whatever we can in terms of templates, guides, and all other documentation to advocate for this
  • the hdi itself has its entire dependency tree pinned. i'm not sure yet what measures this involves. it could mean that we pull in all of the hdi's transitive, and thereby implicit, dependencies into its manifest explicitly to pin them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants