microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.27k stars 6.42k forks source link

depend-info in manifest mode #36520

Open Taha-cmd opened 9 months ago

Taha-cmd commented 9 months ago

Is your feature request related to a problem? Please describe.

I want to query the dependency graph for an entire project. The current depend-info command only works in classic mode, in which the dependencies are shown for only one port. To query the dependencies for an entire project, one would have to parse the vcpkg.json manifest and call depend-info for each port.

Proposed solution

Provide an (explicit or implicit) manifest mode for the depend-info command. Examples:

Describe alternatives you've considered

No response

Additional context

No response

jimwang118 commented 9 months ago

You can create a new folder newdir in the vcpkg/port directory, and then copy your project's vcpkg.json to the new folder. Then run the following command to get all dependencies. ./vcpkg depend-info newdir --format=tree

Taha-cmd commented 9 months ago

That worked indeed. However, this is not really appropriate for automated build processes and pipelines scenario, as it would require modifying the vcpkg installation directory.

jimwang118 commented 9 months ago

That worked indeed. However, this is not really appropriate for automated build processes and pipelines scenario, as it would require modifying the vcpkg installation directory.

Yes, this is just a temporary solution, I will try to modify to read the vcpkg.json file directly to show the dependencies.

dg0yt commented 9 months ago

As a mitigation, you can try vcpkg install --dry-run.

horenmar commented 8 months ago

I'll note two things here

bmanga commented 5 months ago

Any progress on this? I would also be interested in this functionality

sharadhr commented 5 months ago

+1. This is very useful and I hope it is implemented. It makes no sense that depend-info works for packages but not for the top-level vcpkg.json; the logic is already present and it is a matter of wiring together the appropriate command-line.

j-hap commented 4 months ago

Currently the only way to install a specific package version is via manifest mode. There is no way to define a package version on the classic command line install. There is none for depend-info either. To to see the dependencies of a specific package version, would be nice if depend-info either works with the manifest file or if there was a way to specify the package version on the command line.

jimwang118 commented 4 months ago

@BillyONeal Can vcpkg query dependent packages in manifest mode?

dg0yt commented 4 months ago

To to see the dependencies of a specific package version, would be nice if depend-info either works with the manifest file

What works is https://github.com/microsoft/vcpkg/issues/36520#issuecomment-1930449009.

jimwang118 commented 3 months ago

Use the command vcpkg install --dry-run to achieve the results you need. I will close this issue. If you have new issue, please submit a new issue.

dg0yt commented 3 months ago

Please reopen.

Samt43 commented 1 week ago

vcpkg install --dry-run does NOT permit to have parent/children relationship. This feature is needed. All good package manager permit to do this.