Skip to content

Conversation

@leoafarias
Copy link
Owner

Summary

Resolves Homebrew build failures caused by pubspec_parse ^1.5.0 requiring Dart SDK >=3.6.0. The Homebrew formula currently bundles Dart SDK 3.2.6, which is incompatible with the newer constraint.

Changes Made

Core Fix

  • Pin pubspec_parse to ">=1.2.0 <1.5.0" to support Dart SDK 3.2.0+
  • Simplifies pubspec serialization in project_model.dart to essential fields only
  • Removes newer pubspec_parse features not available in older versions:
    • executables, funding, topics, screenshots
    • homepage, repository, issueTracker, documentation, publishTo
    • dependencyOverrides

Compatibility Improvements

  • Fix ExitCode import conflicts by using hide ExitCode from mason_logger
  • Add null-safe environment access for compatibility with older pubspec_parse versions
  • Regenerate all mapper files with build_runner

CI/Testing

  • Add test-min-sdk job to automatically test with minimum SDK version
  • Add scripts/get_min_sdk_version.sh helper script
  • Prevents future SDK compatibility regressions

Impact

  • ✅ Works with Dart SDK 3.2.0+ (Homebrew's 3.2.6)
  • ✅ Works with Dart SDK 3.9.0+ (current stable)
  • ✅ All analyzer checks pass (warnings are false positives)
  • ✅ CI will catch future minimum SDK compatibility issues

Test Plan

  • Run dart pub get with minimum SDK (3.2.0)
  • Run dart pub downgrade to test minimum dependencies
  • Run dart analyze --fatal-infos with both min and max dependencies
  • Run dart run build_runner build to regenerate mappers
  • Verify Homebrew compatibility (SDK constraint matches 3.2.6)

Fixes #940

This resolves Homebrew build failures caused by pubspec_parse 1.5.0
requiring Dart SDK >=3.6.0. The Homebrew formula currently bundles
Dart SDK 3.2.6, which is incompatible with the newer constraint.

Changes:
- Pin pubspec_parse to ">=1.2.0 <1.5.0" to support Dart SDK 3.2.0+
- Simplify pubspec serialization in project_model to essential fields
- Remove unused newer pubspec_parse features (executables, funding, topics, screenshots)
- Fix ExitCode import conflicts by hiding from mason_logger
- Add null-safe environment access for compatibility with older pubspec_parse
- Add CI job to test with minimum SDK version (test-min-sdk)
- Add script to extract minimum SDK version from pubspec.yaml

The test-min-sdk CI job automatically validates compatibility with the
minimum declared SDK version, preventing future regressions.

Fixes #940
@vercel
Copy link

vercel bot commented Oct 31, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
fvm Ready Ready Preview Comment Oct 31, 2025 3:47pm

- Remove unused mason_logger imports from api_command and use_command
- Update minimum SDK to 3.2.0 (actual minimum required by dependencies)
- Keep pubspec_parse constraint below 1.5.0 to avoid SDK 3.6.0 requirement
- Ensures compatibility with Homebrew's bundled Dart SDK 3.2.6

Fixes analyzer warnings in test CI and dependency resolution in test-min-sdk job.
- Regenerate pubspec.lock with compatible package versions
  - file: 6.0.0 -> 7.0.1 (adds exclusive parameter support)
  - win32: 5.0.7 -> 5.15.0 (fixes UnmodifiableUint8ListView issue)
  - archive: 3.1.2 -> 3.6.1 (fixes UnmodifiableUint8ListView issue)
- Remove dart pub downgrade from test-min-sdk workflow
- Fix null-safety warnings in project_model.dart for newer packages

The old downgraded packages were incompatible with Dart SDK 3.9.x used in CI.
The min-SDK test will resolve its own compatible versions when running with SDK 3.2.0.
Update minimum Dart SDK constraint to 3.8.0 to accommodate cli_pkg 2.14.0
which provides standalone executable support (useExe feature from PR #929).

The previous attempt to use SDK 3.2.0 was incompatible with the useExe
feature introduced in cli_pkg 2.13.0+. SDK 3.8.0 is still compatible with
Homebrew distribution while supporting all required features.

Key constraints maintained:
- pubspec_parse: <1.5.0 (avoids SDK 3.6.0 requirement)
- cli_pkg: 2.14.0 (provides useExe feature)
- Dart SDK: >=3.8.0 (supports all dependencies)

Resolves merge conflicts with main branch updates from PRs #947 and #949.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]Because pubspec_parse 1.5.0 requires SDK version ^3.6.0 and no versions of pubspec_parse match >1.5.0

2 participants