Skip to content

Cannot load status db when filesystem is readonly #10812

Closed
@linquize

Description

Describe the bug

Cannot load status db when filesystem is readonly

vcpkg list
error writing file: C:\vcpkg\installed\vcpkg\status-new: The data is invalid.

Environment

  • OS: Windows 10 x64
  • Compiler: MSVC 2019

To Reproduce
Steps to reproduce the behavior:

  1. Perform vcpkg operation in a writable filesystem
  2. vcpkg install zlib
  3. Make filesystem readonly (you may also deny NTFS write permission)
  4. vcpkg list
  5. Error occur

Expected behavior
No error.
zlib:x64-windows 1.2.11-6 A compression library

Additional context
If C:\vcpkg\installed\vcpkg\status is written immediately before vcpkg install exits, instead of lazy write on subsequent load, it won't fail on a readonly filesystem.

vcpkg update and vcpkg upgrade also fail.

If you run vcpkg list once then make readonly, subsequent vcpkg list will succeed.

Metadata

Assignees

Labels

category:questionThis issue is a questionrequires:tool-releaseAn issue that has been fixed in the microsoft/vcpkg-tool repo and is waiting for a release thereof

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions