You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just remembered that paths are case insensitive on unix.Edit: on Windows and macOS.
And this is currently not being taken into consideration when flushing the fusion parse partials cache. Because my assumption of realpath was wrong.
This results in the parser cache not being flushed and changes not being reflected in dev mode.
This case is easily reproducible via:
Root.fusion
# we use lower case here to reproduce this:
include: myfusionfile.fusion
debug = Neos.Fusion:Join {
a = "Root was included"
}
root >
root = Neos.Fusion:Renderer {
renderPath = "/debug"
}
MyFusionFile.fusion
debug {
b = "MyFusionFile.fusion was included"
}
Renders to
MyFusionFile.fusion was included
Root was included
but when updating MyFusionFile.fusion no changes are reflected.
MyFusionFile.fusion
debug {
b = "MyFusionFile.fusion was included - i was updated"
}
Still renders the same output as above.
The reason for that is that the cache is flushed with the file system monitor which provides the path in "correct" casing.
This resource path will eventually be resolved manually into an absolute path (link) and to get a comparable path we use realpath.
But realpath doesnt actually return the correct casing 🤯
For case-insensitive filesystems realpath() may or may not normalize the character case.
That means realpath is of no use to us and it seems we have to use consistently strtolower on case-insensitive fs to correctly flush the cache. This is doable but would require a manual flow cache:flushone Neos_Fusion_ParsePartials as the current cache entries become obsolete after update. -> This is hardly doable.
Also we have to bear in mind that fusion file includes would behaving different on other platforms and thus packages might not work on case sensitive windows. So maybe we should only allow correctly cased imports, if possible?
The text was updated successfully, but these errors were encountered:
I just remembered that paths are case insensitive on unix
No, usually they are case-sensitive, unlike on Windows and macOS (be default). But that might have been just a typo?
mhsdesign
changed the title
BUG: ParserCache cant flush wrongly cased includes
BUG: ParserCache cant flush wrongly cased includes (on case-insensitive fs)
Jan 18, 2024
Related: #4415
I just remembered that paths are case insensitive
on unix.Edit: on Windows and macOS.And this is currently not being taken into consideration when flushing the fusion parse partials cache. Because my assumption of
realpath
was wrong.This results in the parser cache not being flushed and changes not being reflected in dev mode.
This case is easily reproducible via:
Root.fusion
MyFusionFile.fusion
Renders to
but when updating
MyFusionFile.fusion
no changes are reflected.MyFusionFile.fusion
Still renders the same output as above.
The reason for that is that the cache is flushed with the file system monitor which provides the path in "correct" casing.
But while resolving the include via the
FilePatternResolver
the incorrect casing is used:This resource path will eventually be resolved manually into an absolute path (link) and to get a comparable path we use realpath.
But realpath doesnt actually return the correct casing 🤯
That means
realpath
is of no use to us and it seems we have to use consistentlystrtolower
on case-insensitive fs to correctly flush the cache.This is doable but would require a manual-> This is hardly doable.flow cache:flushone Neos_Fusion_ParsePartials
as the current cache entries become obsolete after update.Also we have to bear in mind that fusion file includes would behaving different on other platforms and thus packages might not work on case sensitive windows. So maybe we should only allow correctly cased imports, if possible?
The text was updated successfully, but these errors were encountered: