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

symlinks and paths on windows #11

Closed
x42 opened this issue Aug 16, 2018 · 3 comments
Closed

symlinks and paths on windows #11

x42 opened this issue Aug 16, 2018 · 3 comments

Comments

@x42
Copy link
Contributor

x42 commented Aug 16, 2018

tl;dr: two bugs which work around each other. no change required.

liblilv hardcodes foward-slash '/' as separator in two places.

https://github.com/drobilla/lilv/blob/4b298e4c7fa74836d023726185dfb2325d675c51/src/util.c#L377
https://github.com/drobilla/lilv/blob/4b298e4c7fa74836d023726185dfb2325d675c51/src/state.c#L264

This has the effect that when using abstract_path() on windows pm->abs == pm->rel == full absolute path.

So creating sylinks fails

  Failed to link  G:\foo\bar/C:\path\to\actual_file.sf2  -> C:\path\to\actual_file.sf2

On the upside, pm->rel is used in the state.ttl . Currently that is the absolute path and state save/load works (!).

This leads to a second issue. When fixing this by using LILV_DIR_SEP[0] in the places shown above, the state-file only contains the filename pm->rel. This is just like on unix-systems.

However creating symlinks usually fails on windows. The referenced file does not exist in the state-dir and the state is not be loaded correctly. The solution here, liblilv should use the absolute path when symlink creation fails.

@x42
Copy link
Contributor Author

x42 commented Aug 16, 2018

PS. here's a cmd.com output of a failed symlink in an Ardour session (using a-fluidsynth)

lilv_symlink_bug

@x42
Copy link
Contributor Author

x42 commented Aug 16, 2018

PS.
https://github.com/drobilla/lilv/blob/4b298e4c7fa74836d023726185dfb2325d675c51/src/util.c#L263
https://github.com/drobilla/lilv/blob/4b298e4c7fa74836d023726185dfb2325d675c51/src/util.c#L515
also hardcode slash.

After changing all four locations using LILV_DIR_SEP. Creating symlinks works properly IFF the host is running with Administrator Privileges (on Windows only admins can create symlinks).

Without admin privileges liblilv falls back to use hardlinks. That works only for the first step: The link to externals is created correctly if the file is on the same drive. However the 2nd hardlink from the plugin's state-folder to ..\..\..\externals\file fails with error 6 "Invalid handle".

@drobilla
Copy link
Collaborator

Should be properly fixed as of 1ca6608 (actual fixes in various bits throughout the preceding 8 commits or so).

In the process I removed the symlink thing entirely and just use hard links there.

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

2 participants