-
Notifications
You must be signed in to change notification settings - Fork 6.9k
depend-info in manifest mode #36520
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
Comments
You can create a new folder |
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. |
As a mitigation, you can try |
I'll note two things here
|
Any progress on this? I would also be interested in this functionality |
+1. This is very useful and I hope it is implemented. It makes no sense that |
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. |
@BillyONeal Can vcpkg query dependent packages in manifest mode? |
What works is #36520 (comment). |
Use the command |
Please reopen. |
vcpkg install --dry-run does NOT permit to have parent/children relationship. This feature is needed. |
Adding my vote for this |
Want this. |
With the help of The following is in the order of ugliest to least ugly 😉 ... Replace the Windows CmdIn do a for /f "tokens=*" %a in ('jq -r "if .dependencies then [ .dependencies[] | if type==""string"" then . else ( .name + ( if ((.features // []) | length) > 0 then (""["" + (((.features // []) | join("",""))) + ""]"") else """" end ) ) end ] | join("" "") else empty end" vcpkg.json') do \path\to\vcpkg depend-info --overlay-ports YOUR-VCPKG-OVERLAY-PORTS --vcpkg-root YOUR-VCPKG-ROOT --format tree %a You need to make it Windows PowershellUsing \path\to\vcpkg depend-info --overlay-ports YOUR-VCPKG-OVERLAY-PORTS --vcpkg-root YOUR-VCPKG-ROOT --format tree $(-split $(jq -r "if .dependencies then [ .dependencies[] | if type==\`"string\`" then . else ( .name + ( if ((.features // []) | length) > 0 then (\`"[\`" + (((.features // []) | join(\`",\`"))) + \`"]\`") else \`"\`" end ) ) end ] | join(\`" \`") else empty end" vcpkg.json)) Powershell's subexpressions produce one parameter so the or as @sharadhr pointed out, no \path\to\vcpkg depend-info --overlay-ports YOUR-VCPKG-OVERLAY-PORTS --vcpkg-root YOUR-VCPKG-ROOT --format tree $(Get-Content -Raw vcpkg.json | ConvertFrom-Json | ForEach-Object { @($_.dependencies) | ForEach-Object { switch ($_) { { $_ -is [string] } { $_ } { $_.features -and $_.features.Count -gt 0 } { "$($_.name)[$($_.features -join ',')]" } default { $_.name } } } }) Linux BashYou get /path/to/vcpkg depend-info --overlay-ports YOUR-VCPKG-OVERLAY-PORTS --vcpkg-root YOUR-VCPKG-ROOT --format tree $(jq -r 'if .dependencies then [ .dependencies[] | if type=="string" then . else ( .name + ( if ((.features // []) | length) > 0 then ("[" + (((.features // []) | join(","))) + "]") else "" end ) ) end ] | join(" ") else empty end' vcpkg.json) |
On Windows, no need for a batch file or Get-Content -Raw vcpkg.json | ConvertFrom-Json | ForEach-Object {
@($_.dependencies) | ForEach-Object {
switch ($_) {
{ $_ -is [string] } { $_ }
{ $_.features -and $_.features.Count -gt 0 } { "$($_.name)[$($_.features -join ',')]" }
default { $_.name }
}
}
} |
Here's some updated jq snafu to take a vcpkg file and flatten it into a one liner for custom vcpkg invocations:
|
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 thevcpkg.json
manifest and calldepend-info
for each port.Proposed solution
Provide an (explicit or implicit) manifest mode for the
depend-info
command.Examples:
vcpkg depend-info
<- search for vcpkg.json in current directoryvcpkg depend-info vcpkg.json
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: