Skip to content

Commit 5886bc5

Browse files
authored
Merge pull request NixOS#2710 from volth/patch-6
canBuildLocally: check for features
2 parents b71e1fb + fff8db2 commit 5886bc5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/build-remote/build-remote.cc

+10-3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ static AutoCloseFD openSlotLock(const Machine & m, unsigned long long slot)
3838
return openLockFile(fmt("%s/%s-%d", currentLoad, escapeUri(m.storeUri), slot), true);
3939
}
4040

41+
static bool allSupportedLocally(const std::set<std::string>& requiredFeatures) {
42+
for (auto & feature : requiredFeatures)
43+
if (!settings.systemFeatures.get().count(feature)) return false;
44+
return true;
45+
}
46+
4147
static int _main(int argc, char * * argv)
4248
{
4349
{
@@ -97,9 +103,10 @@ static int _main(int argc, char * * argv)
97103
source >> drvPath;
98104
auto requiredFeatures = readStrings<std::set<std::string>>(source);
99105

100-
auto canBuildLocally = amWilling
101-
&& ( neededSystem == settings.thisSystem
102-
|| settings.extraPlatforms.get().count(neededSystem) > 0);
106+
auto canBuildLocally = amWilling
107+
&& ( neededSystem == settings.thisSystem
108+
|| settings.extraPlatforms.get().count(neededSystem) > 0)
109+
&& allSupportedLocally(requiredFeatures);
103110

104111
/* Error ignored here, will be caught later */
105112
mkdir(currentLoad.c_str(), 0777);

0 commit comments

Comments
 (0)