Add docs on bumping Dart#187540
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new documentation file, Bumping-the-Dart-SDK-version.md, which outlines the process, policy, and instructions for bumping the minimum Dart SDK version constraint across the repository. Additionally, docs/infra/README.md is updated to include links to this new document and other related guides. The review feedback suggests replacing a platform-specific sed command in the documentation with a portable perl command to ensure compatibility across both macOS and Linux environments.
| # Example using find and sed to bump from ^3.10.0-0 to ^3.13.0-0 | ||
| find . -name "pubspec.yaml" -not -path "*/.dart_tool/*" -exec sed -i '' 's/sdk: \^3.10.0-0/sdk: \^3.13.0-0/g' {} + |
There was a problem hiding this comment.
The sed -i '' command is platform-specific and only works on macOS (BSD sed). On Linux (GNU sed), this command will fail because it interprets '' as an input file. Using perl -pi -e is a highly portable alternative that works identically on both macOS and Linux.
Additionally, the caret (^) does not need to be escaped in the replacement portion of the s/pattern/replacement/ command, as it has no special meaning there. Escaping it can lead to an unwanted literal backslash being written to the files.
| # Example using find and sed to bump from ^3.10.0-0 to ^3.13.0-0 | |
| find . -name "pubspec.yaml" -not -path "*/.dart_tool/*" -exec sed -i '' 's/sdk: \^3.10.0-0/sdk: \^3.13.0-0/g' {} + | |
| # Example using find and perl to bump from ^3.10.0-0 to ^3.13.0-0 | |
| find . -name "pubspec.yaml" -not -path "*/.dart_tool/*" -exec perl -pi -e 's/sdk: \^3.10.0-0/sdk: ^3.13.0-0/g' {} + |
Adds documentation on how we should update the Dart SDK in flutter/flutter.
I have also wrapped this process up in a skill, but in following the instructions for adding skills to the repo, I want to test it out first. I'll be bumping Dart next to take it for a test drive. 😎
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.