project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.21k stars 1.91k forks source link

source bootstrap.sh cloning unnecessary submodules #21520

Closed shubhamdp closed 1 year ago

shubhamdp commented 1 year ago

Problem

dhrishi commented 1 year ago

@mspang Can you please help?

Damian-Nordic commented 1 year ago

I guess bootstrap.sh could simply call git submodule update (without --init) if third_party/pigweed/repo/pw_env_setup/util.sh already exists. That way it would preserve the user's choice on which submodules should be fetched.

shubhamdp commented 1 year ago

@Damian-Nordic This would be happening in CI as well right?

Damian-Nordic commented 1 year ago

CI uses activate.sh which doesn't do any submodule update if the mentioned util.sh file exists:

    if [ "$_BOOTSTRAP_NAME" = "bootstrap.sh" ] ||
        [ ! -f "$_CHIP_ROOT/third_party/pigweed/repo/pw_env_setup/util.sh" ]; then
        git submodule update --init
    fi
shubhamdp commented 1 year ago

Got it, Shall I put up a PR to remove --init?

Damian-Nordic commented 1 year ago

If @mspang is OK with that, I don't have any objections :).

Damian-Nordic commented 1 year ago

Note --init is needed if [ ! -f "$_CHIP_ROOT/third_party/pigweed/repo/pw_env_setup/util.sh" ]. Alternatively, we could simply edit this line to:

git submodule update --init third_party/pigweed/repo

to only update the submodule that bootstrap depends on.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Damian-Nordic commented 1 year ago

This is already resolved by https://github.com/project-chip/connectedhomeip/pull/24383