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

Pana assumes that the git root is the package directory #1224

Open
tjarvstrand opened this issue May 8, 2023 · 4 comments
Open

Pana assumes that the git root is the package directory #1224

tjarvstrand opened this issue May 8, 2023 · 4 comments
Labels
type-enhancement A request for a change that isn't a bug

Comments

@tjarvstrand
Copy link

tjarvstrand commented May 8, 2023

Currently, Pana seems to assume that if there is a git root above the package directory, then that should be used as the base for the analysis. It then proceeds to copy this entire directory to a temporary location.

Unfortunately, this is very unsuitable for use in monorepo settings. Our repository contains 10's of thousands of files, totalling many gigabytes, making pana essentially unusable by default.

It's possible to work around this limitation by manually copying the package to a temporary location outside the git tree but at the moment there is no information that the copy operation is happening so I had to dig through the source to figure out what was going on.

There should be a way to override this behavior or, at the very least, something informing the user about the ongoing copying.

@isoos
Copy link
Collaborator

isoos commented May 8, 2023

Yes, that's correct, pana does copy the content by default, because we may change a few things while running the analysis, and it is not desired to have side-effects on the original code, only on the working copy.

Can you give us more info about the project layout? E.g. how the packages depend on each other (assuming path: dependencies), or can the large files excluded with some pattern?

@tjarvstrand
Copy link
Author

Yes, that's correct, pana does copy the content by default, because we may change a few things while running the analysis, and it is not desired to have side-effects on the original code, only on the working copy.

This is totally fine and understandable, but pana shouldn't automatically assume that the entire repository should be copied.

Can you give us more info about the project layout? E.g. how the packages depend on each other (assuming path: dependencies), or can the large files excluded with some pattern?

In terms of the package itself, the structure is a fairly simple Flutter plugin, with a native component. It does however live in the same Git repository as several other (non-flutter/Dart) packages and intermediate steps in the build process pull in and build large external dependencies (e.g. webRTC).

@isoos
Copy link
Collaborator

isoos commented May 8, 2023

I could imagine a flag that disables the git-root detection, effectively making a copy only on the package directory. However, when the package has any path: ../other_package dependency, the analysis will fail in such cases. wdyt @jonasfj?

@sigurdm
Copy link
Contributor

sigurdm commented Sep 21, 2023

We could try to go towards not copying the package at all.

One way would be to create a stub-package in a temp-folder with a single dependency on the analyzed package and do resolution there.

We would probably have to run pub outdated --no-dev-dependencies in the analyzed project folder.

@sigurdm sigurdm added the type-enhancement A request for a change that isn't a bug label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants