Skip to content

Migrate ST repositories in dev containers to official STMicroelectronics repos#3294

Merged
josesimoes merged 10 commits intomainfrom
copilot/migrate-st-repositories-to-official
Apr 8, 2026
Merged

Migrate ST repositories in dev containers to official STMicroelectronics repos#3294
josesimoes merged 10 commits intomainfrom
copilot/migrate-st-repositories-to-official

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

  • Add set -euo pipefail to git-pull-repos.sh
  • Guard all cd calls with || exit 1

- Replace nanoframework forks of STM32CubeXxx with official ST HAL driver repos
- Add cloning of ST CMSIS device repos (cmsis_device_f0/f4/f7/h7/l4)
- Add cloning of cmsis_core from STMicroelectronics
- Add STM32F0 support (needed for ST_NUCLEO64_F091RC target)
- Update git-pull-repos.sh to use official ST repos with version tags
- Update user-tools-repos.TEMPLATE.json: replace dead STM32_CUBE_PACKAGE_SOURCE
  with STM32_HAL_DRIVER_SOURCE, STM32_CMSIS_DEVICE_SOURCE, STM32_CMSIS_CORE_SOURCE
- Fix outdated comments in STM32_CubePackage.cmake
- Bump dev-container-all: v2.64 -> v2.65
- Bump dev-container-chibios: v1.39 -> v1.40

Agent-Logs-Url: https://github.com/nanoframework/nf-interpreter/sessions/ece7b810-8a2e-4079-bba4-0ae5f845852f

Co-authored-by: josesimoes <1881520+josesimoes@users.noreply.github.com>
Copilot AI changed the title [WIP] Migrate ST repositories in interpreter dev containers to official ones Migrate ST repositories in dev containers to official STMicroelectronics repos Apr 8, 2026
Copilot AI requested a review from josesimoes April 8, 2026 10:51
- Dockerfile.All.SRC: remove CMake module reference from 'WHEN CHANGING' comments
- Dockerfile.ChibiOS.SRC: remove 'WHEN CHANGING' comments (versions flow CMake -> containers)
- user-tools-repos.TEMPLATE.json: add STM32_HAL_DRIVER_SOURCE, STM32_CMSIS_DEVICE_SOURCE
  and STM32_CMSIS_CORE_SOURCE to user-tools-repos-container preset with F7 default paths

Agent-Logs-Url: https://github.com/nanoframework/nf-interpreter/sessions/195a375b-24a5-4d42-a4e2-f84770f81415

Co-authored-by: josesimoes <1881520+josesimoes@users.noreply.github.com>
Copilot AI requested a review from josesimoes April 8, 2026 11:26
Copy link
Copy Markdown
Member

@josesimoes josesimoes left a comment

Choose a reason for hiding this comment

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

LGTM

@josesimoes josesimoes marked this pull request as ready for review April 8, 2026 11:45
@josesimoes
Copy link
Copy Markdown
Member

@copilot looks like Dockerfile.ThreadX container is also using the ST repositories. Please fix that one too. Make sure to bump the respective version.

…o v1.40

- Replace nanoframework STM32Cube fork clones with individual official ST HAL
  driver repos (F4/F7/H7/L4) pinned to the same tags as STM32_CubePackage.cmake
- Add CMSIS device repos (cmsis_device_f4/f7/h7/l4) and cmsis_core
- Bump dev-container-threadx v1.39 -> v1.40

Agent-Logs-Url: https://github.com/nanoframework/nf-interpreter/sessions/c439569b-ad64-4f26-97a2-0afb7f15a0a3

Co-authored-by: josesimoes <1881520+josesimoes@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 8, 2026

@copilot looks like Dockerfile.ThreadX container is also using the ST repositories. Please fix that one too. Make sure to bump the respective version.

Fixed in fd62b44 — migrated Dockerfile.ThreadX.SRC to official STMicroelectronics repos (F4/F7/H7/L4 HAL drivers + their CMSIS device packages + cmsis_core), matching the same tags used in STM32_CubePackage.cmake. Version bumped to v1.40.

Copilot AI requested a review from josesimoes April 8, 2026 12:10
@josesimoes
Copy link
Copy Markdown
Member

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Bumped development container base images (All, ChibiOS, ThreadX).
    • Migrated STM32 support to official ST repos and split HAL/CMSIS sources into separate clones/layers.
    • Made repo fetches shallow and tag-pinned; moved ChibiOS-Contrib clone into its own step.
    • Hardened repo update script with strict failure handling and safer directory checks.
    • Replaced a single STM32 template variable with three granular STM32 path variables; updated comments.

Walkthrough

Updates devcontainer base images and migrates STM32 source fetches from nanoFramework forks to official ST HAL driver and CMSIS repositories; adjusts git pull script for shallow, tag-pinned checkouts and adds finer-grained CMake/config cache variables for STM32 package sources.

Changes

