Skip to content

Commit 84bb3fb

Browse files
authored
Version 1.29.4.0
* updating to P4API 25.2 * isolated diff2stat utility for customization * fixing diff2stat for basic testing * fixing tests for diff2stat, disabled by default * transparent comparators * transparent comparators * removing some unecessary logging channel string conversions * update solution paths for latest SDKs * Update OS version in GitHub Actions workflow * removing duplicate test ExcludedProcessNames
1 parent 86ada24 commit 84bb3fb

File tree

25 files changed

+545
-225
lines changed

25 files changed

+545
-225
lines changed

.github/workflows/p4vfs-verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
runs-on: ${{matrix.os}}
2929
strategy:
3030
matrix:
31-
os: [windows-latest]
31+
os: [windows-2022]
3232
configuration: [DebugDev, ReleaseDev]
3333

3434
steps:

external/OpenSSL/OpenSSL.Module.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Microsoft.P4VFS.External
1212
{
1313
public class OpensslModule : Module
1414
{
15-
private const string OPENSSL_VERSION = "3.3.3";
15+
private const string OPENSSL_VERSION = "3.0.18";
1616
private const string PERL_PACKAGE_NAME = "StrawberryPerl";
1717
private const string PERL_VERSION = "5.28.0.1";
1818

@@ -75,7 +75,7 @@ private void BuildOpensslLibrary(string opensslArchiveFolder, string opensslTarg
7575
$"@ECHO ON",
7676
$"CALL \"{vcvarsScriptPath}\"",
7777
$"CD /D \"{opensslArchiveFolder}\"",
78-
$"\"{perlExe}\" Configure VC-WIN64A no-asm no-apps no-tests \"--prefix={opensslConfigurationFolder}\" \"--openssldir={opensslConfigurationFolder}-ssl\" --{configuration}",
78+
$"\"{perlExe}\" Configure VC-WIN64A no-asm no-tests \"--prefix={opensslConfigurationFolder}\" \"--openssldir={opensslConfigurationFolder}-ssl\" --{configuration}",
7979
$"IF %ERRORLEVEL% NEQ 0 EXIT /B 1",
8080
$"nmake clean",
8181
$"IF %ERRORLEVEL% NEQ 0 EXIT /B 1",

external/P4API/P4API.Module.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Microsoft.P4VFS.External
1212
{
1313
public class P4apiModule : Module
1414
{
15-
private const string P4API_VERSION = "r24.1";
15+
private const string P4API_VERSION = "r25.2";
1616
private const string P4API_VISUAL_STUDIO_EDITION = "2022";
1717

1818
public override string Name

source/P4VFS.Console/P4VFS.Notes.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
Microsoft P4VFS Release Notes
22

3+
Version [1.29.4.0]
4+
* Updating to latest P4API 25.2
5+
* Migrating to OpenSSL 3.0 LTS as recommended by P4API 25.2 with latest 3.0.18
6+
* Addition to default ExcludedProcessNames of MpDlpService.exe which is common Windows
7+
Defender application
8+
* Optimization to use C++ transparent comparators on std::map<string,*,compare> to enable
9+
heterogeneous lookup from either c_str or string
10+
* Addition of default property values to SettingManager. It is now used to test
11+
against combinations of default and overridden settings values
12+
* Fixing bug where p4vfs.exe common option '-v' would not actually enable verbose logging
13+
for the command
14+
* Addition of experimental configuration setting MaxDiff2StatFileCount for specifying
15+
the maximum number of files for when fstat commands should be used instead of diff2
16+
for determining the have & head filetype of files to sync. Using fstat can be
17+
faster than diff2 in the rare case where a very few number files are updated under a
18+
very large file spec. For that reason, we'll keep this feature disabled by default indefinitly.
19+
A MaxDiff2StatFileCount of zero (default) will use legacy behavior to only use
20+
diff2. A MaxDiff2StatFileCount of less than zero will always use fstat. A
21+
MaxDiff2StatFileCount of greater than zero will use fstat if the number of modifications
22+
are less than the value.
23+
* Addition of a new verbose mode "Preview Time" profile time to the sync command which
24+
indicates the time spend gathering virtual sync file modifications to be applied.
25+
326
Version [1.29.3.0]
427
* Perforce SSO login from URL now uses impersonated p4vfs login command and ShellExecute
528
instead of using cmd.exe. This fixes rare case lingering cmd.exe processes from failed

source/P4VFS.Console/Source/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,8 @@ public static int Main(string[] args)
264264
try
265265
{
266266
VirtualFileSystemLog.Intitialize();
267+
VirtualFileSystemLog.Info("P4VFS version {0}", VirtualFileSystem.CurrentVersion);
268+
267269
SettingManager.RemoteLogging = SettingManager.ConsoleRemoteLogging;
268270
SettingManager.ImmediateLogging = SettingManager.ConsoleImmediateLogging;
269271
_P4Directory = Environment.CurrentDirectory;
@@ -317,7 +319,6 @@ public static int Main(string[] args)
317319
}
318320
}
319321

320-
VirtualFileSystemLog.Info("P4VFS version {0}", VirtualFileSystem.CurrentVersion);
321322
if (argIndex >= args.Length)
322323
{
323324
argIndex = 0;

source/P4VFS.Core/Include/DepotClient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ namespace P4 {
114114
template <typename Result>
115115
Result FDepotClient::Run(const DepotCommand& cmd)
116116
{
117-
Result result = std::make_shared<Result::element_type>();
117+
Result result = MakeResult<Result>();
118118
Run(cmd, *result.get());
119119
return result;
120120
}

source/P4VFS.Core/Include/DepotOperations.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,22 @@ namespace P4 {
147147
CreateFileSpecFlags::Enum flags = CreateFileSpecFlags::None
148148
);
149149

150+
static DepotStringArray
151+
DepotOperations::CreateFileSpecs(
152+
DepotClient& depotClient,
153+
const DepotSyncActionInfoArray& fileModifications,
154+
const DepotRevision& revision,
155+
CreateFileSpecFlags::Enum flags
156+
);
157+
158+
static DepotResultDiff2
159+
DepotOperations::Diff2Stat(
160+
DepotClient& depotClient,
161+
DepotSyncFlags::Enum syncFlags,
162+
const DepotStringArray& fileSpecs,
163+
const DepotSyncActionInfoArray& fileModifications
164+
);
165+
150166
static DepotResultDiff2
151167
Diff2(
152168
DepotClient& depotClient,
@@ -175,6 +191,11 @@ namespace P4 {
175191
SizesFlags::Enum flags = SizesFlags::None
176192
);
177193

194+
static bool
195+
IsFullDepotFileSpec(
196+
const DepotString& fileSpec
197+
);
198+
178199
static bool
179200
IsFileTypeAlwaysResident(
180201
const DepotString& syncResident,

source/P4VFS.Core/Include/DepotResult.h

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ namespace P4 {
2929

3030
struct FDepotResultTag
3131
{
32-
bool ContainsKey(const DepotString& tagKey) const;
33-
void RemoveKey(const DepotString& tagKey);
34-
void SetValue(const DepotString& tagKey, const DepotString& tagValue);
32+
bool ContainsKey(const char* tagKey) const;
33+
void RemoveKey(const char* tagKey);
34+
void SetValue(const char* tagKey, const DepotString& tagValue);
3535

36-
bool TryGetValue(const DepotString& tagKey, DepotString& value) const;
37-
const DepotString& GetValue(const DepotString& tagKey) const;
38-
const DepotString* GetValuePtr(const DepotString& tagKey) const;
36+
bool TryGetValue(const char* tagKey, DepotString& value) const;
37+
const DepotString& GetValue(const char* tagKey) const;
38+
const DepotString* GetValuePtr(const char* tagKey) const;
3939

4040
int32_t GetValueInt32(const char* tagKey, int32_t defaultValue = 0) const;
4141
int64_t GetValueInt64(const char* tagKey, int64_t defaultValue = 0) const;
@@ -79,7 +79,12 @@ namespace P4 {
7979

8080
P4VFS_CORE_API const Array<DepotResultTag>& TagList() const;
8181
P4VFS_CORE_API const Array<DepotResultText>& TextList() const;
82-
const DepotString& GetTagValue(const DepotString& tagKey) const;
82+
const DepotString& GetTagValue(const char* tagKey) const;
83+
84+
void Append(const FDepotResult& src);
85+
void Append(const Array<DepotResultTag>& srcTagList);
86+
void Append(const Array<DepotResultText>& srcTextList);
87+
void Append(const DepotResultTag& srcTag);
8388

8489
protected:
8590
friend class DepotClientCommand;
@@ -95,20 +100,20 @@ namespace P4 {
95100
return m_Tag.get() ? *m_Tag : Empty;
96101
}
97102

98-
bool ContainsTagKey(const DepotString& tagKey) const
103+
bool ContainsTagKey(const char* tagKey) const
99104
{
100105
return Tag().ContainsKey(tagKey);
101106
}
102107

103-
void RemoveTagKey(const DepotString& tagKey)
108+
void RemoveTagKey(const char* tagKey)
104109
{
105110
if (m_Tag.get())
106111
{
107112
m_Tag->RemoveKey(tagKey);
108113
}
109114
}
110115

111-
void SetTagValue(const DepotString& tagKey, const DepotString& tagValue)
116+
void SetTagValue(const char* tagKey, const DepotString& tagValue)
112117
{
113118
if (m_Tag.get() == nullptr)
114119
{
@@ -117,7 +122,7 @@ namespace P4 {
117122
m_Tag->SetValue(tagKey, tagValue);
118123
}
119124

120-
const DepotString& GetTagValue(const DepotString& tagKey) const
125+
const DepotString& GetTagValue(const char* tagKey) const
121126
{
122127
return Tag().GetValue(tagKey);
123128
}
@@ -162,6 +167,20 @@ namespace P4 {
162167
return FDepotResultNode::Create<NodeType>(index < m_TagList.size() ? m_TagList[index] : nullptr);
163168
}
164169
};
170+
171+
template <typename Result>
172+
Result MakeResult()
173+
{
174+
return std::make_shared<Result::element_type>();
175+
}
176+
177+
template <typename Result>
178+
Result MakeErrorResult(const DepotString& errorText)
179+
{
180+
Result result = MakeResult<Result>();
181+
result->SetError(errorText.c_str());
182+
return result;
183+
}
165184
}}}
166185

167186
#pragma managed(pop)

source/P4VFS.Core/Include/FileCore.h

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,36 +288,42 @@ namespace FileCore {
288288
{
289289
template <typename TL, typename TR>
290290
bool operator()(const TL& a, const TR& b) const { return StringInfo::Strcmp(StringInfo::CStr(a), StringInfo::CStr(b)) < 0; }
291+
using is_transparent = int;
291292
};
292293

293294
struct LessInsensitive
294295
{
295296
template <typename TL, typename TR>
296297
bool operator()(const TL& a, const TR& b) const { return StringInfo::Stricmp(StringInfo::CStr(a), StringInfo::CStr(b)) < 0; }
298+
using is_transparent = int;
297299
};
298300

299301
struct Greater
300302
{
301303
template <typename TL, typename TR>
302304
bool operator()(const TL& a, const TR& b) const { return StringInfo::Strcmp(StringInfo::CStr(a), StringInfo::CStr(b)) > 0; }
305+
using is_transparent = int;
303306
};
304307

305308
struct GreaterInsensitive
306309
{
307310
template <typename TL, typename TR>
308311
bool operator()(const TL& a, const TR& b) const { return StringInfo::Stricmp(StringInfo::CStr(a), StringInfo::CStr(b)) > 0; }
312+
using is_transparent = int;
309313
};
310314

311315
struct Equal
312316
{
313317
template <typename TL, typename TR>
314318
bool operator()(const TL& a, const TR& b) const { return StringInfo::Strcmp(StringInfo::CStr(a), StringInfo::CStr(b)) == 0; }
319+
using is_transparent = int;
315320
};
316321

317322
struct EqualInsensitive
318323
{
319324
template <typename TL, typename TR>
320325
bool operator()(const TL& a, const TR& b) const { return StringInfo::Stricmp(StringInfo::CStr(a), StringInfo::CStr(b)) == 0; }
326+
using is_transparent = int;
321327
};
322328

323329
class WtoA
@@ -377,6 +383,7 @@ namespace FileCore {
377383
};
378384

379385
#define LITERAL(CharType, str) ::Microsoft::P4VFS::FileCore::StringInfo::Traits::Type<CharType>::Literal(str, L##str)
386+
#define LITERAL_STRING(StringType, str) LITERAL(typename std::decay<decltype(StringType)>::type::value_type, str)
380387
};
381388

382389
struct P4VFS_CORE_API FileInfo
@@ -603,6 +610,12 @@ namespace FileCore {
603610
return std::any_of(elements.begin(), elements.end(), predicate);
604611
}
605612

613+
template <typename ArrayType, typename Predicate>
614+
static bool All(const ArrayType& elements, Predicate predicate)
615+
{
616+
return std::all_of(elements.begin(), elements.end(), predicate);
617+
}
618+
606619
template <typename ArrayType, typename Predicate>
607620
static void RemoveIf(ArrayType& elements, Predicate predicate)
608621
{
@@ -739,18 +752,20 @@ namespace FileCore {
739752
do { if (((v) == (ns::ev)) || ((ns::ev) != 0 && ((v) & (ns::ev)))) \
740753
{ \
741754
if (s.empty() == false) \
742-
s += "|"; \
743-
s += #ev; \
755+
{ \
756+
s += LITERAL_STRING(s, "|"); \
757+
} \
758+
s += LITERAL_STRING(s, #ev); \
744759
} } while(0)
745760

746-
#define P4VFS_ENUM_TO_STRING_RETURN(v, ns, ev) \
761+
#define P4VFS_ENUM_TO_STRING_RETURN(rt, v, ns, ev) \
747762
do { if ((v) == (ns::ev)) \
748763
{ \
749-
return #ev; \
764+
return LITERAL(rt::value_type, #ev); \
750765
} } while (0)
751766

752767
#define P4VFS_STRING_TO_ENUM_RETURN(v, ns, ev) \
753-
do { if (Microsoft::P4VFS::FileCore::StringInfo::Stricmp(#ev, Microsoft::P4VFS::FileCore::StringInfo::CStr(v)) == 0) \
768+
do { if (Microsoft::P4VFS::FileCore::StringInfo::Stricmp(LITERAL_STRING(v, #ev), Microsoft::P4VFS::FileCore::StringInfo::CStr(v)) == 0) \
754769
{ \
755770
return ns::ev; \
756771
} } while (0)

source/P4VFS.Core/Include/LogDevice.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ namespace FileCore {
2121
Error
2222
};
2323

24-
P4VFS_CORE_API static AString ToString(Enum value);
25-
P4VFS_CORE_API static LogChannel::Enum FromString(const AString& value);
24+
P4VFS_CORE_API static String ToString(Enum value);
25+
P4VFS_CORE_API static LogChannel::Enum FromString(const String& value);
2626
};
2727

2828
struct LogElement

0 commit comments

Comments
 (0)