microsoft / vcpkg

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

'vcpkg upgrade ffmpeg' command always fails asking for vcpkg.json. #40695

Closed sohrab-niche closed 1 day ago

sohrab-niche commented 2 months ago

Describe the bug A clear and concise description of what the bug is. 'vcpkg upgrade ffmpeg' command always fails asking for vcpkg.json. Prior to this i had tried to update the entire vcpkg but some downloads failed as the internet connection was lost.

Environment

To Reproduce Steps to reproduce the behavior:

  1. Run: 'vcpkg install ffmpeg'
  2. It gives the following error: D:\vcpkg>vcpkg upgrade ffmpeg error: Could not locate a manifest (vcpkg.json) above the current working directory. This vcpkg distribution does not have a classic mode instance.

Expected behavior 'vcpkg upgrade ffmpeg' should not complain about vcpkg.json as I want to use classic mode.

Failure logs D:\vcpkg>vcpkg upgrade ffmpeg error: Could not locate a manifest (vcpkg.json) above the current working directory. This vcpkg distribution does not have a classic mode instance.

Additional context N.A.

greenozon commented 2 months ago

have you tried to refresh your local repo?

git pull
bootstrap-vcpkg.bat
vcpkg update
vcpkg upgrade

and try again? I do not see the above issue..

dg0yt commented 2 months ago

As long as you type vcpkg, it will run the executable found in PATH. When this is the one from VS which "does not have a classic mode instance", it will not support upgade.

To run a local command from a directory which is a git checkout of the vcpkg repo, you can prepend .\:

.\bootstrap-vcpkg.bat
.\vcpkg upgrade
JonLiu1993 commented 2 months ago

Use the user's suggestion above to update your vcpkg and try again. I didn't encounter this problem locally.

sohrab-niche commented 2 months ago

Thanks for the prompt responses. Since then I've tried several things and the issue has now changed. One related thing i noticed, sometimes vcpkg starts to imagine that it is in manifest mode. Reopening the terminal seems to bring it to its senses. Not sure whether this issue should be closed accordingly?

Anyway here are the latest 2 issues that I am facing: Firstly vcpkg upgrade ffmpeg now says that the package is up to date. However vcpkg list shows me ffmpeg:x64-windows 6.1.1#7 but if I look at D:\vcpkg\ports\ffmpeg\vcpkg.json it contains "version": "7.0.2".

Secondly the command vcpkg install ffmpeg --editable does not build the changed code; instead it simply says that ffmpeg:x64-windows is already installed.

Appreciate any help you can provide to ensure I'm on the latest stable release of ffmpeg and able to quickly build the changed code locally, and then install the changed binaries.

greenozon commented 2 months ago

I"d suggest to vcpkg remove ffmpeg and then install again and check it is using ver 7.0.2

sohrab-niche commented 2 months ago

I have tried this. But it remained at 6.something.

For the next few days or so, I have decided to temporarily not use vcpkg, while I try to hunt down a potential memory leak in ffmpeg. Hence there may be some delay in my response.

sohrab-niche commented 2 months ago

After some debugging, I found a memory leak probably in own code, and applied a workaround (or fix).

However I see a huge number of memory leaks in ffmpeg v6.1.1#7

The command vcpkg install ffmpeg --head --editable also fails.

I know that the master branch does not show these memory leaks, when I build and use the master branch without vcpkg.

Now I would ideally like to integrate and test with vcpkg v7.0.2 or using --head in classic mode.

Please help.

JonLiu1993 commented 2 months ago

@sohrab-niche, Sorry, we do not maintain the historical version of the ffmpeg. The latest vcpkg version is 7.0.2.

sohrab-niche commented 2 months ago

@JonLiu1993 Thanks for clarification that the intended latest vcpkg version of ffmpeg is 7.0.2.

But none of the commands given by anyone in this issue, work for me. I remain stuck on the old version. I wish to use classic mode only.

Please suggest: how can I debug in my local vcpkg folder, that why it is unable to upgrade to 7.0.2? Is there some vcpkg doctor kind of diagnostic utility available, that can detect any kind of corruption that may be present in my vcpkg folder?

I do not wish to reinstall the entire vcpkg folder again, because that would mean a lot of time and download bandwidth.

JonLiu1993 commented 2 months ago

Please suggest: how can I debug in my local vcpkg folder, that why it is unable to upgrade to 7.0.2?

First delete the cache you downloaded previously with ffmpeg, then run the command ./vcpkg install ffmpeg --debug --editable, this will print out the detailed build process.

I do not wish to reinstall the entire vcpkg folder again, because that would mean a lot of time and download bandwidth.

You can manually update ffmpeg by copying the files in the ffmpeg folder to your ports/ffmpeg on the latest vcpkg and then try to install the port.

JonLiu1993 commented 2 months ago
  1. ./vcpkg remove ffmpeg
  2. ./vcpkg install angelscript[*] --binarysource=clear --debug --editable
sohrab-niche commented 2 months ago

Here's what I already used before I saw your latest message. Created file manuallyCleanFfmpeg.sh and ran it in my base folder d:\vcpkg:

