Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jolopezl opened this issue Apr 19, 2025 · 0 comments

Comments

@jolopezl
Copy link

jolopezl commented Apr 19, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant