Skip to content

Commit bcdd034

Browse files
author
Matt Pelland
committed
upgrade folly to v2020.12.07.00
1 parent 2bc5f1a commit bcdd034

File tree

7 files changed

+21
-23
lines changed

7 files changed

+21
-23
lines changed

decibel-cpp/include/decibel/messaging/Reactor.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
// Copyright 2017, 2020. Starry, Inc. All Rights Reserved.
22
#pragma once
33

44
#include <unordered_set>
@@ -75,7 +75,8 @@ class Reactor : public folly::Timekeeper
7575
// virtual void add(folly::Func fn);
7676

7777
// folly::TimeKeeper
78-
virtual folly::SemiFuture<folly::Unit> after(folly::Duration duration);
78+
virtual folly::SemiFuture<folly::Unit>
79+
after(folly::HighResDuration duration);
7980

8081
niceuv::ITimer* GetTimer();
8182

decibel-cpp/src/decibel/messaging/Reactor.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Copyright 2017, 2020. Starry, Inc. All Rights Reserved.
12
#include "decibel/messaging/Reactor.h"
23

34
#include "decibel/messaging/Exchanges.h"
@@ -162,7 +163,7 @@ void Reactor::CancelCall(std::shared_ptr<OneShotTimerEvent> pTimer)
162163
// CallSoon(fn);
163164
// }
164165

165-
folly::SemiFuture<folly::Unit> Reactor::after(folly::Duration duration)
166+
folly::SemiFuture<folly::Unit> Reactor::after(folly::HighResDuration duration)
166167
{
167168
auto pPromise = std::make_shared<folly::Promise<folly::Unit>>();
168169
CallLater(duration.count(), [pPromise] { pPromise->setValue(); });
@@ -176,7 +177,9 @@ void Reactor::Shutdown()
176177
{
177178
futures.push_back(client->Shutdown());
178179
}
179-
folly::collectAll(futures).thenValue([this](auto /*unused*/) { this->Stop(); });
180+
folly::collectAll(futures)
181+
.toUnsafeFuture()
182+
.thenValue([this](auto /*unused*/) { this->Stop(); });
180183
Start();
181184
}
182185

decibel-cpp/src/decibel/niceuv/FutureSubprocess.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
// Copyright 2017, 2020. Starry, Inc. All Rights Reserved.
22
#include <algorithm>
33

44
#include <log4cxx/logger.h>
@@ -64,6 +64,7 @@ folly::Future<SubprocessHandler::Buffer> FutureSubprocess::RunSubprocess()
6464
folly::collectAll(pStdOutPromise->getFuture(),
6565
pExitPromise->getFuture(),
6666
pStdErrPromise->getFuture())
67+
.toUnsafeFuture()
6768
.thenValue([pWrappedPromise](
6869
const std::tuple<folly::Try<SubprocessHandler::Buffer>,
6970
folly::Try<int>,

docker_builds/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ COPY install-protobuf.sh /var/tmp
77
RUN /var/tmp/install-protobuf.sh
88

99
COPY install-folly.sh /var/tmp
10-
COPY patches/folly /var/tmp/patches/folly
1110
RUN /var/tmp/install-folly.sh
1211

1312
COPY install-ampq-cpp.sh /var/tmp

docker_builds/install-folly.sh

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
#!/usr/bin/env bash
2-
# Copyright 2019. Starry, Inc. All Rights Reserved.
2+
# Copyright 2019, 2020. Starry, Inc. All Rights Reserved.
33
set -ex
44

55
CPU_COUNT=$(nproc)
66

77
WORKDIR=${1-/var/tmp/third_party_build/tmp}
88
INSTALL_PREFIX=${2-/usr/local}
99
SCRIPTDIR="$(cd "$(dirname "$0")" && pwd -P)"
10+
PATCHESDIR="${SCRIPTDIR}/patches/folly"
1011
mkdir -p "${WORKDIR}"
1112

1213
if [ -z "${FORCE_REINSTALL}" ]; then
1314
FORCE_REINSTALL=0
1415
fi
1516

1617
# folly
17-
FOLLY_VERSION="v2019.12.09.00"
18+
FOLLY_VERSION="v2020.12.07.00"
1819

1920
# shellcheck disable=SC2166
2021
if [ "${FORCE_REINSTALL}" -eq 1 ] || \
@@ -29,8 +30,10 @@ then
2930

3031
pushd "${WORKDIR}/folly"
3132

32-
cp -r "${SCRIPTDIR}/patches/folly" patches
33-
git apply patches/*
33+
if [ -d "${PATCHESDIR}" ]; then
34+
cp -r "${PATCHESDIR}" patches
35+
git apply patches/*
36+
fi
3437

3538
mkdir -p _build
3639
pushd _build

docker_builds/patches/folly/0003-remove-cxx-std-from-pkgconfig.patch

-11
This file was deleted.

src/HookManager.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
// Copyright 2017, 2020. Starry, Inc. All Rights Reserved.
22
#pragma once
33

44
#include "HookConfig.h"
@@ -35,7 +35,9 @@ folly::Future<folly::Unit> SplitSubprocessesAcrossCores(const T& subprocs,
3535
{
3636
futures.emplace_back(subproc->ExecuteExternalProcess());
3737
}
38-
return folly::collect(futures).thenValue([](auto /*unused*/){ return folly::Unit(); });
38+
return folly::collect(futures)
39+
.toUnsafeFuture()
40+
.thenValue([](auto /*unused*/){ return folly::Unit(); });
3941
});
4042
}
4143
return final_future;

0 commit comments

Comments
 (0)