Skip to content
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

Enable symlinks on Windows #548

Open
jeroenpf opened this issue Sep 18, 2024 · 2 comments
Open

Enable symlinks on Windows #548

jeroenpf opened this issue Sep 18, 2024 · 2 comments
Labels

Comments

@jeroenpf
Copy link
Contributor

jeroenpf commented Sep 18, 2024

What

In #510 we implemented support for symlinks. Unfortunately, this only works for MacOS. When running Studio on Windows, PHP WASM mounts symlink nodes with invalid target paths such as /var/www/html/C:\Users\example\target-foo - we can not mount these paths because they are not POSIX compliant.

The root cause can likely be found in Emscripten and particularly the NODEFS filesystem, which we use to mount site directories and symlink targets. Further investigation will be needed to determine the exact problem.

Creating symlinks can be done as follows:
Using Windows terminal:
mklink /D symlink origin_dir (for directories)
mklink symlink origin_file (for files)

Using Powershell:
New-Item -Path symlink -ItemType SymbolicLink -Value origin

Why

Some (Windows) developers might want to utilize symlinks to include plugins, themes, or other files located outside of their Studio project.

How

Figure out how we can fix the invalid symlink targets so that we can properly mount on it.

@jeroenpf jeroenpf added the [Type] Feature Request A shiny new thing label Sep 18, 2024
@profucius
Copy link

I too would find this extremely valuable. I have tried symbolic links, hard links, and junctions, but none of them are recognized by Wordpress within WP Studio.

My use case: I create multiple forks of sites while doing my building/testing, and to prevent copying the entire plugin/theme data every time I make a fork, a symbolic link would allow me to have a single-source of that data, which every fork would pull from.

@wojtekn
Copy link
Contributor

wojtekn commented Oct 9, 2024

Thanks for sharing your use case @profucius . I agree it's a valuable feature, and we will look for a way to add it to Windows, too.

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

No branches or pull requests

3 participants