-
Notifications
You must be signed in to change notification settings - Fork 660
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
refactor(neard): decouple into individual crates #4292
Conversation
I feel that that's unfortunate. The root of our workspace is a crate, but this crate only contains integration tests, it isn't a binary or a library. That's surprising (most big projects are set-up differently) and obscures the actual dependencies between the things. The typical setup is to make the root of the workspace a "virtual manifest", without the Large project with non-virtual manifest typically have a top-level crate of substance, with So, if we want to introduce a genuine I understand that this derails immediate work of extracing a library out of neard, but "fix workspace, then split neard" seems to be less work overall. |
Here's a my suggested plan for virtual manifest:
Is this reasonable? Let's do a checklist to make sure we decide one way or another: Do you agree that we should move to virtual manifest setup before introducing proper (tagging a couple of folks who I know have opinions about code organization) |
I totally agree with the proposals from @matklad. I don't expect any breakage from dropping I suggest we move the current |
Yeah agree with what @frol said. Don't expect anything to break with virtual manifest |
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 are on the right track! Once CI is green, we can merge it
…rror with Cargo.lock is missing (lib-mode)
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.
LGTM, just please take a look into the tests why are they failing. Seems after second restart they failed again, so maybe one third time? And ask @bowenwang1996 to maybe take a look 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.
Looks good!
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.
LGTM!
protocol_feature_cap_max_gas_price = ["near-primitives/protocol_feature_cap_max_gas_price", "neard/protocol_feature_cap_max_gas_price", "near-chain/protocol_feature_cap_max_gas_price"] | ||
|
||
# enable this to build neard with wasmer 1.0 runner | ||
# now if none of wasmer0_default, wasmer1_default or wasmtime_default is enabled, wasmer0 would be default |
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.
Those features are needed, why they are removed?
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.
Good catch, I didn't notice that! I think it'd be good indeed to move this over to neard/Cargo.toml
instead of just deleting.
That being said, I wouldn't block on that, as the following now works without feature forwarding:
cargo build -p neard --features node-runtime/wasmer1_default
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.
@olonho Great catch!
It seems it should be in both nearcore
(defined as node-runtime/wasmer1_default
) and in neard
(defined as nearcore/wasmer1_default
).
stays consistent with previous behaviour should be better cleaned out after near#4325 is resolved
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 under `dev-dependencies` (bug in cargo: rust-lang/cargo#6915). Temporarily listing them under `dependencies`, 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 > * [move tests from `/test` folder somewhere -- either to some of the existing packages (neard perhaps?) or into a new `integration-tests` package](#4292 (comment)) This would ensure we have dependencies like `testlib`, `runtime-params-estimator` and `restored-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 to `nearcore` features, which partially resolves #4325 (though the intent for that has morphed a bit). This also makes for a cleaner dependency graph from `neard` 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.
Dissociates
neard
into its binary and library constituents, with the binary depending on the library. Fixes #4233.The intent is to have the binary named
neard
and the library namednearcore
. However, because the workspace is itselfnearcore
, we can either move the library into the root or use a different name for either the workspace or the library itself.