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

Pub Workspace: only require paths at workspace level? #4318

Closed
jtmcdole opened this issue Jun 25, 2024 · 4 comments
Closed

Pub Workspace: only require paths at workspace level? #4318

jtmcdole opened this issue Jun 25, 2024 · 4 comments
Labels
type-question A question about expected behavior or functionality

Comments

@jtmcdole
Copy link

In flutter/engine/pull/53539, you see in sub-workspace yaml files we have to specify the paths: flutter/engine/tools/engine_tool/pubspec.yaml:

  • litetest and process_fakes both have relative paths.
  • but they are both listed at the root workspace.

To make the sub-workspace yaml files more concise (and easier to maintain), can we leave the path: out of the sub files?

@sigurdm
Copy link
Contributor

sigurdm commented Jun 27, 2024

It is a bit unclear what you are trying.

But perhaps you can leave the path out from the sub-package, and only define it in a dependency_override in the root.

@sigurdm sigurdm added the type-question A question about expected behavior or functionality label Jun 27, 2024
@matanlurey
Copy link
Contributor

The idea we had was:

# root/pubspec.yaml
dependencies:
  repo_private_dependency:
    path: tools/pkg/repo_private_dependency

# root/tools/pkg/some_other_dep/pubspec.yaml
dependencies:
  repo_private_dependency:

That doesn't work, because repo_private_dependency is not found on pub.dev.

@sigurdm
Copy link
Contributor

sigurdm commented Jun 30, 2024

Try

# root/pubspec.yaml
dependency_overrides:
  repo_private_dependency:
    path: tools/pkg/repo_private_dependency

# root/tools/pkg/some_other_dep/pubspec.yaml
dependencies:
  repo_private_dependency:

@jtmcdole
Copy link
Author

jtmcdole commented Jul 1, 2024

Try

# root/pubspec.yaml
dependency_overrides:
  repo_private_dependency:
    path: tools/pkg/repo_private_dependency

# root/tools/pkg/some_other_dep/pubspec.yaml
dependencies:
  repo_private_dependency:

If I check out the linked PR; move litetest to dependency_overrides at the workspace level and remove the path from the sub-project, it appears to work.

@jtmcdole jtmcdole closed this as completed Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-question A question about expected behavior or functionality
Projects
None yet
Development

No branches or pull requests

3 participants