Cohort / File(s) Summary
Docker base image updates
.devcontainer/All/Dockerfile.All, .devcontainer/ChibiOS/Dockerfile.ChibiOS, .devcontainer/ThreadX/Dockerfile.ThreadX
Bumped devcontainer base image tags (All v2.64→v2.65; ChibiOS v1.39→v1.40; ThreadX v1.39→v1.40).
Docker STM32 source changes
.devcontainer/All/Dockerfile.All.SRC, .devcontainer/ChibiOS/Dockerfile.ChibiOS.SRC, .devcontainer/ThreadX/Dockerfile.ThreadX.SRC
Replaced nanoFramework STM32Cube repo clones with official ST repositories: separate stm32*xx_hal_driver and cmsis_device_/cmsis_core clones, each pinned to explicit version tags; ChibiOS-Contrib clone moved to its own RUN layer.
Repository pull script
.devcontainer/All/scripts/git-pull-repos.sh
Enabled strict shell error handling (set -euo pipefail); switched STM32 HAL/CMSIS updates to shallow git fetch --depth=1 origin tag <version> + git checkout tags/<version> per repo; added `
CMake informational comments
CMake/Modules/STM32_CubePackage.cmake
Updated comments to state STM32 HAL/CMSIS sources are retrieved from official ST repositories instead of nanoFramework forks (no logic changes).
Build config template
config/user-tools-repos.TEMPLATE.json
Replaced single STM32_CUBE_PACKAGE_SOURCE cache variable with three specific variables: STM32_HAL_DRIVER_SOURCE, STM32_CMSIS_DEVICE_SOURCE, and STM32_CMSIS_CORE_SOURCE in both local and container presets.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

Type: enhancement, Type: dependencies

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main objective of migrating ST repositories to official sources across dev containers, though it exceeds the recommended 50-character limit at 78 characters.
Description check ✅ Passed The description lists two specific technical accomplishments that align with the changeset modifications to git-pull-repos.sh and related shell script improvements.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai bot added Area: Config-and-Build Type: dependencies Pull requests that update a dependency file(s) or version labels Apr 8, 2026
Copilot AI requested a review from josesimoes April 8, 2026 12:37
@josesimoes
Copy link
Copy Markdown
Member

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai bot added Type: enhancement Type: dependencies Pull requests that update a dependency file(s) or version and removed Area: Config-and-Build Area: Dev-Containers labels Apr 8, 2026
@josesimoes josesimoes added Area: Config-and-Build Area: Dev-Containers and removed Type: enhancement Type: dependencies Pull requests that update a dependency file(s) or version labels Apr 8, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
.devcontainer/All/scripts/git-pull-repos.sh (1)

1-2: ⚠️ Potential issue | 🟡 Minor

Add a shebang to specify the shell interpreter.

The script begins with set -euo pipefail but lacks a shebang (#!/bin/bash). Without it, the script's behavior depends on whichever shell invokes it, potentially causing set -o pipefail to fail on non-Bash shells.

🔧 Proposed fix
+#!/bin/bash
 set -euo pipefail
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.devcontainer/All/scripts/git-pull-repos.sh around lines 1 - 2, Add a Bash
shebang at the very top of the script so the intended shell interpreter is
explicit: insert a line specifying "#!/usr/bin/env bash" (or "#!/bin/bash")
before the existing "set -euo pipefail" header to ensure "set -o pipefail" is
supported and the script runs under Bash consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.devcontainer/All/scripts/git-pull-repos.sh:
- Around line 39-41: The unguarded cd / should be made consistent with other
guarded directory changes: replace the bare "cd /" with a guarded change that
verifies the directory change succeeded and exits with an error message if it
fails (so the subsequent rm -rf /sources/ChibiOs and git svn clone commands
don't run on a failed cwd). Locate the "cd /" invocation in the script and wrap
it with a check that tests the cd result and logs a clear error before exiting
on failure.

---

Duplicate comments:
In @.devcontainer/All/scripts/git-pull-repos.sh:
- Around line 1-2: Add a Bash shebang at the very top of the script so the
intended shell interpreter is explicit: insert a line specifying "#!/usr/bin/env
bash" (or "#!/bin/bash") before the existing "set -euo pipefail" header to
ensure "set -o pipefail" is supported and the script runs under Bash
consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 119ef98c-503d-465e-a0fd-3e57ce64d412

📥 Commits

Reviewing files that changed from the base of the PR and between fd62b44 and c89c0a9.

📒 Files selected for processing (1)
  • .devcontainer/All/scripts/git-pull-repos.sh

@josesimoes
Copy link
Copy Markdown
Member

@copilot In @.devcontainer/All/scripts/git-pull-repos.sh:

  • Around line 1-2: Add a Bash shebang at the very top of the script so the
    intended shell interpreter is explicit: insert a line specifying "#!/usr/bin/env
    bash" (or "#!/bin/bash") before the existing "set -euo pipefail" header to
    ensure "set -o pipefail" is supported and the script runs under Bash
    consistently.

Also rebase this branch from main.

josesimoes and others added 3 commits April 8, 2026 12:53
- Add it to exclusion path for AZDO trigger.

***NO_CI***

Co-authored-by: josesimoes <1881520+josesimoes@users.noreply.github.com>
Co-authored-by: josesimoes <1881520+josesimoes@users.noreply.github.com>
Co-authored-by: josesimoes <1881520+josesimoes@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 8, 2026

@copilot In @.devcontainer/All/scripts/git-pull-repos.sh:

  • Around line 1-2: Add a Bash shebang at the very top of the script so the
    intended shell interpreter is explicit: insert a line specifying ...

Added #!/usr/bin/env bash shebang as the first line of the script in commit 11dcc19. The branch has also been rebased from main.

Copilot AI requested a review from josesimoes April 8, 2026 12:55
@josesimoes josesimoes enabled auto-merge (squash) April 8, 2026 13:06
@josesimoes josesimoes merged commit 906180f into main Apr 8, 2026
39 checks passed
@josesimoes josesimoes deleted the copilot/migrate-st-repositories-to-official branch April 8, 2026 13:21
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.

Migrate ST repositories in interpreter dev containers to official ones

2 participants