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

[Move CLI] Updated move CLI to work with flattened pkg core Move command #3019

Merged
merged 3 commits into from
Jul 7, 2022

Conversation

awelc
Copy link
Contributor

@awelc awelc commented Jul 6, 2022

This PR updates the move CLI implementation to work with recently updated (move-language/move#240) "flattened" package CLI command implementation in core Move

@awelc awelc requested a review from tnowacki July 6, 2022 21:59
crates/sui/src/sui_move/build.rs Outdated Show resolved Hide resolved
unit_test_config,
compute_coverage,
)?;
let result = c.execute(package_path, build_config, unit_test_config)?;
Copy link
Contributor

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

Copy link
Contributor Author

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(),
    )

crates/sui/src/sui_move/new.rs Outdated Show resolved Hide resolved

impl New {
pub fn execute(self, path: Option<PathBuf>) -> anyhow::Result<()> {
let name = &self.new.name.to_lowercase();
Copy link
Contributor

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

Copy link
Contributor Author

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...

Copy link
Contributor

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

Copy link
Contributor Author

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...

Copy link
Contributor

@tnowacki tnowacki left a 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!

@awelc awelc merged commit f12bd32 into main Jul 7, 2022
@awelc awelc deleted the aw/sui-move-with-flattened branch July 7, 2022 00:31
punwai pushed a commit that referenced this pull request Jul 16, 2022
…and (#3019)

* [Move CLI] Updated move CLI to work with flattened pkg core Move command

* Fixed linter warnings

* Addressed review comments
punwai pushed a commit that referenced this pull request Jul 27, 2022
…and (#3019)

* [Move CLI] Updated move CLI to work with flattened pkg core Move command

* Fixed linter warnings

* Addressed review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants