Skip to content

[Silabs] : use different markers to save user preferences and install done#71492

Open
Sarthak-Shaha wants to merge 5 commits intoproject-chip:masterfrom
Sarthak-Shaha:silabs/script_update
Open

[Silabs] : use different markers to save user preferences and install done#71492
Sarthak-Shaha wants to merge 5 commits intoproject-chip:masterfrom
Sarthak-Shaha:silabs/script_update

Conversation

@Sarthak-Shaha
Copy link
Copy Markdown
Contributor

@Sarthak-Shaha Sarthak-Shaha commented Apr 9, 2026

Summary

The install marker changes from #43611 skips the installation steps for checking new versions of SiSDK.
Updated the flow to introduce a new user consent marker
Following the flow chart
image

Related issues

Testing

Run scripts/examples/gn_silabs_example.sh

  • user consents no in the first run, not going to install anything, and will not ask for permission again, build failures
  • User says yes, installation done, next run still checks for versions, ( not asking for permissions again)

Readability checklist

The checklist below will help the reviewer finish PR review in time and keep the
code readable:

  • PR title is
    descriptive
  • Apply the
    “When in Rome…”
    rule (coding style)
  • PR size is short
  • Try to avoid "squashing" and "force-update" in commit history
  • CI time didn't increase

See: Pull Request Guidelines

@Sarthak-Shaha Sarthak-Shaha changed the title script update to isntall packages [Silabs] : use different markers to save user preferences and install done Apr 9, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the package installation logic in the Silabs example script to better handle first-time installations and Docker environments. The reviewer identified a high-severity bug where the installation logic would incorrectly execute inside Docker containers, and suggested an improvement to the readability of the variable assignment logic for INSTALL_EVERYTHING.

@Sarthak-Shaha
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Silabs package installation logic in the gn_silabs_example.sh script. It introduces a mechanism to track user opt-outs via a .do-not-install-packages file and ensures that the installation script is executed when a previous installation is detected to check for updates. Feedback was provided to correct a misleading comment that stated the installation step was skipped when, in fact, the code triggers an update check.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

PR #71492: Size comparison from 15b505f to 49a3fe4

Full report (34 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section 15b505f 49a3fe4 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1090510 1090510 0 0.0
RAM 144858 144858 0 0.0
bl616 lighting-app bl616+thread FLASH 1101988 1101988 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1588876 1588876 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1053666 1053666 0 0.0
RAM 108461 108461 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 892364 892364 0 0.0
RAM 105852 105852 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 775904 775904 0 0.0
RAM 103396 103396 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 788108 788108 0 0.0
RAM 108588 108588 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 734432 734432 0 0.0
RAM 97396 97396 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 717860 717860 0 0.0
RAM 97556 97556 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 559874 559874 0 0.0
RAM 204568 204568 0 0.0
lock CC3235SF_LAUNCHXL FLASH 592742 592742 0 0.0
RAM 204816 204816 0 0.0
efr32 lock-app BRD4187C FLASH 992512 992512 0 0.0
RAM 131268 131268 0 0.0
BRD4338a FLASH 796297 796297 0 0.0
RAM 243372 243372 0 0.0
window-app BRD4187C FLASH 1098000 1098000 0 0.0
RAM 130308 130308 0 0.0
esp32 all-clusters-app c3devkit DRAM 98460 98460 0 0.0
FLASH 1599174 1599174 0 0.0
IRAM 93514 93514 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 862232 862232 0 0.0
RAM 162094 162094 0 0.0
nxp contact mcxw71+release FLASH 739032 739032 0 0.0
RAM 67016 67016 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1711700 1711700 0 0.0
RAM 214028 214028 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1609460 1609460 0 0.0
RAM 210908 210908 0 0.0
light cy8ckit_062s2_43012 FLASH 1466876 1466876 0 0.0
RAM 197068 197068 0 0.0
lock cy8ckit_062s2_43012 FLASH 1499596 1499596 0 0.0
RAM 224820 224820 0 0.0
qpg lighting-app qpg6200+debug FLASH 842684 842684 0 0.0
RAM 127868 127868 0 0.0
lock-app qpg6200+debug FLASH 781300 781300 0 0.0
RAM 118816 118816 0 0.0
realtek light-switch-app rtl8777g FLASH 680824 680824 0 0.0
RAM 101600 101600 0 0.0
lighting-app rtl8777g FLASH 724768 724768 0 0.0
RAM 101956 101956 0 0.0
stm32 light STM32WB5MM-DK FLASH 475468 475468 0 0.0
RAM 141388 141388 0 0.0
telink bridge-app tl7218x FLASH 730906 730906 0 0.0
RAM 95924 95924 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 850332 850332 0 0.0
RAM 44340 44340 0 0.0
tl7218x FLASH 841738 841738 0 0.0
RAM 99724 99724 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 730236 730236 0 0.0
RAM 55984 55984 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 793462 793462 0 0.0
RAM 75160 75160 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 730180 730180 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 613142 613142 0 0.0
RAM 118396 118396 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 839872 839876 4 0.0
RAM 97432 97432 0 0.0

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.32%. Comparing base (60a7a1d) to head (49a3fe4).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #71492   +/-   ##
=======================================
  Coverage   54.31%   54.32%           
=======================================
  Files        1576     1576           
  Lines      108247   108247           
  Branches    13401    13400    -1     
=======================================
+ Hits        58796    58801    +5     
+ Misses      49451    49446    -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@Sarthak-Shaha
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Silabs package installation logic in the gn_silabs_example.sh script. It introduces a mechanism to track user opt-outs via a .do-not-install-packages file and ensures that the installation prompt is skipped if the user has previously declined. The installation block was also updated to prevent execution within Docker environments. A review comment suggests adding an exit condition to the pip install command to ensure the script terminates if dependency installation fails.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@Sarthak-Shaha
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the Silabs package installation logic in gn_silabs_example.sh to support update checks and persistent opt-out via a .do-not-install-packages file. Reviewers identified that the script allows users to skip 'required' packages without a fatal error, which may lead to confusing build failures later. Additionally, it was suggested to make update checks non-fatal to prevent build failures when working offline.

Comment on lines 350 to 354
[Nn]*)
echo "You won't be asked again"
touch "$CHIP_ROOT/scripts/setup/silabs/.do-not-install-packages"
break
;; # Case for no/N
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The prompt explicitly states that these packages are 'required for the build to succeed'. However, if the user chooses 'No', the script merely records the preference and continues execution. This will likely lead to confusing build failures later in the process. Consider exiting the script with an informative error message if the user refuses to install required dependencies, or at least provide a clear warning that the build is expected to fail.

Comment on lines +361 to +364
if [ "$INSTALL_EVERYTHING" == true ] && [ "$USE_DOCKER" != true ]; then # run install-packages
pip install -r "$CHIP_ROOT/integrations/docker/images/stage-2/chip-build-efr32/requirements.txt" || exit 1
python3 "$CHIP_ROOT/scripts/setup/silabs/install-packages.py" || exit 1
fi # run install-packages
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Adding || exit 1 to the update commands and running them on every execution makes the build process strictly dependent on a network connection. If a developer is offline or has network issues, the build will fail even if the SDK was previously installed correctly. Consider making these update checks non-fatal if the initial installation has already been completed (i.e., when .install-packages-done exists).

Suggested change
if [ "$INSTALL_EVERYTHING" == true ] && [ "$USE_DOCKER" != true ]; then # run install-packages
pip install -r "$CHIP_ROOT/integrations/docker/images/stage-2/chip-build-efr32/requirements.txt" || exit 1
python3 "$CHIP_ROOT/scripts/setup/silabs/install-packages.py" || exit 1
fi # run install-packages
if [ "$INSTALL_EVERYTHING" == true ] && [ "$USE_DOCKER" != true ]; then # run install-packages
if [ -f "$CHIP_ROOT/scripts/setup/silabs/.install-packages-done" ]; then
pip install -r "$CHIP_ROOT/integrations/docker/images/stage-2/chip-build-efr32/requirements.txt" || echo "Warning: Failed to check for pip updates."
python3 "$CHIP_ROOT/scripts/setup/silabs/install-packages.py" || echo "Warning: Failed to check for Silabs package updates."
else
pip install -r "$CHIP_ROOT/integrations/docker/images/stage-2/chip-build-efr32/requirements.txt" || exit 1
python3 "$CHIP_ROOT/scripts/setup/silabs/install-packages.py" || exit 1
fi
fi # run install-packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants