Skip to content

Conversation

@networkfusion
Copy link
Member

@networkfusion networkfusion commented Feb 7, 2025

Description

  • Remove deprecated Windows.Storage API.
  • Remove all files related with this API.
  • Adjust CMakes accordingly.
  • Remove assembly and project from virtual device solutions.
  • Remove vcx projects.
  • Adjusted headers.
  • Rename and migrate targets config files.
  • Remove target win.storage common headers.
  • Remove assembly from virtual device interop assemblies table.

Motivation and Context

  • Definitely dropping this long-time deprecated assembly. (replaced with System.IO.FileSystem, NXP was the last platform using it)

How Has This Been Tested?

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dev Containers (changes related with Dev Containers, has no impact on code or features)
  • Dependencies/declarations (update dependencies or assembly declarations and changes associated, has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).

Summary by CodeRabbit

  • Chores
    • Removed legacy Windows Storage support and associated configuration elements.
    • Cleaned up redundant modules, project references, and build settings.
  • Refactor
    • Standardized file system handling across platforms by consolidating SD card and file operations under a unified API.
    • Updated header and configuration inclusions to reflect the modernized storage approach.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 7, 2025

Walkthrough

The pull request removes support for the Windows.Storage API and all related components. Numerous Windows.Storage options, files, and native method stubs have been deleted. Build scripts, Visual Studio project files, and solution configurations have been updated to remove Windows.Storage references and conditionals. Header inclusions have been modified to rely solely on System.IO.FileSystem. Additionally, SD card support logic has been simplified by commenting out or disabling threading and target-specific SD card features, and several target configuration files now use updated header guards. Migration work for FATFS integration has also been introduced.

Changes

File(s) Change Summary
CMake/Modules/FindNF_NativeAssemblies.cmake, FindWindows.Storage.cmake, CMakeLists.txt, FreeRTOS_IMXRT10xx_GCC_options.cmake, CMake/Modules/FindSystem.IO.FileSystem.cmake Removed Windows.Storage API option and file locator; simplified SD card support logic; added variable (FATFS_PLATFORM) for FatFs search paths; eliminated forced compile definitions.
src/HAL/Include/nanoHAL_System_IO_FileSystem.h, nanoHAL_Windows_Storage.h Removed Windows.Storage enumerations, comments, and function declarations; shifted focus entirely to System.IO.FileSystem.
src/Windows.Storage/* (vcxproj, .filters, win_storage_native*.cpp/.h, stubs for SDCard, FileIO, StorageFile, StorageFolder, StorageProvider) Deleted all native Windows.Storage implementation files and method stubs.
targets/netcore/* (nanoCLR.sln, nanoFramework.nanoCLR.vcxproj), targets/win32/* (nanoCLR.sln, nanoCLR.vcxproj) Removed Windows.Storage project references and associated configurations from Visual Studio solutions and project files.
targets/FreeRTOS/NXP/_common/Target_Windows_Storage.c, targets/FreeRTOS/NXP/_include/Target_Windows_Storage.h, targets/TI_SimpleLink/_include/Target_Windows_Storage.h, targets/FreeRTOS/NXP/NXP_MIMXRT1060_EVK/nanoCLR/main.c, CMakePresets.json (NXP_MIMXRT1060_EVK) Commented out SD card thread creation and removed SD card management functions; updated presets to disable SD card feature; replaced target-specific Windows.Storage config with generic target_storage_config.h.
src/HAL/Include/nanoHAL_v2.h, src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_File.cpp, targets/ESP32/_common/Target_System_IO_FileSystem.c Removed inclusion of nanoHAL_Windows_Storage.h and replaced with nanoHAL_System_IO_FileSystem.h.
targets/AzureRTOS/ST/ORGPAL_PALTHREE/target_storage_config.h, targets/ChibiOS/*/target_FileSystem.cpp & target_storage_config.h, targets/ChibiOS/ST_STM32F769I_DISCOVERY/target_storage_config.h Added header guards and updated include directives to use generic target_storage_config.h instead of target_windows_storage_config.h.
targets/FreeRTOS/NXP/_FatFs/fatfs_FS_Driver.cpp, fatfs_FS_Driver.h Removed old include guard blocks and created a new header file for FATFS driver migration toward System.IO.FileSystem.
targets/AzureRTOS/_common/include/Target_Windows_Storage.h, targets/TI_SimpleLink/_include/Target_Windows_Storage.h, targets/FreeRTOS/NXP/_common/CMakeLists.txt Removed obsolete Windows.Storage header/interface files and deleted file (Target_Windows_Storage.c) managing SD card detection.

Sequence Diagram(s)

sequenceDiagram
    participant BuildSystem
    participant CMakeConfig
    participant RTOS_Logic
    BuildSystem->>CMakeConfig: Parse build configuration
    CMakeConfig-->>BuildSystem: (Old Flow) Check RTOS type → include Windows.Storage API if FreeRTOS
    BuildSystem->>RTOS_Logic: Setup SD Card support
    RTOS_Logic-->>BuildSystem: Invoke Windows.Storage-specific code
    Note over BuildSystem,RTOS_Logic: Old conditional flow
    BuildSystem->>CMakeConfig: (New Flow) Remove Windows.Storage option
    CMakeConfig-->>BuildSystem: Always include System.IO.FileSystem API
    BuildSystem->>RTOS_Logic: Setup SD Card support without Windows.Storage thread/task
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@networkfusion networkfusion changed the title Remove deprecated Windows.Storage Remove deprecated Windows.Storage API Feb 7, 2025
@networkfusion networkfusion marked this pull request as ready for review February 7, 2025 18:03
@networkfusion
Copy link
Member Author

@josesimoes , potentially another CI issue here...

- Adjust headers.
- Rename and migrate targets config files.
- Remove target win.storage common headers.
- Remove assembly from virtual device interop assemblies table.
@josesimoes
Copy link
Member

@networkfusion for some reason AZDO didn't pick up this PR... 🤷🏻‍♂️

Anyway, I've completed the migration and move the remaining Win.Storage config options still in the various targets/platforms.

@networkfusion
Copy link
Member Author

@networkfusion for some reason AZDO didn't pick up this PR... 🤷🏻‍♂️

Anyway, I've completed the migration and move the remaining Win.Storage config options still in the various targets/platforms.

I can only thing the reason for AZDO throwing a wobbly was that it started as a draft PR...

@networkfusion networkfusion force-pushed the remove-windows-storage branch from f4f1934 to 24c6554 Compare February 7, 2025 19:32
@josesimoes josesimoes force-pushed the remove-windows-storage branch from 24c6554 to 2587b44 Compare February 7, 2025 19:37
Copy link
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: 0

🧹 Nitpick comments (2)
CMake/Modules/FindSystem.IO.FileSystem.cmake (2)

11-11: Document the NXP-specific FatFs path.

While the change aligns with the migration from Windows.Storage to System.IO.FileSystem, consider adding a comment explaining why this specific NXP FatFs implementation path is used.

+    # Use NXP-specific FatFs implementation as it's the last platform using Windows.Storage
     set(FATFS_PLATFORM ${PROJECT_SOURCE_DIR}/targets/FreeRTOS/NXP/_FatFs)

11-11: Consider making the FatFs platform path more configurable.

The hardcoded NXP-specific path might limit reusability for other platforms. Consider making it configurable through a CMake option.

+    # Allow overriding the FatFs platform path through CMake option
+    if(DEFINED NF_FATFS_PLATFORM_PATH)
+        set(FATFS_PLATFORM ${NF_FATFS_PLATFORM_PATH})
+    else()
         set(FATFS_PLATFORM ${PROJECT_SOURCE_DIR}/targets/FreeRTOS/NXP/_FatFs)
+    endif()

Also applies to: 79-79

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 24c6554 and 1ae1c84.

📒 Files selected for processing (7)
  • CMake/Modules/FindSystem.IO.FileSystem.cmake (2 hunks)
  • targets/FreeRTOS/NXP/NXP_MIMXRT1060_EVK/CMakePresets.json (1 hunks)
  • targets/FreeRTOS/NXP/NXP_MIMXRT1060_EVK/nanoCLR/main.c (2 hunks)
  • targets/FreeRTOS/NXP/_FatFs/fatfs_FS_Driver.cpp (1 hunks)
  • targets/FreeRTOS/NXP/_FatFs/fatfs_FS_Driver.h (1 hunks)
  • targets/netcore/nanoCLR.sln (0 hunks)
  • targets/win32/nanoCLR.sln (0 hunks)
💤 Files with no reviewable changes (2)
  • targets/netcore/nanoCLR.sln
  • targets/win32/nanoCLR.sln
✅ Files skipped from review due to trivial changes (2)
  • targets/FreeRTOS/NXP/_FatFs/fatfs_FS_Driver.h
  • targets/FreeRTOS/NXP/_FatFs/fatfs_FS_Driver.cpp
🚧 Files skipped from review as they are similar to previous changes (2)
  • targets/FreeRTOS/NXP/NXP_MIMXRT1060_EVK/CMakePresets.json
  • targets/FreeRTOS/NXP/NXP_MIMXRT1060_EVK/nanoCLR/main.c
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: nf-interpreter (Check_Code_Style)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ST_NUCLEO64_F091RC)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALX)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALTHREE)
  • GitHub Check: nf-interpreter (Nightly build) (Check_Build_Options)
  • GitHub Check: nf-interpreter (Check_Build_Options)

@networkfusion networkfusion enabled auto-merge (squash) February 7, 2025 20:25
@networkfusion networkfusion merged commit 3aa6ab7 into main Feb 7, 2025
25 checks passed
@networkfusion networkfusion deleted the remove-windows-storage branch February 7, 2025 20:44
josesimoes pushed a commit that referenced this pull request Mar 17, 2025
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.

4 participants