diff --git a/bindings/c/test/mako/mako.c b/bindings/c/test/mako/mako.c index 661b99c5dc..010dcbe0d0 100644 --- a/bindings/c/test/mako/mako.c +++ b/bindings/c/test/mako/mako.c @@ -1056,12 +1056,12 @@ void* worker_thread(void* thread_args) { } fprintf(debugme, - "DEBUG: worker_id:%d (%d) thread_id:%d (%d) (tid:%d)\n", + "DEBUG: worker_id:%d (%d) thread_id:%d (%d) (tid:%ld)\n", worker_id, args->num_processes, thread_id, args->num_threads, - (unsigned int)pthread_self()); + (uint64_t)pthread_self()); if (args->tpsmax) { thread_tps = compute_thread_tps(args->tpsmax, worker_id, thread_id, args->num_processes, args->num_threads); diff --git a/fdbclient/BackupContainerAzureBlobStore.actor.cpp b/fdbclient/BackupContainerAzureBlobStore.actor.cpp index 4ee3a7ebf5..d07983213d 100644 --- a/fdbclient/BackupContainerAzureBlobStore.actor.cpp +++ b/fdbclient/BackupContainerAzureBlobStore.actor.cpp @@ -19,7 +19,9 @@ */ #include "fdbclient/BackupContainerAzureBlobStore.h" +#if (!defined(TLS_DISABLED) && !defined(_WIN32)) #include "fdbrpc/AsyncFileEncrypted.h" +#emdif #include "flow/actorcompiler.h" // This must be the last #include. @@ -244,7 +246,9 @@ BackupContainerAzureBlobStore::BackupContainerAzureBlobStore(const NetworkAddres const std::string& containerName, const Optional& encryptionKeyFileName) : containerName(containerName) { +#if (!defined(TLS_DISABLED) && !defined(_WIN32)) setEncryptionKey(encryptionKeyFileName); +#endif std::string accountKey = std::getenv("AZURE_KEY"); auto credential = std::make_shared(accountName, accountKey); auto storageAccount = std::make_shared( diff --git a/fdbclient/BackupContainerFileSystem.actor.cpp b/fdbclient/BackupContainerFileSystem.actor.cpp index a4eb1f6e34..d70edc0340 100644 --- a/fdbclient/BackupContainerFileSystem.actor.cpp +++ b/fdbclient/BackupContainerFileSystem.actor.cpp @@ -23,7 +23,9 @@ #include "fdbclient/BackupContainerFileSystem.h" #include "fdbclient/BackupContainerLocalDirectory.h" #include "fdbclient/JsonBuilder.h" +#if (!defined(TLS_DISABLED) && !defined(_WIN32)) #include "flow/StreamCipher.h" +#endif #include "flow/UnitTest.h" #include @@ -1127,6 +1129,8 @@ public: return false; } +#if (!defined(TLS_DISABLED) && !defined(_WIN32)) + ACTOR static Future createTestEncryptionKeyFile(std::string filename) { state Reference keyFile = wait(IAsyncFileSystem::filesystem()->open( filename, @@ -1163,6 +1167,7 @@ public: StreamCipher::Key::initializeKey(std::move(key)); return Void(); } +#endif }; // class BackupContainerFileSystemImpl Future> BackupContainerFileSystem::writeLogFile(Version beginVersion, @@ -1475,6 +1480,8 @@ bool BackupContainerFileSystem::usesEncryption() const { Future BackupContainerFileSystem::encryptionSetupComplete() const { return encryptionSetupFuture; } + +#if (!defined(TLS_DISABLED) && !defined(_WIN32)) void BackupContainerFileSystem::setEncryptionKey(Optional const& encryptionKeyFileName) { if (encryptionKeyFileName.present()) { encryptionSetupFuture = BackupContainerFileSystemImpl::readEncryptionKey(encryptionKeyFileName.get()); @@ -1483,6 +1490,11 @@ void BackupContainerFileSystem::setEncryptionKey(Optional const& en Future BackupContainerFileSystem::createTestEncryptionKeyFile(std::string const &filename) { return BackupContainerFileSystemImpl::createTestEncryptionKeyFile(filename); } +#else +Future BackupContainerFileSystem::createTestEncryptionKeyFile(std::string const& filename) { + return Void(); +} +#endif namespace backup_test { diff --git a/fdbclient/BackupContainerFileSystem.h b/fdbclient/BackupContainerFileSystem.h index 6acf2d87a7..4b92b2f409 100644 --- a/fdbclient/BackupContainerFileSystem.h +++ b/fdbclient/BackupContainerFileSystem.h @@ -152,12 +152,13 @@ public: VectorRef keyRangesFilter, bool logsOnly, Version beginVersion) final; - static Future createTestEncryptionKeyFile(std::string const& filename); protected: bool usesEncryption() const; +#if (!defined(TLS_DISABLED) && !defined(_WIN32)) void setEncryptionKey(Optional const& encryptionKeyFileName); +#endif Future encryptionSetupComplete() const; private: diff --git a/fdbclient/BackupContainerLocalDirectory.actor.cpp b/fdbclient/BackupContainerLocalDirectory.actor.cpp index b89d085a64..fa0f351d5a 100644 --- a/fdbclient/BackupContainerLocalDirectory.actor.cpp +++ b/fdbclient/BackupContainerLocalDirectory.actor.cpp @@ -133,7 +133,9 @@ std::string BackupContainerLocalDirectory::getURLFormat() { BackupContainerLocalDirectory::BackupContainerLocalDirectory(const std::string& url, const Optional& encryptionKeyFileName) { +#if (!defined(TLS_DISABLED) && !defined(_WIN32)) setEncryptionKey(encryptionKeyFileName); +#endif std::string path; if (url.find("file://") != 0) { diff --git a/fdbclient/BackupContainerS3BlobStore.actor.cpp b/fdbclient/BackupContainerS3BlobStore.actor.cpp index 02112c2f58..60d6b82a70 100644 --- a/fdbclient/BackupContainerS3BlobStore.actor.cpp +++ b/fdbclient/BackupContainerS3BlobStore.actor.cpp @@ -20,7 +20,9 @@ #include "fdbclient/AsyncFileS3BlobStore.actor.h" #include "fdbclient/BackupContainerS3BlobStore.h" +#if (!defined(TLS_DISABLED) && !defined(_WIN32)) #include "fdbrpc/AsyncFileEncrypted.h" +#endif #include "fdbrpc/AsyncFileReadAhead.actor.h" #include "flow/actorcompiler.h" // This must be the last #include. @@ -145,7 +147,9 @@ BackupContainerS3BlobStore::BackupContainerS3BlobStore(Reference& encryptionKeyFileName) : m_bstore(bstore), m_name(name), m_bucket("FDB_BACKUPS_V2") { +#if (!defined(TLS_DISABLED) && !defined(_WIN32)) setEncryptionKey(encryptionKeyFileName); +#endif // Currently only one parameter is supported, "bucket" for (const auto& [name, value] : params) { if (name == "bucket") { @@ -171,9 +175,11 @@ std::string BackupContainerS3BlobStore::getURLFormat() { Future> BackupContainerS3BlobStore::readFile(const std::string& path) { Reference f = makeReference(m_bstore, m_bucket, dataPath(path)); +#if (!defined(TLS_DISABLED) && !defined(_WIN32)) if (usesEncryption()) { f = makeReference(f, AsyncFileEncrypted::Mode::READ_ONLY); } +#endif f = makeReference(f, m_bstore->knobs.read_block_size, m_bstore->knobs.read_ahead_blocks, @@ -189,9 +195,11 @@ Future> BackupContainerS3BlobStore::listURLs(Reference< Future> BackupContainerS3BlobStore::writeFile(const std::string& path) { Reference f = makeReference(m_bstore, m_bucket, dataPath(path)); +#if (!defined(TLS_DISABLED) && !defined(_WIN32)) if (usesEncryption()) { f = makeReference(f, AsyncFileEncrypted::Mode::APPEND_ONLY); } +#endif return Future>(makeReference(path, f)); } diff --git a/flow/Arena.h b/flow/Arena.h index c18fef2f11..ee319fcf01 100644 --- a/flow/Arena.h +++ b/flow/Arena.h @@ -665,7 +665,8 @@ struct Traceable> : std::conditional::value, std::tru namespace literal_string_ref { template StringRef LiteralStringRefHelper(const char* str) { - static_assert(std::is_same_v, "Argument to LiteralStringRef must be a literal string"); + static_assert(std::is_same_v || std::is_same_v, + "Argument to LiteralStringRef must be a literal string"); return StringRef(reinterpret_cast(str), Size - 1); } } // namespace literal_string_ref diff --git a/flow/IThreadPoolTest.actor.cpp b/flow/IThreadPoolTest.actor.cpp index a8d04b2e48..03bce4782f 100644 --- a/flow/IThreadPoolTest.actor.cpp +++ b/flow/IThreadPoolTest.actor.cpp @@ -60,4 +60,6 @@ TEST_CASE("/flow/IThreadPool/NamedThread") { return Void(); } +#else +void forceLinkIThreadPoolTests() {} #endif