-
Notifications
You must be signed in to change notification settings - Fork 679
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
fix(neard): fixed failed CI tests due to features mismatches #4339
Conversation
All required CI checks pass so far ✔️ except the untested
|
The only thing I believe we can remove performance stats feature flag from all the binaries except neard in the makefile like I proposed in #4338 @bowenwang1996 @frol |
cargo $(RUST_OPTIONS) build -p store-validator --features performance_stats,memory_stats | ||
cargo $(RUST_OPTIONS) build -p near-vm-runner-standalone | ||
cargo $(RUST_OPTIONS) build -p state-viewer --features nearcore/performance_stats,nearcore/memory_stats | ||
cargo $(RUST_OPTIONS) build -p store-validator --features nearcore/performance_stats,nearcore/memory_stats |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we probably should check these build in .buildkite/pipeline.yml:
cargo check -p state-viewer --features nearcore/performance_stats,nearcore/memory_stats
cargo check -p store-validator --features nearcore/performance_stats,nearcore/memory_stats
because existing check doesn't check these feature combinations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't these covered by this?
nearcore/.buildkite/pipeline.yml
Line 30 in 928f15d
RUSTFLAGS='-D warnings' cargo check --workspace --all-targets --all-features |
And @chefsale, what do you think? Regarding your remark in #4338 (comment), if those lines aren't necessary, checks for them might not as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it doesn't because there's no workspace features, see this two commits' buildkite:
1a1256c
08e7e31
So the first one only checks
RUSTFLAGS='-D warnings' cargo check --workspace --all-targets --all-features
It passed. The second commit add a cargo check -p neard --features sandbox
feature and it failed. This means sandbox feature of neard was not checked by cargo check --workspace --all-targets --all-features
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@miraclx I think you're correct, all-features do include all features, mine case was failing because it's missing some features instead of --all-features
didn't work. So the ci doesn't check all feature combinations. cargo check --workspace --all-targets --all-features
ensures when all features are included, all packages can compile. But real build includes package build with no feature, or a subset of features, and they can fail if feature dependency wasn't correctly specified.
So for example this one from Makefile
cargo build -p state-viewer --features nearcore/performance_stats,nearcore/memory_stats
since we don't do make
on ci, it makes sense to cargo check these compile, not introduced by your PR, but a thing we probably should do to gurantee make
works on master commits.
cargo $(RUST_OPTIONS) build -p store-validator --features nightly_protocol,nightly_protocol_features,performance_stats,memory_stats | ||
cargo $(RUST_OPTIONS) build -p near-vm-runner-standalone --features nightly_protocol,nightly_protocol_features | ||
cargo $(RUST_OPTIONS) build -p state-viewer --features nearcore/nightly_protocol,nearcore/nightly_protocol_features,nearcore/performance_stats,nearcore/memory_stats | ||
cargo $(RUST_OPTIONS) build -p store-validator --features nearcore/nightly_protocol,nearcore/nightly_protocol_features,nearcore/performance_stats,nearcore/memory_stats |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same check in buildkite here
protocol_feature_evm = ["near-primitives/protocol_feature_evm"] | ||
protocol_feature_block_header_v3 = ["near-primitives/protocol_feature_block_header_v3"] | ||
protocol_feature_add_account_versions = ["near-primitives/protocol_feature_add_account_versions"] | ||
protocol_feature_tx_size_limit = ["near-primitives/protocol_feature_tx_size_limit"] | ||
protocol_feature_fix_storage_usage = ["near-primitives/protocol_feature_fix_storage_usage"] | ||
nightly_protocol_features = ["nightly_protocol", "near-primitives/nightly_protocol_features", "protocol_feature_evm", "protocol_feature_block_header_v3", "protocol_feature_alt_bn128", "protocol_feature_add_account_versions", "protocol_feature_tx_size_limit", "protocol_feature_fix_storage_usage", "protocol_feature_restore_receipts_after_fix", "protocol_feature_cap_max_gas_price"] | ||
protocol_feature_restore_receipts_after_fix = ["near-primitives/protocol_feature_restore_receipts_after_fix"] | ||
protocol_feature_cap_max_gas_price = ["near-primitives/protocol_feature_cap_max_gas_price"] | ||
nightly_protocol = ["near-primitives/nightly_protocol"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need all these features?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before now, lines like these enabled features that prior to the decoupling, existed in the workspace.
Line 37 in 928f15d
cargo $(RUST_OPTIONS) build -p near-vm-runner-standalone --release --features nightly_protocol,nightly_protocol_features,performance_stats,memory_stats |
Now those features are defined in
nearcore
. This crate, however, doesn't directly depend on nearcore
. So we have to adapt the needed features to directly match the available dependencies.
Added auto-merge -- feels like the faster we do this, the better ) |
We're sort of in a weird spot as it is, we have features within
nearcore
that are required but can't be enabled if they depend on crates listed underdev-dependencies
(bug in cargo: rust-lang/cargo#6915). Temporarily listing them underdependencies
, fixed the CI testing failures we had while working on #4292 (same error @ailisp highlighted: #4333 (comment)), but as pointed out in #4331 (comment), this method should be out of the question. If we remove it, however, we can't work with the tests that depend on those features.This PR moves the previously top-level tests into a new crate to have better dependency and feature handling as @matklad suggested
This would ensure we have dependencies like
testlib
,runtime-params-estimator
andrestored-receipts-verifier
that are only needed for testing and depend on nearcore without cyclic dependency issues while having all features relevant to testing in order.The features within
neard
have been reduced to proxies tonearcore
features, which partially resolves #4325 (though the intent for that has morphed a bit). This also makes for a cleaner dependency graph fromneard
perspective, removing extraneous dependencies that were previously required.I also noticed removed the
old_tests
feature that should've been removed along with the rest of it in #928.Updated some docs and code comments referencing the old
neard
path too.