Skip to content

vcpkg.io: Non-root remote user has no permissions to write to vcpkg root #277

Description

@NimatLa

The vcpkg.io feature clones microsoft/vcpkg repository to /usr/local/share/vcpkg

When the vcpkg install command is run, vcpkg tries to write to this directory the source files and built binaries of the dependencies it is installing. The command fails because the remote user has no permissions to write to this directory.

$ vcpkg install
error: try_take_exclusive_file_lock("/usr/local/share/vcpkg/buildtrees/vcpkg-running.lock"): No such file or directory
/usr/local/share/vcpkg/buildtrees/vcpkg-running.lock: error: failed to take lock, another vcpkg may be running against the same directory
$ ls -ld /usr/local/share/vcpkg/
drwxr-xr-x 10 root root 4096 Sep 13 04:15 /usr/local/share/vcpkg/

I can fix this with "postCreateCommand": "sudo chown -R vscode:vscode /usr/local/share/vcpkg/", but maybe the feature could also create a new vcpkg group, set it as owner for vcpkg root dir, add group write permissions, and assign a named user to the group.

It would also be possible to run vcpkg with special flags that set the written-to paths, but that's a bit inconvenient and there are currently (microsoft/vcpkg#16098) no environment variables that do the same.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions