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

v2.0.0 includes unnecessary files #1423

Closed
takaram opened this issue Jun 13, 2024 · 1 comment
Closed

v2.0.0 includes unnecessary files #1423

takaram opened this issue Jun 13, 2024 · 1 comment
Labels

Comments

@takaram
Copy link

takaram commented Jun 13, 2024

When I install deptrac 2.0.0 with composer, I get both phar-compiled sources and original src, vendor directories.
Therefore the package size is unnecessarily large.

$ tree -L 2 vendor/qossmic/deptrac
vendor/qossmic/deptrac
├── CHANGELOG.md
├── LICENCE.md
├── README.md
├── bin
│   └── deptrac
├── bootstrap.php
├── composer.json
├── config
│   ├── cache.php
│   ├── deptrac_template.yaml
│   └── services.php
├── deptrac.phar
├── deptrac.phar.asc
├── docs
│   ├── CODE_OF_CONDUCT.md
│   ├── CONTRIBUTING.md
│   ├── SECURITY.md
│   ├── bc_policy.md
│   ├── blog
│   ├── blog.md
│   ├── collectors.md
│   ├── concepts.md
│   ├── configuration.md
│   ├── debugging.md
│   ├── deptrac.png
│   ├── examples
│   ├── extending_deptrac.md
│   ├── formatters.md
│   ├── index.md
│   ├── qossmic.png
│   └── upgrade.md
├── mkdocs.yml
├── src
│   ├── Contract
│   ├── Core
│   └── Supportive
└── vendor
    ├── autoload.php
    ├── composer
    ├── doctrine
    ├── jetbrains
    ├── nikic
    ├── phpdocumentor
    ├── phpstan
    ├── psr
    ├── scoper-autoload.php
    └── symfony

I believe Deptrac v2 tries to distribute the app as a phar file, like PHPStan.

Running vendor/bin/deptrac loads the classes from the directories and does not use the phar at all. This causes #1421.

Even running vendor/bin/deptrac.phar does not use phar-compiled classes when working directory is the package root (where vendor directory locates).
When you cd into another directory, then deptrac.phar loads classes from the phar (thus the result of deptrac.phar --version differs).
This is because deptrac tries to load $PWD/vendor/autoload.php ( https://github.com/qossmic/deptrac-src/blob/72caeb512cfccdbb334f555ec14ba04d1376a294/bin/deptrac#L19-L21 )

@gennadigennadigennadi
Copy link
Member

gennadigennadigennadi commented Jun 13, 2024

I believe Deptrac v2 tries to distribute the app as a phar file, like PHPStan.

v2 has a phar and a plain php version of Deptrac.

deptrac.phar --version

Shows a wrong version because of the changed packaging process. The Deptrac-src repo is missing most recent tags. We use box to build the phar and it substitutes the version string based on a tag, which the src repo is not providing at the time the phar gets build.

But you are right, there is stuff that’s accidentally committed. E.g. some tmp zip files from the building process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants