-
Notifications
You must be signed in to change notification settings - Fork 71
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
use package's install-path
instead of guessing
#293
Comments
i read the discussion in #182 i still suggest to try reading those generated files, and prefer the results over a guess. in case of errors, the guess could be used anyways. |
Also re-reading the previous issue, I think even if there would be an easy way to identify the paths, it still may present a problem to distinguish the two codebases "own code" and "dependency code" if dependencies are allowed to just deploy themself into paths that are originally used by the "own code" part. Unless such a path is completely wiped before anything gets installed there, but I doubt this is the intention of this feature. Or in other words: If for example a Typo3 module is required to be installed inside the "own code" because it wouldn't work otherwise, there is no clear way for me to identify if a file that is located there is from the "own" or "dependency" part. This tool is just running on an existing directory tree, it has no knowledge of why a file is in a specific location. Still the way to run "composer install --no-plugins" for the check will work as it installs everything inside "vendor", and hopefully composer would be able to untangle any files if you switch between plugin and no-plugin install. |
i see what you mean, @SvenRtbg .
Unfortunately a setup with some background information to the setup of typo3 packages/extensions (in my case): {
// ...
"config": {
"bin-dir": ".Build/bin",
"vendor-dir": ".Build/vendor"
},
"extra": {
"typo3/cms": {
"extension-key": "pp_userpanel",
"app-dir": ".Build",
"web-dir": ".Build/Web"
}
}
// ...
} and the resulting dir tree after |
Ref: #182 (comment)
|
I suggest bringing this up with the upstream project that is using such exotic setup. |
well, it is part ob the composer's behavior to put packages in other paths than it actually is a feature of composer, to implement a custom installer that implements would be great if ComposerRequireChecker would honor this feature of composer. |
Aware: the general/safe assumption is to look at Alternatively, start work on a library that, given a |
Inspiration can be taken from here: https://github.com/Roave/BetterReflection/blob/86135105e7f6e9684efd65c688ab2c49cf240143/src/SourceLocator/Type/Composer/Factory/MakeLocatorForComposerJsonAndInstalledJson.php#L32 In practice: that massive piece of (tested) logic also doesn't support |
I do want to point once again to the readme that is explaining the workaround: https://github.com/maglnet/ComposerRequireChecker/blob/3.4.x/README.md#dealing-with-custom-installer-plugins This would be easy to implement in a CI pipeline where you'd be able to just checkout from scratch and do a different install than usual. And it would not fit into your existing workflow that is doing plenty of checks with only one installation of the repo - it is a workaround. |
current implementation tries to "guess" the path a required package was installed to.
see
ComposerRequireChecker/src/ComposerRequireChecker/FileLocator/LocateComposerPackageDirectDependenciesSourceFiles.php
Line 33 in b3cd6d3
this might be correct for the most time, but in general this "guessing" seams like a lucky shot.
ISSUE: In some cases its is just wrong -- especially when a installer-plugin was used. (some frameworks like typo3 do that).
When using composer2: the actual package install path of each required package can be found as
install_path
in file$vendorDir . '/composer/installed.json'
or$vendorDir . '/composer/installed.php'
(just as used in https://github.com/maglnet/ComposerRequireChecker/blob/master/src/ComposerRequireChecker/FileLocator/LocateComposerPackageDirectDependenciesSourceFiles.php#L57)
Example:
click to unfold an examply from my `installed.json`
The text was updated successfully, but these errors were encountered: