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

fix: remove dependency_overrides from temporary pubspec.yaml #199

Merged

Conversation

devmil
Copy link
Member

@devmil devmil commented Dec 6, 2024

Description

dart_apitool has issues with packages that contain dependency_overrides in their pubspec.yaml and are pulled from pub.
Background:
Packages from pub get downloaded to the pub cache and get copied into a temporary directory to do local adaptions and preparations.
Some packages, especially ones from a mono repository, contain dependency overrides that point to relative paths. Those paths are not valid if you look at this package in isolation and pub get run on that package copy fails as it is not able to resolve those relative path overrides.
To avoid this situation dart_apitool now removed dependency overrides on that local copy (to use the variant of dependencies that would be used transitively anyways)

Type of Change

  • 🚀 New feature (non-breaking change)
  • 🛠️ Bug fix (non-breaking change)
  • ⚠️ Breaking change (feature or bug fix which breaks existing behaviors/APIs)
  • 🏗️ Code refactor
  • ⚙️ Build configuration change
  • 📝 Documentation
  • 🧹 Chore / Housekeeping

Fixes #198

@devmil devmil enabled auto-merge (squash) December 6, 2024 22:48
if (pubspecFile.existsSync()) {
try {
final pubSpec = PubSpec.load(directory: packagePath);
// removeAll of dependencyOverrides has an issue in the current version of pubspec_manager
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// removeAll of dependencyOverrides has an issue in the current version of pubspec_manager
// removeAll of dependencyOverrides, there's an issue in the current version of pubspec_manager

try {
final pubSpec = PubSpec.load(directory: packagePath);
// removeAll of dependencyOverrides has an issue in the current version of pubspec_manager
// as it doesn't remove the section part of the dependency overrides and therefore are not removed
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// as it doesn't remove the section part of the dependency overrides and therefore are not removed
// as it doesn't remove the section part of the dependency overrides and therefore it is not removed

@devmil devmil merged commit 123049d into bmw-tech:main Dec 9, 2024
11 checks passed
@devmil devmil deleted the fix/handle_dependency_overrides_in_pub_packages branch December 9, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Relative paths seem to not be supported
2 participants