aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/zen/cmds/builds_cmd.cpp28
2 files changed, 18 insertions, 11 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 19b525bf2..6ca445cb9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
##
- **EXPERIMENTAL** `zen builds`
+ - Bugfix: Fixed upload failure on Mac/Linux if `--zen-folder-path` was not given. UE-265170
- Feature: `zen builds upload` command has new option `--find-max-block-count` to control how many blocks we search for reuse.
- Improvement: Bumped the default number of blocks to search during upload to 10000 (from 5000).
- Bugfix: Fixed missing trailing quote when converting binary data from compact binary to json
diff --git a/src/zen/cmds/builds_cmd.cpp b/src/zen/cmds/builds_cmd.cpp
index 8e8fd480a..ba2564fad 100644
--- a/src/zen/cmds/builds_cmd.cpp
+++ b/src/zen/cmds/builds_cmd.cpp
@@ -164,9 +164,9 @@ namespace {
);
- std::filesystem::path MakeSafeAbsolutePath(const std::string Path)
+ std::filesystem::path MakeSafeAbsolutePath(std::filesystem::path Path)
{
- std::filesystem::path AbsolutePath = std::filesystem::absolute(StringToPath(Path)).make_preferred();
+ std::filesystem::path AbsolutePath = std::filesystem::absolute(Path).make_preferred();
#if ZEN_PLATFORM_WINDOWS && 1
const std::string_view Prefix = "\\\\?\\";
const std::u8string PrefixU8(Prefix.begin(), Prefix.end());
@@ -180,6 +180,8 @@ namespace {
return AbsolutePath;
}
+ std::filesystem::path MakeSafeAbsolutePath(const std::string PathString) { return MakeSafeAbsolutePath(StringToPath(PathString)); }
+
void RenameFileWithRetry(const std::filesystem::path& SourcePath, const std::filesystem::path& TargetPath)
{
std::error_code Ec;
@@ -9061,8 +9063,9 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
BuildStorage::Statistics StorageStats;
BuildStorageCache::Statistics StorageCacheStats;
- const std::filesystem::path ZenFolderPath =
- m_ZenFolderPath.empty() ? MakeSafeAbsolutePath(".") / ZenFolderName : MakeSafeAbsolutePath(m_ZenFolderPath);
+ const std::filesystem::path ZenFolderPath = m_ZenFolderPath.empty()
+ ? MakeSafeAbsolutePath(std::filesystem::current_path()) / ZenFolderName
+ : MakeSafeAbsolutePath(m_ZenFolderPath);
CreateDirectories(ZenFolderPath);
auto _ = MakeGuard([ZenFolderPath]() {
if (CleanDirectory(ZenFolderPath, {}))
@@ -9176,8 +9179,9 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
BuildStorage::Statistics StorageStats;
BuildStorageCache::Statistics StorageCacheStats;
- const std::filesystem::path ZenFolderPath =
- m_ZenFolderPath.empty() ? MakeSafeAbsolutePath(".") / ZenFolderName : MakeSafeAbsolutePath(m_ZenFolderPath);
+ const std::filesystem::path ZenFolderPath = m_ZenFolderPath.empty()
+ ? MakeSafeAbsolutePath(std::filesystem::current_path()) / ZenFolderName
+ : MakeSafeAbsolutePath(m_ZenFolderPath);
CreateDirectories(ZenFolderPath);
auto _ = MakeGuard([ZenFolderPath]() {
if (CleanDirectory(ZenFolderPath, {}))
@@ -9227,7 +9231,7 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
m_BuildPartName,
Path,
ZenFolderPath,
- MakeSafeAbsolutePath(m_ManifestPath),
+ m_ManifestPath.empty() ? std::filesystem::path{} : MakeSafeAbsolutePath(m_ManifestPath),
m_FindBlockMaxCount,
m_BlockReuseMinPercentLimit,
m_AllowMultiparts,
@@ -9777,8 +9781,9 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
BuildStorage::Statistics StorageStats;
BuildStorageCache::Statistics StorageCacheStats;
- const std::filesystem::path ZenFolderPath =
- m_ZenFolderPath.empty() ? MakeSafeAbsolutePath(".") / ZenFolderName : MakeSafeAbsolutePath(m_ZenFolderPath);
+ const std::filesystem::path ZenFolderPath = m_ZenFolderPath.empty()
+ ? MakeSafeAbsolutePath(std::filesystem::current_path()) / ZenFolderName
+ : MakeSafeAbsolutePath(m_ZenFolderPath);
CreateDirectories(ZenFolderPath);
auto _ = MakeGuard([ZenFolderPath]() {
if (CleanDirectory(ZenFolderPath, {}))
@@ -9828,8 +9833,9 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
BuildStorage::Statistics StorageStats;
BuildStorageCache::Statistics StorageCacheStats;
- const std::filesystem::path ZenFolderPath =
- m_ZenFolderPath.empty() ? MakeSafeAbsolutePath(".") / ZenFolderName : MakeSafeAbsolutePath(m_ZenFolderPath);
+ const std::filesystem::path ZenFolderPath = m_ZenFolderPath.empty()
+ ? MakeSafeAbsolutePath(std::filesystem::current_path()) / ZenFolderName
+ : MakeSafeAbsolutePath(m_ZenFolderPath);
CreateDirectories(ZenFolderPath);
auto _ = MakeGuard([ZenFolderPath]() {
if (CleanDirectory(ZenFolderPath, {}))