-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[Move CLI] Updated move CLI to work with flattened pkg core Move command #3019
Conversation
unit_test_config, | ||
compute_coverage, | ||
)?; | ||
let result = c.execute(package_path, build_config, unit_test_config)?; |
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.
The building of the unit test config should be done inside execute. And the. You should t need these clones
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 do add a custom flag to UnitTestConfig
in crates/sui_framework/src/lib.rs and I am not sure how to do it without constructing the UnitTestConfig
upfront:
move_cli::base::test::run_move_unit_tests(
path,
build_config,
UnitTestingConfig {
report_stacktrace_on_abort: true,
..config
},
natives::all_natives(MOVE_STDLIB_ADDRESS, SUI_FRAMEWORK_ADDRESS),
compute_coverage,
&mut std::io::stdout(),
)
|
||
impl New { | ||
pub fn execute(self, path: Option<PathBuf>) -> anyhow::Result<()> { | ||
let name = &self.new.name.to_lowercase(); |
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.
Nit, unpack the command so newly added fields aren't ignored
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.
If I unpack than I cannot call self.new
anymore due to partially moved value and new::New
on the core Move side is not clone-able - I am not sure how to work around it...
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.
You can do let New { name } = &self
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.
It still does not work as core Move side's New::execute
takes self
by values so we cannot borrow it in the unpack and then use it as the argument...
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.
Not blocking for nits!
…and (#3019) * [Move CLI] Updated move CLI to work with flattened pkg core Move command * Fixed linter warnings * Addressed review comments
…and (#3019) * [Move CLI] Updated move CLI to work with flattened pkg core Move command * Fixed linter warnings * Addressed review comments
This PR updates the move CLI implementation to work with recently updated (move-language/move#240) "flattened" package CLI command implementation in core Move