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
Currently, we populate the internal list of sources via git ls-files (if the workspace uses git). However, git only tracks files and only implicitly creates directories in order to put those files in the right places -- relevantly, the directories themselves are not returned from git ls-files and thus aren't considered Wake sources.1 Meanwhile, both source and claim are perfectly happy to load and hash directories, but since the directories aren't included under git, a clean checkout containing dir/file.txt which is trying to get a path for both the directory and the file has to use source "dir/file.txt" but claim "dir", contrary to the intuition around claim.
This does also bring up a number of further considerations:
We can add the directories easily enough by walking up each relative path from git ls-files and including each directory until the workspace root, but a naïve implementation risks exponential memory use if something like a list is used to store the sources rather than a tree -- I don't know the internals to say whether that's already been headed off.
mkdir should probably only make new directories, rather than being able to transform any path into a Path -- similar behaviour to the new write in checking the registered sources. This would be a breaking change since there could be legacy code (predating claim) which uses mkdir to load source directories, but would help to define the domain for each function.
Relatedly, anything which uses claim to load source directories is also going to break. I think this is less likely to impact anything because source and claim are currently assumed by many users to relate to file paths (due to the source/git interaction) and claim hasn't had as much time for niche uses like directories to develop. It could also be mitigated if source and claim are merged as part of the same release.
Footnotes
This is in contrast to some other VCS models (my experience is with Darcs) which do have first-class directories, and if populated by piping the relevant listing command into publish source as recommended, we wind up in a situation where Wake's behaviour with directories sometimes requires source and sometimes claim based on what backing store is used. ↩
The text was updated successfully, but these errors were encountered:
Currently, we populate the internal list of sources via
git ls-files
(if the workspace uses git). However, git only tracks files and only implicitly creates directories in order to put those files in the right places -- relevantly, the directories themselves are not returned fromgit ls-files
and thus aren't considered Wake sources.1 Meanwhile, bothsource
andclaim
are perfectly happy to load and hash directories, but since the directories aren't included under git, a clean checkout containingdir/file.txt
which is trying to get a path for both the directory and the file has to usesource "dir/file.txt"
butclaim "dir"
, contrary to the intuition aroundclaim
.This does also bring up a number of further considerations:
git ls-files
and including each directory until the workspace root, but a naïve implementation risks exponential memory use if something like a list is used to store the sources rather than a tree -- I don't know the internals to say whether that's already been headed off.mkdir
should probably only make new directories, rather than being able to transform any path into aPath
-- similar behaviour to the newwrite
in checking the registered sources. This would be a breaking change since there could be legacy code (predatingclaim
) which usesmkdir
to load source directories, but would help to define the domain for each function.claim
to load source directories is also going to break. I think this is less likely to impact anything becausesource
andclaim
are currently assumed by many users to relate to file paths (due to thesource
/git interaction) andclaim
hasn't had as much time for niche uses like directories to develop. It could also be mitigated ifsource
andclaim
are merged as part of the same release.Footnotes
This is in contrast to some other VCS models (my experience is with Darcs) which do have first-class directories, and if populated by piping the relevant listing command into
publish source
as recommended, we wind up in a situation where Wake's behaviour with directories sometimes requiressource
and sometimesclaim
based on what backing store is used. ↩The text was updated successfully, but these errors were encountered: