Skip to content

Perforce commands fail on files under symlinks in workspace – realpath resolution needed #298

@jolopezl

Description

@jolopezl

Description:
Perforce operations via the VSCode Perforce extension currently fail when performed on files that are inside the Perforce workspace but accessed via symlinks. The extension treats such files as being outside the depot, likely because it uses the symlink path rather than resolving to the actual file path in the workspace.

This is a usability issue for setups where projects are organized using symlinks (e.g., monorepos, sandboxed dev environments, shared modules, etc.).

Steps to reproduce:

Create a Perforce workspace and sync a depot.

Create a symlink pointing to a file or folder within the workspace.

Open the symlinked path in VSCode.

Try running a Perforce command (e.g., edit, diff, submit).

Expected behavior:
The extension should resolve the real path of the file (e.g., using realpath) before passing it to Perforce commands, allowing them to succeed as expected.

Actual behavior:
Commands fail, with messages indicating the file is not under Perforce control.

Suggested Fix:
Use realpath (or equivalent path resolution APIs in Node.js) to resolve symlinks before executing Perforce commands. This will ensure the path matches the expected structure within the workspace/depot.

Offer for Help: I'm happy to help implement or test a fix for this issue, if some guidance on the extension’s architecture or contribution process is provided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions