Skip to content

Commit b592359

Browse files
authored
Merge pull request #6178 from edolstra/fix-darwin
Fix Darwin build
2 parents c272079 + b91500a commit b592359

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/libstore/build/local-derivation-goal.cc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,7 +1933,7 @@ void LocalDerivationGoal::runChild()
19331933
"can't map '%1%' to '%2%': mismatched impure paths not supported on Darwin",
19341934
i.first, i.second.source);
19351935

1936-
string path = i.first;
1936+
std::string path = i.first;
19371937
struct stat st;
19381938
if (lstat(path.c_str(), &st)) {
19391939
if (i.second.optional && errno == ENOENT)
@@ -1985,7 +1985,7 @@ void LocalDerivationGoal::runChild()
19851985
args.push_back("IMPORT_DIR=" + settings.nixDataDir + "/nix/sandbox/");
19861986
if (allowLocalNetworking) {
19871987
args.push_back("-D");
1988-
args.push_back(string("_ALLOW_LOCAL_NETWORKING=1"));
1988+
args.push_back(std::string("_ALLOW_LOCAL_NETWORKING=1"));
19891989
}
19901990
args.push_back(drv->builder);
19911991
} else {
@@ -2383,14 +2383,10 @@ void LocalDerivationGoal::registerOutputs()
23832383
[&](DerivationOutputCAFloating dof) {
23842384
return newInfoFromCA(dof);
23852385
},
2386-
[&](DerivationOutputDeferred) {
2386+
[&](DerivationOutputDeferred) -> ValidPathInfo {
23872387
// No derivation should reach that point without having been
23882388
// rewritten first
23892389
assert(false);
2390-
// Ugly, but the compiler insists on having this return a value
2391-
// of type `ValidPathInfo` despite the `assert(false)`, so
2392-
// let's provide it
2393-
return *(ValidPathInfo*)0;
23942390
},
23952391
}, output.output);
23962392

src/libstore/build/local-derivation-goal.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct LocalDerivationGoal : public DerivationGoal
6262
Environment env;
6363

6464
#if __APPLE__
65-
typedef string SandboxProfile;
65+
typedef std::string SandboxProfile;
6666
SandboxProfile additionalSandboxProfile;
6767
#endif
6868

src/libstore/gc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ void LocalStore::findRuntimeRoots(Roots & roots, bool censor)
413413
try {
414414
std::regex lsofRegex(R"(^n(/.*)$)");
415415
auto lsofLines =
416-
tokenizeString<std::vector<string>>(runProgram(LSOF, true, { "-n", "-w", "-F", "n" }), "\n");
416+
tokenizeString<std::vector<std::string>>(runProgram(LSOF, true, { "-n", "-w", "-F", "n" }), "\n");
417417
for (const auto & line : lsofLines) {
418418
std::smatch match;
419419
if (std::regex_match(line, match, lsofRegex))

0 commit comments

Comments
 (0)