1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 23:13:14 +02:00

Use __nix_virtual__ instead of __virtual__

As suggested by @Ma27.
This commit is contained in:
Eelco Dolstra 2022-10-26 16:38:45 +02:00
parent 0402dd0298
commit 16838726a2
2 changed files with 6 additions and 6 deletions

View file

@ -227,15 +227,15 @@ public:
void registerAccessor(ref<InputAccessor> accessor);
/* Convert a path to a string representation of the format
`/__virtual__/<accessor-number>/<path>`. */
`/__nix_virtual__/<accessor-number>/<path>`. */
std::string encodePath(const SourcePath & path);
/* Decode a path encoded by `encodePath()`. */
SourcePath decodePath(std::string_view s, PosIdx pos = noPos);
/* Decode all virtual paths in a string, i.e. all
/__virtual__/... substrings are replaced by the corresponding
input accessor. */
/__nix_virtual__/... substrings are replaced by the
corresponding input accessor. */
std::string decodePaths(std::string_view s);
/* Allow access to a path. */

View file

@ -14,14 +14,14 @@ void EvalState::registerAccessor(ref<InputAccessor> accessor)
inputAccessors.emplace(accessor->number, accessor);
}
static constexpr std::string_view marker = "/__virtual__/";
static constexpr std::string_view marker = "/__nix_virtual__/";
std::string EvalState::encodePath(const SourcePath & path)
{
/* For backward compatibility, return paths in the root FS
normally. Encoding any other path is not very reproducible (due
to /__virtual__/<N>) and we should depreceate it eventually. So
print a warning about use of an encoded path in
to /__nix_virtual__/<N>) and we should depreceate it
eventually. So print a warning about use of an encoded path in
decodePath(). */
return path.accessor == rootFS
? path.path.abs()