Correctly hijack the file://
uri scheme with _NIX_FORCE_HTTP
Setting the `_NIX_FORCE_HTTP` environment variable is supposed to force `file://` store urls to use the `HttpBinaryCacheStore` implementation rather than the `LocalBinaryCacheStore` one (very useful for testing). However because of a name mismatch, the `LocalBinaryCacheStore` was still registering the `file` scheme when this variable was set, meaning that the actual store implementation picked up on `file://` uris was dependent on the registration order of the stores (itself dependent on the link order of the object files). Fix this by making the `LocalBinaryCacheStore` gracefully not register the `file` uri scheme when the variable is set.
This commit is contained in:
parent
2799fe4cdb
commit
417aaf4ff7
1 changed files with 1 additions and 1 deletions
|
@ -107,7 +107,7 @@ bool LocalBinaryCacheStore::fileExists(const std::string & path)
|
|||
|
||||
std::set<std::string> LocalBinaryCacheStore::uriSchemes()
|
||||
{
|
||||
if (getEnv("_NIX_FORCE_HTTP_BINARY_CACHE_STORE") == "1")
|
||||
if (getEnv("_NIX_FORCE_HTTP") == "1")
|
||||
return {};
|
||||
else
|
||||
return {"file"};
|
||||
|
|
Loading…
Reference in a new issue