find . -name '*ffmpeg*' | while read -r file; do
  if [ "$(basename "$file")" = "manuallyCleanFfmpeg.sh" ]; then
    echo "Skipping $file"
    continue
  fi

  if ! git ls-files --error-unmatch "$file" > /dev/null 2>&1; then
    if [ -d "$file" ]; then
      rm -r "$file" && echo "Deleted directory: $file"
    else
      rm "$file" && echo "Deleted file: $file"
    fi
  else
    echo "$file is under version control"
  fi
done

Then from windows command prompt (cmd.exe) I ran:

D:\vcpkg>vcpkg install ffmpeg --debug --editable

..but here is the partial log while its still building:

D:\vcpkg>vcpkg install ffmpeg --debug --editable
[DEBUG] To include the environment variables in debug output, pass --debug-env
[DEBUG] Disabling metrics because vcpkg.disable-metrics exists
[DEBUG] Trying to load bundleconfig from D:\vcpkg\vcpkg-bundle.json
[DEBUG] Failed to open: D:\vcpkg\vcpkg-bundle.json
[DEBUG] Bundle config: readonly=false, usegitregistry=false, embeddedsha=nullopt, deployment=Git, vsversion=nullopt
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] Feature flag 'dependencygraph' unset
[DEBUG] Using scripts-root: D:\vcpkg\scripts
[DEBUG] Using builtin-ports: D:\vcpkg\ports
[DEBUG] Using installed-root: D:\vcpkg\installed
[DEBUG] Using buildtrees-root: D:\vcpkg\buildtrees
[DEBUG] Using packages-root: D:\vcpkg\packages
[DEBUG] Using vcpkg-root: D:\vcpkg
[DEBUG] Using builtin-registry: D:\vcpkg\versions
[DEBUG] Using downloads-root: D:\vcpkg\downloads
[DEBUG] External asset downloads are allowed (x-block-origin is disabled)...
[DEBUG] Asset cache is not configured.
[DEBUG] Detecting host with IsWow64Process2
[DEBUG] Detecting host with IsWow64Process2
Computing installation plan...
[DEBUG] Found path: D:\programs\git\bin\git.exe
[DEBUG] Found path: d:\Programs\Git\cmd\git.exe
[DEBUG] Found path: d:\Programs\Git\mingw64\bin\git.exe
[DEBUG] 1000: CreateProcessW("D:\programs\git\bin\git.exe" --version)
[DEBUG] 1000: cmd_execute_and_stream_data() returned 0 after    34153 us
[DEBUG] 1001: CreateProcessW("D:\programs\git\bin\git.exe" "--git-dir=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false show 6f1ddd6b6878e7e66fcc35c65ba1d8feec2e01f8:versions/baseline.json)
[DEBUG] 1001: cmd_execute_and_stream_data() returned 0 after    45367 us
[DEBUG] 1002: CreateProcessW("D:\programs\git\bin\git.exe" "--git-dir=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false rev-parse 0f88ecb8528605f91980b90a2c5bad88e3cb565f:versions)
[DEBUG] 1002: cmd_execute_and_stream_data() returned 128 after    33623 us
Fetching registry information from https://github.com/microsoft/vcpkg (HEAD)...
[DEBUG] 1003: CreateProcessW("D:\programs\git\bin\git.exe" "--git-dir=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false init)
[DEBUG] 1003: cmd_execute_and_stream_data() returned 0 after    38743 us
[DEBUG] 1004: CreateProcessW("D:\programs\git\bin\git.exe" "--git-dir=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false fetch --update-shallow -- https://github.com/microsoft/vcpkg HEAD)
[DEBUG] 1004: cmd_execute_and_stream_data() returned 0 after 58148346 us
[DEBUG] 1005: CreateProcessW("D:\programs\git\bin\git.exe" "--git-dir=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false rev-parse FETCH_HEAD)
[DEBUG] 1005: cmd_execute_and_stream_data() returned 0 after    37924 us
[DEBUG] 1006: CreateProcessW("D:\programs\git\bin\git.exe" "--git-dir=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false rev-parse 0f88ecb8528605f91980b90a2c5bad88e3cb565f:versions)
[DEBUG] 1006: cmd_execute_and_stream_data() returned 0 after    35407 us
[DEBUG] 1007: CreateProcessW("D:\programs\git\bin\git.exe" "--git-dir=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git-trees\6495b1018c4b288d9a1c5bf8dae6741d9bb2e50d_18232.tmp" -c core.autocrlf=false read-tree -m -u 6495b1018c4b288d9a1c5bf8dae6741d9bb2e50d)
[DEBUG] 1007: cmd_execute_and_stream_data() returned 0 after  1005736 us
[DEBUG] Loading dep info for: vcpkg-pkgconfig-get-modules:x64-windows
[DEBUG] Found path: D:\programs\mingw64\bin\cmake.exe
[DEBUG] Found path: C:\Strawberry\c\bin\cmake.exe
[DEBUG] 1008: CreateProcessW("D:\programs\mingw64\bin\cmake.exe" --version)
[DEBUG] 1008: cmd_execute_and_stream_data() returned 0 after  3281335 us
[DEBUG] 1009: CreateProcessW("C:\Strawberry\c\bin\cmake.exe" --version)
[DEBUG] 1009: cmd_execute_and_stream_data() returned 0 after   660484 us
[DEBUG] 1010: CreateProcessW("C:\Strawberry\c\bin\cmake.exe" -DVCPKG_ROOT_DIR=D:/vcpkg -DPACKAGES_DIR=D:/vcpkg/packages -DBUILDTREES_DIR=D:/vcpkg/buildtrees -D_VCPKG_INSTALLED_DIR=D:/vcpkg/installed -DDOWNLOADS=D:/vcpkg/downloads -DVCPKG_MANIFEST_INSTALL=OFF -P "D:\vcpkg\buildtrees\0.vcpkg_dep_info.cmake")
[DEBUG] 1010: cmd_execute_and_stream_data() returned 0 after    35229 us
[DEBUG] 1011: CreateProcessW("C:\Strawberry\c\bin\cmake.exe" -DVCPKG_ROOT_DIR=D:/vcpkg -DPACKAGES_DIR=D:/vcpkg/packages -DBUILDTREES_DIR=D:/vcpkg/buildtrees -D_VCPKG_INSTALLED_DIR=D:/vcpkg/installed -DDOWNLOADS=D:/vcpkg/downloads -DVCPKG_MANIFEST_INSTALL=OFF -P "D:\vcpkg\buildtrees\0.vcpkg_tags.cmake")
[DEBUG] 1011: cmd_execute_and_stream_data() returned 0 after    44084 us
The following packages will be built and installed:
    ffmpeg[avcodec,avdevice,avfilter,avformat,core,swresample,swscale]:x64-windows@6.1.1#7 -- C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git-trees\43a794215eb84acb9f6e49f2aee3a3ee1ac1af92

As you can see its still stuck on 6.1.1 for me! Do I need to manually clean anything in C:\Users\SOHRAB\AppData\Local\vcpkg? If yes, then please suggest that what I should clean...

greenozon commented 2 months ago

from your detailed logs it is visible that you have at least 2 different cmake.exe binaries (external ones) I also tried in the past to use external cmake binaries, but I hit very strange errors, so I made a decition to use the only one packaged by vcpkg itself - cmake-3.29.2-windows

also, what do yo have in the file over here .\vcpkg\ports\ffmpeg\vcpkg.json

sohrab-niche commented 2 months ago

I've disabled the cmake binaries from the locations that I have. I am trying to install cmake via vcpkg, but I get the following error:

D:\vcpkg>vcpkg install cmake
Computing installation plan...
error: while looking for cmake:x64-windows:
error: the baseline does not contain an entry for port cmake

Also for the vcpkg.json question:

D:\vcpkg>git ls-files --error-unmatch ports\ffmpeg\vcpkg.json
ports/ffmpeg/vcpkg.json

D:\vcpkg>git status
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        manuallyCleanFfmpeg.sh

D:\vcpkg>cat ports\ffmpeg\vcpkg.json
{
  "name": "ffmpeg",
  "version": "7.0.2",
  "port-version": 3,
  "description": [
    "a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.",
    "FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations."
  ],
  "homepage": "https://ffmpeg.org",
  "license": null,
  "dependencies": [
    {
      "name": "vcpkg-cmake-get-vars",
      "host": true
    },
    {
      "name": "vcpkg-pkgconfig-get-modules",
      "host": true
    }
  ],
  "default-features": [
    "avcodec",
    "avdevice",
    "avfilter",
    "avformat",
    "swresample",
    "swscale"
  ],
  "features": {
    "all": {
      "description": "Build with all allowed dependencies selected that are compatible with the lgpl license",
      "dependencies": [
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "sdl2"
          ]
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "aom",
            "avcodec",
            "avdevice",
            "avfilter",
            "avformat",
            "bzip2",
            "freetype",
            "iconv",
            "lzma",
            "mp3lame",
            "openjpeg",
            "openmpt",
            "opus",
            "snappy",
            "soxr",
            "speex",
            "swresample",
            "swscale",
            "theora",
            "vorbis",
            "vpx",
            "webp",
            "xml2",
            "zlib"
          ]
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "alsa"
          ],
          "platform": "linux"
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "ass"
          ],
          "platform": "!uwp"
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "fontconfig"
          ],
          "platform": "!uwp"
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "fribidi"
          ],
          "platform": "!uwp"
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "modplug"
          ],
          "platform": "!uwp"
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "openh264"
          ],
          "platform": "!uwp"
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "srt"
          ],
          "platform": "!uwp"
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "ilbc"
          ],
          "platform": "!(arm & uwp)"
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "ssh"
          ],
          "platform": "!(uwp | arm)"
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "amf"
          ],
          "platform": "!osx & !uwp"
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "opencl"
          ],
          "platform": "!uwp & !osx"
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "opengl"
          ],
          "platform": "!uwp & !(arm64 & windows)"
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "tensorflow"
          ],
          "platform": "x64 & !static & !uwp & !windows"
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "dav1d"
          ],
          "platform": "!(uwp | (windows & x86 & !static))"
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "tesseract"
          ],
          "platform": "!(windows & arm) & !static & !uwp"
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "qsv"
          ],
          "platform": "linux | (!osx & !uwp & !(arm & windows))"
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "nvcodec"
          ],
          "platform": "linux | (!osx & !uwp & !(arm64 & windows))"
        }
      ]
    },
    "all-gpl": {
      "description": "Build with all allowed dependencies selected that are compatible with the gpl license",
      "dependencies": [
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "all",
            "gpl",
            "postproc"
          ]
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "x264"
          ],
          "platform": "!(arm & windows)"
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "x265"
          ],
          "platform": "!uwp & !(arm & windows)"
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "avisynthplus"
          ],
          "platform": "windows & !arm & !uwp & !static"
        }
      ]
    },
    "all-nonfree": {
      "description": "Build with all allowed dependencies selected with a non-redistributable license",
      "dependencies": [
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "all-gpl",
            "fdk-aac",
            "nonfree",
            "openssl"
          ]
        }
      ]
    },
    "alsa": {
      "description": "Enable ALSA support",
      "dependencies": [
        "alsa"
      ]
    },
    "amf": {
      "description": "AMD AMF codec support",
      "dependencies": [
        "amd-amf"
      ]
    },
    "aom": {
      "description": "AV1 video encoding/decoding via libaom support in ffmpeg",
      "dependencies": [
        "aom"
      ]
    },
    "ass": {
      "description": "Libass subtitles rendering, needed for subtitles and ass filter support in ffmpeg",
      "dependencies": [
        "libass"
      ]
    },
    "avcodec": {
      "description": "Build the avcodec library"
    },
    "avdevice": {
      "description": "Build the avdevice library",
      "dependencies": [
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "avcodec",
            "avformat"
          ]
        }
      ]
    },
    "avfilter": {
      "description": "Build the avfilter library"
    },
    "avformat": {
      "description": "Build the avformat library",
      "dependencies": [
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "avcodec"
          ]
        }
      ]
    },
    "avisynthplus": {
      "description": "Reading of AviSynth script files",
      "supports": "windows & !static",
      "dependencies": [
        "avisynthplus",
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "gpl"
          ]
        }
      ]
    },
    "avresample": {
      "description": "Build the avresample library"
    },
    "bzip2": {
      "description": "Bzip2 support",
      "dependencies": [
        "bzip2"
      ]
    },
    "dav1d": {
      "description": "AV1 decoding via libdav1d",
      "dependencies": [
        "dav1d"
      ]
    },
    "drawtext": {
      "description": "Enable the drawtext filter",
      "dependencies": [
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "freetype"
          ]
        },
        "harfbuzz"
      ]
    },
    "fdk-aac": {
      "description": "AAC de/encoding via libfdk-aac, **including GPL-incompatible patent-encumbered HE-AAC**. If you do not require HE-AAC, use the built-in FFmpeg AAC codec.",
      "dependencies": [
        {
          "name": "fdk-aac",
          "default-features": false,
          "features": [
            "he-aac"
          ]
        },
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "nonfree"
          ]
        }
      ]
    },
    "ffmpeg": {
      "description": "Build the ffmpeg application",
      "supports": "!uwp",
      "dependencies": [
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "avcodec",
            "avfilter",
            "avformat"
          ]
        }
      ]
    },
    "ffplay": {
      "description": "Build the ffplay application",
      "supports": "!uwp",
      "dependencies": [
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "avcodec",
            "avfilter",
            "avformat",
            "sdl2",
            "swresample",
            "swscale"
          ]
        }
      ]
    },
    "ffprobe": {
      "description": "Build the ffprobe application",
      "supports": "!uwp",
      "dependencies": [
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "avcodec",
            "avformat"
          ]
        }
      ]
    },
    "fontconfig": {
      "description": "Useful for drawtext filter",
      "dependencies": [
        "fontconfig"
      ]
    },
    "freetype": {
      "description": "Needed for drawtext filter",
      "dependencies": [
        "freetype"
      ]
    },
    "fribidi": {
      "description": "Improves drawtext filter",
      "dependencies": [
        "fribidi"
      ]
    },
    "gpl": {
      "description": "Allow use of GPL code, the resulting libs and binaries will be under GPL"
    },
    "iconv": {
      "description": "Iconv support",
      "dependencies": [
        "libiconv"
      ]
    },
    "ilbc": {
      "description": "iLBC de/encoding via libilbc",
      "dependencies": [
        "libilbc"
      ]
    },
    "lzma": {
      "description": "lzma support",
      "dependencies": [
        "liblzma"
      ]
    },
    "modplug": {
      "description": "ModPlug via libmodplug",
      "dependencies": [
        "libmodplug"
      ]
    },
    "mp3lame": {
      "description": "MP3 encoding via libmp3lame",
      "dependencies": [
        "mp3lame"
      ]
    },
    "nonfree": {
      "description": "Allow use of nonfree code, the resulting libs and binaries will be unredistributable"
    },
    "nvcodec": {
      "description": "Nvidia video decoding/encoding acceleration",
      "supports": "linux | (!osx & !uwp & !(arm64 & windows))",
      "dependencies": [
        "ffnvcodec"
      ]
    },
    "opencl": {
      "description": "OpenCL processing",
      "supports": "!uwp",
      "dependencies": [
        "opencl"
      ]
    },
    "opengl": {
      "description": "OpenGL rendering",
      "supports": "!uwp",
      "dependencies": [
        "opengl",
        "opengl-registry"
      ]
    },
    "openh264": {
      "description": "H.264 de/encoding via openh264",
      "dependencies": [
        "openh264"
      ]
    },
    "openjpeg": {
      "description": "JPEG 2000 de/encoding via OpenJPEG",
      "dependencies": [
        "openjpeg"
      ]
    },
    "openmpt": {
      "description": "Decoding tracked files via libopenmpt",
      "dependencies": [
        "libopenmpt"
      ]
    },
    "openssl": {
      "description": "Needed for https support if gnutls, libtls or mbedtls is not used",
      "dependencies": [
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "version3"
          ]
        },
        "openssl"
      ]
    },
    "opus": {
      "description": "Opus de/encoding via libopus",
      "dependencies": [
        "opus"
      ]
    },
    "postproc": {
      "description": "Build the postproc library",
      "dependencies": [
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "gpl"
          ]
        }
      ]
    },
    "qsv": {
      "description": "Intel QSV Codec",
      "dependencies": [
        "mfx-dispatch"
      ]
    },
    "sdl2": {
      "description": "Sdl2 support",
      "dependencies": [
        {
          "name": "sdl2",
          "default-features": false,
          "features": [
            "x11"
          ],
          "platform": "linux"
        },
        {
          "name": "sdl2",
          "platform": "!linux"
        }
      ]
    },
    "snappy": {
      "description": "Snappy compression, needed for hap encoding",
      "dependencies": [
        "snappy"
      ]
    },
    "soxr": {
      "description": "Include libsoxr resampling",
      "dependencies": [
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "swresample"
          ]
        },
        "soxr"
      ]
    },
    "speex": {
      "description": "Speex de/encoding via libspeex",
      "dependencies": [
        "speex"
      ]
    },
    "srt": {
      "description": "Haivision SRT protocol",
      "supports": "!uwp",
      "dependencies": [
        "libsrt"
      ]
    },
    "ssh": {
      "description": "SFTP protocol via libssh",
      "dependencies": [
        "libssh"
      ]
    },
    "swresample": {
      "description": "Build the swresample library"
    },
    "swscale": {
      "description": "Build the swscale library"
    },
    "tensorflow": {
      "description": "TensorFlow as a DNN module backend for DNN based filters like sr",
      "supports": "!static",
      "dependencies": [
        "tensorflow"
      ]
    },
    "tesseract": {
      "description": "Tesseract, needed for ocr filter",
      "supports": "!static",
      "dependencies": [
        "tesseract"
      ]
    },
    "theora": {
      "description": "Theora encoding via libtheora",
      "dependencies": [
        "libtheora"
      ]
    },
    "version3": {
      "description": "Upgrade (L)GPL to version 3"
    },
    "vorbis": {
      "description": "Vorbis en/decoding via libvorbis, native implementation exists",
      "dependencies": [
        "libvorbis"
      ]
    },
    "vpx": {
      "description": "VP8 and VP9 de/encoding via libvpx",
      "dependencies": [
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "avcodec"
          ]
        },
        "libvpx"
      ]
    },
    "webp": {
      "description": "WebP encoding via libwebp",
      "dependencies": [
        "libwebp"
      ]
    },
    "x264": {
      "description": "H.264 encoding via x264",
      "dependencies": [
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "gpl"
          ]
        },
        "x264"
      ]
    },
    "x265": {
      "description": "HEVC encoding via x265",
      "dependencies": [
        {
          "name": "ffmpeg",
          "default-features": false,
          "features": [
            "gpl"
          ]
        },
        "x265"
      ]
    },
    "xml2": {
      "description": "XML parsing using the C library libxml2, needed for dash demuxing support",
      "dependencies": [
        "libxml2"
      ]
    },
    "zlib": {
      "description": "zlib support",
      "dependencies": [
        "zlib"
      ]
    }
  }
}
greenozon commented 2 months ago

D:\vcpkg>vcpkg install cmake

it is not a library, just when you install a real lib the cmake (if not found externally) will be installed automatically by vcpkg itself

2) your vcpkg.json for ffmpeg is a latest one

sohrab-niche commented 2 months ago

Here is the latest output. I understand now that if vcpkg doesn't find cmake, it installs it internally for its own building processes. Despite using this version of cmake, the issue is not yet resolved:

D:\vcpkg>vcpkg install ffmpeg --debug --editable
[DEBUG] To include the environment variables in debug output, pass --debug-env
[DEBUG] Disabling metrics because vcpkg.disable-metrics exists
[DEBUG] Trying to load bundleconfig from D:\vcpkg\vcpkg-bundle.json
[DEBUG] Failed to open: D:\vcpkg\vcpkg-bundle.json
[DEBUG] Bundle config: readonly=false, usegitregistry=false, embeddedsha=nullopt, deployment=Git, vsversion=nullopt
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] Feature flag 'dependencygraph' unset
[DEBUG] Using scripts-root: D:\vcpkg\scripts
[DEBUG] Using builtin-ports: D:\vcpkg\ports
[DEBUG] Using installed-root: D:\vcpkg\installed
[DEBUG] Using buildtrees-root: D:\vcpkg\buildtrees
[DEBUG] Using packages-root: D:\vcpkg\packages
[DEBUG] Using vcpkg-root: D:\vcpkg
[DEBUG] Using builtin-registry: D:\vcpkg\versions
[DEBUG] Using downloads-root: D:\vcpkg\downloads
[DEBUG] External asset downloads are allowed (x-block-origin is disabled)...
[DEBUG] Asset cache is not configured.
[DEBUG] Detecting host with IsWow64Process2
[DEBUG] Detecting host with IsWow64Process2
Computing installation plan...
[DEBUG] Found path: D:\programs\git\bin\git.exe
[DEBUG] Found path: d:\Programs\Git\cmd\git.exe
[DEBUG] Found path: d:\Programs\Git\mingw64\bin\git.exe
[DEBUG] 1000: CreateProcessW("D:\programs\git\bin\git.exe" --version)
[DEBUG] 1000: cmd_execute_and_stream_data() returned 0 after    64658 us
[DEBUG] 1001: CreateProcessW("D:\programs\git\bin\git.exe" "--git-dir=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false show 6f1ddd6b6878e7e66fcc35c65ba1d8feec2e01f8:versions/baseline.json)
[DEBUG] 1001: cmd_execute_and_stream_data() returned 0 after    51162 us
[DEBUG] 1002: CreateProcessW("D:\programs\git\bin\git.exe" "--git-dir=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false rev-parse 0f88ecb8528605f91980b90a2c5bad88e3cb565f:versions)
[DEBUG] 1002: cmd_execute_and_stream_data() returned 0 after    41171 us
[DEBUG] Loading dep info for: vcpkg-pkgconfig-get-modules:x64-windows
A suitable version of cmake was not found (required v3.29.2).
[DEBUG] Trying to hash D:\vcpkg\downloads\cmake-3.29.2-windows-i386.zip.2592.part
[DEBUG] D:\vcpkg\downloads\cmake-3.29.2-windows-i386.zip.2592.part has hash 562de7b577c99fe347b00437d14ce375a8e5a60504909cb67d2f73c372d39a2f76d2b42b69e4aeb31a4879e1bcf6f7c2d41f2ace12180ea83ba7af48879d40ab
Downloading https://github.com/Kitware/CMake/releases/download/v3.29.2/cmake-3.29.2-windows-i386.zip
Extracting cmake...
[DEBUG] 1003: CreateProcessW("C:\WINDOWS\system32\tar.exe" xzf "D:\vcpkg\downloads\cmake-3.29.2-windows-i386.zip")
[DEBUG] 1003: cmd_execute() returned 0 after 37236193 us
[DEBUG] 1004: CreateProcessW("D:\vcpkg\downloads\tools\cmake-3.29.2-windows\cmake-3.29.2-windows-i386/bin/cmake.exe" --version)
[DEBUG] 1004: cmd_execute_and_stream_data() returned 0 after   757825 us
[DEBUG] 1005: CreateProcessW("D:\vcpkg\downloads\tools\cmake-3.29.2-windows\cmake-3.29.2-windows-i386/bin/cmake.exe" -DVCPKG_ROOT_DIR=D:/vcpkg -DPACKAGES_DIR=D:/vcpkg/packages -DBUILDTREES_DIR=D:/vcpkg/buildtrees -D_VCPKG_INSTALLED_DIR=D:/vcpkg/installed -DDOWNLOADS=D:/vcpkg/downloads -DVCPKG_MANIFEST_INSTALL=OFF -P "D:\vcpkg\buildtrees\0.vcpkg_dep_info.cmake")
[DEBUG] 1005: cmd_execute_and_stream_data() returned 0 after    77953 us
[DEBUG] 1006: CreateProcessW("D:\vcpkg\downloads\tools\cmake-3.29.2-windows\cmake-3.29.2-windows-i386/bin/cmake.exe" -DVCPKG_ROOT_DIR=D:/vcpkg -DPACKAGES_DIR=D:/vcpkg/packages -DBUILDTREES_DIR=D:/vcpkg/buildtrees -D_VCPKG_INSTALLED_DIR=D:/vcpkg/installed -DDOWNLOADS=D:/vcpkg/downloads -DVCPKG_MANIFEST_INSTALL=OFF -P "D:\vcpkg\buildtrees\0.vcpkg_tags.cmake")
[DEBUG] 1006: cmd_execute_and_stream_data() returned 0 after   360693 us
The following packages will be built and installed:
    ffmpeg[avcodec,avdevice,avfilter,avformat,core,swresample,swscale]:x64-windows@6.1.1#7 -- C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git-trees\43a794215eb84acb9f6e49f2aee3a3ee1ac1af92
[DEBUG] 1007: CreateProcessW("C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -all -prerelease -legacy -products * -format xml)
[DEBUG] 1007: cmd_execute_and_stream_data() returned 0 after   488096 us
[DEBUG] Binary caching for package ffmpeg:x64-windows is disabled due to --editable
[DEBUG] Default binary cache path is: C:\Users\SOHRAB\AppData\Local\vcpkg\archives
Installing 1/1 ffmpeg[avcodec,avdevice,avfilter,avformat,core,swresample,swscale]:x64-windows@6.1.1#7...
greenozon commented 2 months ago

mystery...

I"m wondering why doesn't it download ffmpeg archive 7.0.2 but uses old one...

here is my log just in case...

C:\Dev\vcpkg>vcpkg install  ffmpeg
Computing installation plan...
The following packages will be built and installed:
    ffmpeg[avcodec,avdevice,avfilter,avformat,core,swresample,swscale]:x64-windows@7.0.2#3
  * pkgconf:x64-windows@2.3.0
  * vcpkg-pkgconfig-get-modules:x64-windows@2024-04-03
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-windows...
Compiler found: C:/Dev/VS2019/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe
Restored 0 package(s) from C:\Users\user\AppData\Local\vcpkg\archives in 244 us. Use --debug to see more details.
Installing 1/3 pkgconf:x64-windows@2.3.0...
Building pkgconf:x64-windows@2.3.0...
-- Found Python version '3.11.8 at C:/Dev/vcpkg/downloads/tools/python/python-3.11.8-x64/python.exe'
-- Using meson: C:/Dev/vcpkg/downloads/tools/meson-1.5.1-81f7e3/meson.py
-- Using cached pkgconf-pkgconf-pkgconf-2.3.0.tar.gz.
-- Cleaning sources at C:/Dev/vcpkg/buildtrees/pkgconf/src/conf-2.3.0-07e4a066bf.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/Dev/vcpkg/downloads/pkgconf-pkgconf-pkgconf-2.3.0.tar.gz
-- Using source at C:/Dev/vcpkg/buildtrees/pkgconf/src/conf-2.3.0-07e4a066bf.clean
-- Configuring x64-windows-dbg
-- Getting CMake variables for x64-windows
-- Configuring x64-windows-dbg done
-- Configuring x64-windows-rel
-- Configuring x64-windows-rel done
-- Package x64-windows-dbg
-- Package x64-windows-rel
-- Fixing pkgconfig file: C:/Dev/vcpkg/packages/pkgconf_x64-windows/lib/pkgconfig/libpkgconf.pc
-- Fixing pkgconfig file: C:/Dev/vcpkg/packages/pkgconf_x64-windows/debug/lib/pkgconfig/libpkgconf.pc
-- Installing: C:/Dev/vcpkg/packages/pkgconf_x64-windows/share/pkgconf/copyright
-- Performing post-build validation
Stored binaries in 1 destinations in 119 ms.
Elapsed time to handle pkgconf:x64-windows: 12 s
pkgconf:x64-windows package ABI: 449dfe82d3fa282903ef4175b98b9bc14b54686a59b727a56e61c6ccfb410f73
Installing 2/3 vcpkg-pkgconfig-get-modules:x64-windows@2024-04-03...
Building vcpkg-pkgconfig-get-modules:x64-windows@2024-04-03...
-- Installing: C:/Dev/vcpkg/packages/vcpkg-pkgconfig-get-modules_x64-windows/share/vcpkg-pkgconfig-get-modules/copyright
-- Performing post-build validation
Stored binaries in 1 destinations in 22.6 ms.
Elapsed time to handle vcpkg-pkgconfig-get-modules:x64-windows: 116 ms
vcpkg-pkgconfig-get-modules:x64-windows package ABI: 45b2b5c1db88959e842855e3ac177f2b6798f8ff4c8691238f5ab1835cc47594
Installing 3/3 ffmpeg[avcodec,avdevice,avfilter,avformat,core,swresample,swscale]:x64-windows@7.0.2#3...
Building ffmpeg[avcodec,avdevice,avfilter,avformat,core,swresample,swscale]:x64-windows@7.0.2#3...
-- Downloading https://github.com/ffmpeg/ffmpeg/archive/n7.0.2.tar.gz -> ffmpeg-ffmpeg-n7.0.2.tar.gz...
-- Extracting source C:/Dev/vcpkg/downloads/ffmpeg-ffmpeg-n7.0.2.tar.gz
-- Applying patch 0001-create-lib-libraries.patch
-- Applying patch 0002-fix-msvc-link.patch
-- Applying patch 0003-fix-windowsinclude.patch
-- Applying patch 0004-dependencies.patch
-- Applying patch 0005-fix-nasm.patch
-- Applying patch 0007-fix-lib-naming.patch
-- Applying patch 0012-Fix-ssl-110-detection.patch
-- Applying patch 0013-define-WINVER.patch
-- Applying patch 0020-fix-aarch64-libswscale.patch
-- Applying patch 0024-fix-osx-host-c11.patch
-- Applying patch 0040-ffmpeg-add-av_stream_get_first_dts-for-chromium.patch
-- Applying patch 0041-add-const-for-opengl-definition.patch
-- Applying patch 0043-fix-miss-head.patch
-- Using source at C:/Dev/vcpkg/buildtrees/ffmpeg/src/n7.0.2-8cb3114be3.clean
-- Getting CMake variables for x64-windows
...... (CTRL + C here)
greenozon commented 2 months ago

I"d recommend as a try to delete the cache folder - C:\Users\SOHRAB\AppData\Local\vcpkg\archives\

sohrab-niche commented 2 months ago

Tried this (deletion of folder C:\Users\SOHRAB\AppData\Local\vcpkg\archives\) but it doesn't work. What is the process by which vcpkg decides what version should be installed in classic mode? Can some more logs be enabled rather than simply Computing installation plan...?

D:\vcpkg>vcpkg install ffmpeg --debug --editable
[DEBUG] To include the environment variables in debug output, pass --debug-env
[DEBUG] Disabling metrics because vcpkg.disable-metrics exists
[DEBUG] Trying to load bundleconfig from D:\vcpkg\vcpkg-bundle.json
[DEBUG] Failed to open: D:\vcpkg\vcpkg-bundle.json
[DEBUG] Bundle config: readonly=false, usegitregistry=false, embeddedsha=nullopt, deployment=Git, vsversion=nullopt
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] Feature flag 'dependencygraph' unset
[DEBUG] Using scripts-root: D:\vcpkg\scripts
[DEBUG] Using builtin-ports: D:\vcpkg\ports
[DEBUG] Using installed-root: D:\vcpkg\installed
[DEBUG] Using buildtrees-root: D:\vcpkg\buildtrees
[DEBUG] Using packages-root: D:\vcpkg\packages
[DEBUG] Using vcpkg-root: D:\vcpkg
[DEBUG] Using builtin-registry: D:\vcpkg\versions
[DEBUG] Using downloads-root: D:\vcpkg\downloads
[DEBUG] External asset downloads are allowed (x-block-origin is disabled)...
[DEBUG] Asset cache is not configured.
[DEBUG] Detecting host with IsWow64Process2
[DEBUG] Detecting host with IsWow64Process2
Computing installation plan...
[DEBUG] Found path: D:\programs\git\bin\git.exe
[DEBUG] Found path: d:\Programs\Git\cmd\git.exe
[DEBUG] Found path: d:\Programs\Git\mingw64\bin\git.exe
[DEBUG] 1000: CreateProcessW("D:\programs\git\bin\git.exe" --version)
[DEBUG] 1000: cmd_execute_and_stream_data() returned 0 after    44503 us
[DEBUG] 1001: CreateProcessW("D:\programs\git\bin\git.exe" "--git-dir=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false show 6f1ddd6b6878e7e66fcc35c65ba1d8feec2e01f8:versions/baseline.json)
[DEBUG] 1001: cmd_execute_and_stream_data() returned 0 after    46528 us
[DEBUG] 1002: CreateProcessW("D:\programs\git\bin\git.exe" "--git-dir=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false rev-parse 0f88ecb8528605f91980b90a2c5bad88e3cb565f:versions)
[DEBUG] 1002: cmd_execute_and_stream_data() returned 0 after    35080 us
[DEBUG] Loading dep info for: vcpkg-pkgconfig-get-modules:x64-windows
[DEBUG] 1003: CreateProcessW("D:\vcpkg\downloads\tools\cmake-3.29.2-windows\cmake-3.29.2-windows-i386/bin/cmake.exe" --version)
[DEBUG] 1003: cmd_execute_and_stream_data() returned 0 after   341844 us
[DEBUG] 1004: CreateProcessW("D:\vcpkg\downloads\tools\cmake-3.29.2-windows\cmake-3.29.2-windows-i386/bin/cmake.exe" -DVCPKG_ROOT_DIR=D:/vcpkg -DPACKAGES_DIR=D:/vcpkg/packages -DBUILDTREES_DIR=D:/vcpkg/buildtrees -D_VCPKG_INSTALLED_DIR=D:/vcpkg/installed -DDOWNLOADS=D:/vcpkg/downloads -DVCPKG_MANIFEST_INSTALL=OFF -P "D:\vcpkg\buildtrees\0.vcpkg_dep_info.cmake")
[DEBUG] 1004: cmd_execute_and_stream_data() returned 0 after    27546 us
[DEBUG] 1005: CreateProcessW("D:\vcpkg\downloads\tools\cmake-3.29.2-windows\cmake-3.29.2-windows-i386/bin/cmake.exe" -DVCPKG_ROOT_DIR=D:/vcpkg -DPACKAGES_DIR=D:/vcpkg/packages -DBUILDTREES_DIR=D:/vcpkg/buildtrees -D_VCPKG_INSTALLED_DIR=D:/vcpkg/installed -DDOWNLOADS=D:/vcpkg/downloads -DVCPKG_MANIFEST_INSTALL=OFF -P "D:\vcpkg\buildtrees\0.vcpkg_tags.cmake")
[DEBUG] 1005: cmd_execute_and_stream_data() returned 0 after    31519 us
The following packages will be built and installed:
    ffmpeg[avcodec,avdevice,avfilter,avformat,core,swresample,swscale]:x64-windows@6.1.1#7 -- C:\Users\SOHRAB\AppData\Local\vcpkg\registries\git-trees
sohrab-niche commented 2 months ago

@sfhacker let's not panic or give up. This is some genuine bug to the best of my knowledge and belief. If no one can help, then once I get some time I will add logs to the vcpkg source code and hunt down the issue or ask more questions. Hopefully will get some time over weekend.

Kindly keep the issue open until then.

dg0yt commented 2 months ago

I"d recommend as a try to delete the cache folder - C:\Users\SOHRAB\AppData\Local\vcpkg\archives\

Useless (if not harmful) advise. There is no caching issue.


D:\vcpkg>vcpkg install ffmpeg --debug --editable

You are running vcpkg without an explicit path (such as .\path). This means the vcpkg command will be searched via the PATH environment variable. I hope PATH is setup correctly at the point. (Cf. https://github.com/microsoft/vcpkg/issues/40695#issuecomment-2316854091)

What is the process by which vcpkg decides what version should be installed in classic mode? Can some more logs be enabled rather than simply Computing installation plan...?

There is no versioning in classic mode. It will build what is checked out in ports/ffmpeg. With this location:

[DEBUG] Using builtin-ports: D:\vcpkg\ports
github-actions[bot] commented 1 month ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.