hyperledger / iroha

Iroha - A simple, enterprise-grade decentralized ledger
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
424 stars 276 forks source link

[bug]: Investigate spurious build failures #3311

Closed appetrosyan closed 9 months ago

appetrosyan commented 1 year ago

cargo build from workspace root works. cargo build from dir does not.

_Originally posted by @mversic in https://github.com/hyperledger/iroha/pull/3077#discussion_r1136983239_

mversic commented 1 year ago

If you edit the code in client or client_cli crates to rely on API exposed by the data_model::transparent_api feature the build will be successful if run from workspace root, but will fail if run from the client or client_cli directory. This indicates that when built from workspace root cargo unifies all features.

Expected behavior is that build should fail in all cases because data_model::transparent_api feature is not enabled by the client or client_cli crates.

This behavior can lead to a silent breakage of builds

Arjentix commented 1 year ago

To reproduce:

Commit: b1855454

  1. cargo check: works (not expected)
  2. cargo run --bin iroha_client_cli: works (not expected)
  3. cargo check --package iroha_client_cli: doesn't work (that's expeced because we really have an error in the code)
mversic commented 10 months ago

related to https://github.com/rust-lang/cargo/issues/4463

mversic commented 10 months ago

related to #3423