Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widen complex ranges for pub manager #33155

Open
rarkins opened this issue Dec 17, 2024 Discussed in #33055 · 0 comments
Open

Widen complex ranges for pub manager #33155

rarkins opened this issue Dec 17, 2024 Discussed in #33055 · 0 comments
Labels
manager:pub priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:bug Bug fix of existing functionality

Comments

@rarkins
Copy link
Collaborator

rarkins commented Dec 17, 2024

Discussed in #33055

Originally posted by davidmartos96 December 12, 2024

How are you running Renovate?

A Mend.io-hosted app

If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.

No response

Please tell us more about your question or problem

On Dart projects, when the SDK version is specified as a range, renovate uses the replace npm versioning strategy, which strips the lower bound, which Dart requires.

Reproduction: https://github.com/davidmartos96/dart_renovatebot_bug

The range sdk: ">=3.4.0 <3.6.0" turns into sdk: <3.6.1, but that will fail when resolving the dependencies with dart pub get with the following error:

Command failed: dart pub get --no-precompile
pubspec.yaml has no lower-bound SDK constraint.
You should edit pubspec.yaml to contain an SDK constraint:

environment:
  sdk: '^3.6.0'

See https://dart.dev/go/sdk-constraint

Possible solutions:

  • Use the carer syntax when in Dart and using the replace strategy
  • Change the strategy to widen when resolving the sdk version

Logs (if relevant)

Logs

  {
            "currentValue": ">=3.4.0 <3.6.0",
            "currentVersion": "3.5.4",
            "datasource": "dart-version",
            "depName": "dart",
            "homepage": "https://dart.dev/",
            "isSingleVersion": false,
            "packageName": "dart",
            "registryUrl": "https://storage.googleapis.com",
            "sourceUrl": "https://github.com/dart-lang/sdk",
            "versioning": "npm",
            "warnings": [],
            "updates": [
              {
                "bucket": "non-major",
                "newVersion": "3.6.0",
                "newValue": "<3.6.1",
                "newMajor": 3,
                "newMinor": 6,
                "newPatch": 0,
                "updateType": "minor",
                "isRange": true,
                "branchName": "renovate/dart-3.x"
              }
            ]
          }
        ],
        "packageFile": "pubspec.yaml"
      }
    ]
  }

This line of config should not be necessary: https://github.com/renovate-reproductions/33055/blob/849c93bc3ddba5fc3bc51976c2174713478863e6/renovate.json#L6

@rarkins rarkins added type:bug Bug fix of existing functionality priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others manager:pub labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
manager:pub priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:bug Bug fix of existing functionality
Projects
None yet
Development

No branches or pull requests

1 participant