microsoft / vcpkg

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

unrelated "Warning: an error occurred while parsing...." #15050

Closed cgolchert closed 3 years ago

cgolchert commented 3 years ago

Describe the bug A group of ports keep getting their vcpkg.json corrupted and give errors when doing unrelated tasks. If I search for ANYTHING these warnings pop up.

Environment

To Reproduce Steps to reproduce the behavior:

  1. vcpkg search xyz Repro code when

Warning: an error occurred while parsing 'C:\dev\vcpkg\ports\abseil\vcpkg.json' Warning: an error occurred while parsing 'C:\dev\vcpkg\ports\arrayfire\vcpkg.json' Warning: an error occurred while parsing 'C:\dev\vcpkg\ports\asio\vcpkg.json' Warning: an error occurred while parsing 'C:\dev\vcpkg\ports\ceres\vcpkg.json' Warning: an error occurred while parsing 'C:\dev\vcpkg\ports\faiss\vcpkg.json' Warning: an error occurred while parsing 'C:\dev\vcpkg\ports\flashlight-cuda\vcpkg.json' Warning: an error occurred while parsing 'C:\dev\vcpkg\ports\freetds\vcpkg.json' Warning: an error occurred while parsing 'C:\dev\vcpkg\ports\geographiclib\vcpkg.json' Warning: an error occurred while parsing 'C:\dev\vcpkg\ports\itk\vcpkg.json' Warning: an error occurred while parsing 'C:\dev\vcpkg\ports\kenlm\vcpkg.json' Warning: an error occurred while parsing 'C:\dev\vcpkg\ports\libdatachannel\vcpkg.json' Warning: an error occurred while parsing 'C:\dev\vcpkg\ports\libosmscout\vcpkg.json' Warning: an error occurred while parsing 'C:\dev\vcpkg\ports\ogre\vcpkg.json' Warning: an error occurred while parsing 'C:\dev\vcpkg\ports\restbed\vcpkg.json' Warning: an error occurred while parsing 'C:\dev\vcpkg\ports\rtabmap\vcpkg.json' Warning: an error occurred while parsing 'C:\dev\vcpkg\ports\sdl2\vcpkg.json' Warning: an error occurred while parsing 'C:\dev\vcpkg\ports\sqlcipher\vcpkg.json' Warning: an error occurred while parsing 'C:\dev\vcpkg\ports\sqlitecpp\vcpkg.json' Use '--debug' to get more information about the parse failures.

Expected behavior I expect it to return the search results without unrelated .json errors

Failure logs

Error: There are invalid field types in the CONTROL or manifest file of C:\dev\vcpkg\ports\abseil\vcpkg.json The following fields had the wrong types:

features was expected to be an array of feature definitions

Error: There are invalid field types in the CONTROL or manifest file of C:\dev\vcpkg\ports\arrayfire\vcpkg.json The following fields had the wrong types:

features was expected to be an array of feature definitions

Error: There are invalid field types in the CONTROL or manifest file of C:\dev\vcpkg\ports\asio\vcpkg.json The following fields had the wrong types:

features was expected to be an array of feature definitions

Error: There are invalid field types in the CONTROL or manifest file of C:\dev\vcpkg\ports\ceres\vcpkg.json The following fields had the wrong types:

features was expected to be an array of feature definitions

Error: There are invalid field types in the CONTROL or manifest file of C:\dev\vcpkg\ports\faiss\vcpkg.json The following fields had the wrong types:

features was expected to be an array of feature definitions

Error: There are invalid field types in the CONTROL or manifest file of C:\dev\vcpkg\ports\flashlight-cuda\vcpkg.json The following fields had the wrong types:

features was expected to be an array of feature definitions

Error: There are invalid field types in the CONTROL or manifest file of C:\dev\vcpkg\ports\freetds\vcpkg.json The following fields had the wrong types:

features was expected to be an array of feature definitions

Error: There are invalid field types in the CONTROL or manifest file of C:\dev\vcpkg\ports\geographiclib\vcpkg.json The following fields had the wrong types:

features was expected to be an array of feature definitions

Error: There are invalid field types in the CONTROL or manifest file of C:\dev\vcpkg\ports\itk\vcpkg.json The following fields had the wrong types:

features was expected to be an array of feature definitions

Error: There are invalid field types in the CONTROL or manifest file of C:\dev\vcpkg\ports\kenlm\vcpkg.json The following fields had the wrong types:

features was expected to be an array of feature definitions

Error: There are invalid field types in the CONTROL or manifest file of C:\dev\vcpkg\ports\libdatachannel\vcpkg.json The following fields had the wrong types:

