aboutsummaryrefslogtreecommitdiff
path: root/zenserver/upstream/upstreamapply.cpp
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2021-12-08 09:04:04 +0100
committerMartin Ridgers <[email protected]>2021-12-08 09:04:04 +0100
commit1037aa9edc9b88d9c59fdf2d2531ac265b571b3c (patch)
tree805f277f60b1eba7de8b78ae209d7464bcedd398 /zenserver/upstream/upstreamapply.cpp
parentImplement zen/internalfile for POSIX platforms (diff)
parentUse 'Platform' instead of 'OSFamily' for Horde condition (diff)
downloadzen-1037aa9edc9b88d9c59fdf2d2531ac265b571b3c.tar.xz
zen-1037aa9edc9b88d9c59fdf2d2531ac265b571b3c.zip
Merged main
Diffstat (limited to 'zenserver/upstream/upstreamapply.cpp')
-rw-r--r--zenserver/upstream/upstreamapply.cpp28
1 files changed, 17 insertions, 11 deletions
diff --git a/zenserver/upstream/upstreamapply.cpp b/zenserver/upstream/upstreamapply.cpp
index 6ff5c5da2..2b805fe14 100644
--- a/zenserver/upstream/upstreamapply.cpp
+++ b/zenserver/upstream/upstreamapply.cpp
@@ -40,6 +40,9 @@ namespace zen {
using namespace std::literals;
+static const IoBuffer EmptyBuffer;
+static const IoHash EmptyBufferId = IoHash::HashBuffer(EmptyBuffer);
+
namespace detail {
class HordeUpstreamApplyEndpoint final : public UpstreamApplyEndpoint
@@ -708,6 +711,8 @@ namespace detail {
[[nodiscard]] bool ProcessApplyKey(const UpstreamApplyRecord& ApplyRecord, UpstreamData& Data)
{
+ using namespace fmt::literals;
+
std::string ExecutablePath;
std::map<std::string, std::string> Environment;
std::set<std::filesystem::path> InputFiles;
@@ -739,6 +744,15 @@ namespace detail {
}
}
+ for (auto& It : ApplyRecord.WorkerDescriptor["dirs"sv])
+ {
+ std::string_view Directory = It.AsString();
+ std::string DummyFile = "{}/.zen_empty_file"_format(Directory);
+ InputFiles.insert(DummyFile);
+ Data.Blobs[EmptyBufferId] = EmptyBuffer;
+ InputFileHashes[DummyFile] = EmptyBufferId;
+ }
+
for (auto& It : ApplyRecord.WorkerDescriptor["environment"sv])
{
std::string_view Env = It.AsString();
@@ -813,18 +827,10 @@ namespace detail {
bool Exclusive = ApplyRecord.WorkerDescriptor["exclusive"sv].AsBool();
// TODO: Remove override when Horde accepts the UE style Host Platforms (Win64, Linux, Mac)
- std::string Condition;
- if (HostPlatform == "Win64" || HostPlatform == "Windows")
- {
- Condition = "OSFamily == 'Windows' && Pool == 'Win-RemoteExec'";
- }
- else if (HostPlatform == "Mac")
- {
- Condition = "OSFamily == 'MacOS'";
- }
- else
+ std::string Condition = "Platform == '{}'"_format(HostPlatform);
+ if (HostPlatform == "Win64")
{
- Condition = "OSFamily == '{}'"_format(HostPlatform);
+ Condition += " && Pool == 'Win-RemoteExec'";
}
std::map<std::string_view, int64_t> Resources;