mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
d17e1d9737
The core `CanonPath` constructors were using `absPath`, but `absPath` in some situations does IO which is not appropriate. It turns out that these constructors avoided those situations, and thus were pure, but it was far from obvious this was the case. To remedy the situation, abstract the core algorithm from `canonPath` to use separately in `CanonPath` without any IO. No we know by-construction that those constructors are pure. That leaves `CanonPath::fromCWD` as the only operation which uses IO / is impure. Add docs on it, and `CanonPath` as a whole, explaining the situation. This is also necessary to support Windows paths on windows without messing up `CanonPath`. But, I think it is good even without that. Co-authored-by: Eelco Dolstra <edolstra@gmail.com> Co-authored-by: Robert Hensing <roberth@users.noreply.github.com> |
||
---|---|---|
.. | ||
data/git | ||
args.cc | ||
canon-path.cc | ||
chunked-vector.cc | ||
closure.cc | ||
compression.cc | ||
config.cc | ||
file-content-address.cc | ||
git.cc | ||
hash.cc | ||
hilite.cc | ||
json-utils.cc | ||
local.mk | ||
logging.cc | ||
lru-cache.cc | ||
pool.cc | ||
references.cc | ||
suggestions.cc | ||
tests.cc | ||
url.cc | ||
xml-writer.cc |