features was expected to be an array of feature definitions

Error: There are invalid field types in the CONTROL or manifest file of C:\dev\vcpkg\ports\libosmscout\vcpkg.json The following fields had the wrong types:

features was expected to be an array of feature definitions

Error: There are invalid field types in the CONTROL or manifest file of C:\dev\vcpkg\ports\ogre\vcpkg.json The following fields had the wrong types:

features was expected to be an array of feature definitions

Error: There are invalid field types in the CONTROL or manifest file of C:\dev\vcpkg\ports\restbed\vcpkg.json The following fields had the wrong types:

features was expected to be an array of feature definitions

Error: There are invalid field types in the CONTROL or manifest file of C:\dev\vcpkg\ports\rtabmap\vcpkg.json The following fields had the wrong types:

features was expected to be an array of feature definitions

Error: There are invalid field types in the CONTROL or manifest file of C:\dev\vcpkg\ports\sdl2\vcpkg.json The following fields had the wrong types:

features was expected to be an array of feature definitions

Error: There are invalid field types in the CONTROL or manifest file of C:\dev\vcpkg\ports\sqlcipher\vcpkg.json The following fields had the wrong types:

features was expected to be an array of feature definitions

Error: There are invalid field types in the CONTROL or manifest file of C:\dev\vcpkg\ports\sqlitecpp\vcpkg.json The following fields had the wrong types:

Additional context I have nuked the vcpkg install and rebuilt and these ports keep causing problems. I'm not even using them. Deleting these ports will make the errors go away until the next update.

PhoebeHui commented 3 years ago

@cgolchert, thanks for reporting this issue!

As a workaround, could you execute the following command instead, and then try again? ./vcpkg format-manifest --all

@strega-nil, could you please take a look? I don't think the error should be emitted when execute 'vcpkg search xyz'.

strega-nil commented 3 years ago

@PhoebeHui this is an outdated version of vcpkg with a new version of the ports tree.

@cgolchert, please re-run bootstrap-vcpkg.

PhoebeHui commented 3 years ago

@strega-nil, I added space in dependency port of 3fd vcpkg.json file, from "sqlite3" to "sqlite3 ", and then execute './vcpkg search zlib', it given the following warning, I'm not sure if the behavior does make sence, I break the format of json file manually, in theory, this is not happen since we check the format, but someone may breaks the format locally, I think the error should be emitted when install the port.

PS E:\vcpkg\src> ./vcpkg search zlib
Warning: an error occurred while parsing 'E:\vcpkg\src\ports\3fd\vcpkg.json'
Use '--debug' to get more information about the parse failures.

ace[zlib]                             Enable zlib support
coin[zlib]                            Use zlib for reading/writing compressed files
ffmpeg[zlib]                          zlib support in ffmpeg
folly[zlib]                           Support zlib for compression
freetype[zlib]                        Use zlib instead of internal library for DEFLATE
hdf5[zlib]                            Build with zlib
liblas[zlib]                          Support zlib for compression
liblzma              5.2.5#2          Compression library with an API similar to that of zlib.
libmariadb[zlib]                      Use internal zlib
libpq[zlib]                           Use zlib (else --without-zlib)
librdkafka[zlib]                      Build with zlib
libsbml[zlib]                         gzip compression support for libsbml
libssh[zlib]                          libssh with zlib
mathgl[zlib]                          zlib module
miniz                2.1.0-1          Single C source file zlib-replacement library
oatpp-zlib           1.2.0#1          Oat++ functionality for automatically compressing/decompressing content with d...
prometheus-cpp[compression]           Enable zlib compression
protobuf[zlib]                        ZLib based features like Gzip streams
rocksdb[zlib]                         zlib support in rocksdb
seal[zlib]                            Use zlib for compressed serialization
telnetpp[zlib]                        Zlib support
zlib                 1.2.11#9         A compression library
zstr                 1.0.4            This C++ header-only library enables the use of C++ standard iostreams to acce...

If your library is not listed, please open an issue at and/or consider making a pull request:
    https://github.com/Microsoft/vcpkg/issues

PS E:\vcpkg\src> git rev-parse HEAD
2aaa67573085c24bcb4e224b87605d708d9a6377

@cgolchert, please rebuild vcpkg and try again, this should not block you.

strega-nil commented 3 years ago

@PhoebeHui the reason we emit that error is because if you break the format of vcpkg.json or CONTROL, we can't do anything with that port. We can't display it for example. That's why it's a warning.

PhoebeHui commented 3 years ago

I see, thanks Nicole for confirming this issue!

@cgolchert, please reopen this issue if it still be a problem for you.