-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
[Bug]: Cache uses different path separators based off OS #5246
Comments
Thank you for reporting this. There was an issue with the underlying caching library that prevented this from working. It may have been fixed. It might be worth it to try again. |
The path separators are now the same but it still forces a rebuild. I will try and figure out where the cache is being changed as this is likely what is causing the rebuild. |
Okay, I think I see what you did. It may be working fine. Let me test a little more. |
Okay so caching is working cross platform (just not the way I would have implemented it), but something in the cache file gets changed between Windows and Unix/Mac systems that makes Git show it as modified. I am trying to work out what that change is. |
So the Unix/Mac side of things still seems to be removing any path with a |
The caching library automatically removes files from the cache that were not found. It is possible to use There was code to normalize the I might replace the caching library because it is a bit difficult to use since it was designed for absolute paths instead of relative. It also does not support dependencies, these had to be added through the meta data option on each entry. |
fixes: #5246 - Defaults to the universal format instead of legacy. - Path separators are converted to `/` before being stored.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Kind of Issue
Runtime - command-line tools
Tool or Library
cspell
Version
8.3.2
Supporting Library
Not sure / None
OS
All of them
OS Version
Windows 10, Garuda Linux (Arch), But should affect all
Description
The caching system doesn't normalize path separators. So if you were developing on Windows and Unix/Mac you will end up recalculating the
.cspellcache
file each time the OS changes between Windows and Unix/Mac. Meaning that if you have a team of several developers and some of them are using Windows and some are using Unix/Mac a universal cache file is effectively useless.Steps to Reproduce
Have universal caching setup in
cspell.json
Run it on Windows and look at the results. The path separator will be an escaped
\
Copy/Git push and pull the project onto a Unix/Mac machine
Run it again on the Unix/Mac machine and look at the results. The path separator will now be an
/
. All references to any paths with\
in them will be removed because they were not a valid fileExpected Behavior
The path separator would be normalized for cross platform support.
Additional Information
No response
cspell.json
cspell.config.yaml
No response
Example Repository
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: