Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.28.0.0 #47

Merged
merged 8 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/p4vfs-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
matrix:
os: [windows-latest]
configuration: [Debug, Release]
configuration: [DebugDev, ReleaseDev]

steps:
- name: Set image info in env
Expand All @@ -38,15 +38,15 @@ jobs:
Write-Output "ImageVersion=$env:ImageVersion" >> $env:GITHUB_ENV

- name: Checkout the repo
uses: actions/checkout@v3.3.0
uses: actions/checkout@v4.1.7

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.3.1
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64

- name: Cache OpenSSL ${{env.ImageOS}} ${{env.ImageVersion}}
uses: actions/cache@v3.3.0
uses: actions/cache@v4.0.2
with:
path: |
external/OpenSSL
Expand Down
2 changes: 1 addition & 1 deletion external/OpenSSL/OpenSSL.Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Microsoft.P4VFS.External
{
public class OpensslModule : Module
{
private const string OPENSSL_VERSION = "1.1.1v";
private const string OPENSSL_VERSION = "3.3.1";
private const string PERL_PACKAGE_NAME = "StrawberryPerl";
private const string PERL_VERSION = "5.28.0.1";

Expand Down
6 changes: 3 additions & 3 deletions external/P4API/P4API.Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Microsoft.P4VFS.External
{
public class P4apiModule : Module
{
private const string P4API_VERSION = "r23.2";
private const string P4API_VERSION = "r24.1";
private const string P4API_VISUAL_STUDIO_EDITION = "2022";

public override string Name
Expand Down Expand Up @@ -86,11 +86,11 @@ public override void Restore()
Dictionary<string, string> checksums = ModuleInfo.LoadChecksumFile(checksumFilePath);

// Download and deploy the debug P4API
string p4apiDbgFile = ModuleInfo.DownloadFileToFolder($"{p4apiUrlRoot}/bin.ntx64/p4api_vs{p4apiVisualStudioEdition}_dyn_vsdebug_openssl1.1.1.zip", workingFolder, checksums);
string p4apiDbgFile = ModuleInfo.DownloadFileToFolder($"{p4apiUrlRoot}/bin.ntx64/p4api_vs{p4apiVisualStudioEdition}_dyn_vsdebug_openssl3.zip", workingFolder, checksums);
ExtractP4apiSDK(p4apiDbgFile, p4apiTargetFolder, $"x64.vs{visualStudioEdition}.dyn.debug");

// Download and deploy the release P4API
string p4apiRelFile = ModuleInfo.DownloadFileToFolder($"{p4apiUrlRoot}/bin.ntx64/p4api_vs{p4apiVisualStudioEdition}_dyn_openssl1.1.1.zip", workingFolder, checksums);
string p4apiRelFile = ModuleInfo.DownloadFileToFolder($"{p4apiUrlRoot}/bin.ntx64/p4api_vs{p4apiVisualStudioEdition}_dyn_openssl3.zip", workingFolder, checksums);
ExtractP4apiSDK(p4apiRelFile, p4apiTargetFolder, $"x64.vs{visualStudioEdition}.dyn.release");

// Download and deploy the perforce test binaries
Expand Down
2 changes: 1 addition & 1 deletion external/P4VFS/P4VFS.Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.P4VFS.External
{
public class P4vfsModule : Module
{
private const string P4VFS_SIGNED_VERSION = "1.27.0.0";
private const string P4VFS_SIGNED_VERSION = "1.28.0.0";
private const string P4VFS_SIGNED_ARTIFACTS_URL = "https://github.com/microsoft/p4vfs/releases/download";

public override string Name
Expand Down
12 changes: 6 additions & 6 deletions source/P4VFS.CodeSign/P4VFS.CodeSign.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -90,30 +90,30 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Azure.Core">
<Version>1.38.0</Version>
<Version>1.41.0</Version>
</PackageReference>
<PackageReference Include="Azure.Identity">
<Version>1.10.4</Version>
<Version>1.12.0</Version>
</PackageReference>
<PackageReference Include="Azure.Security.KeyVault.Secrets">
<Version>4.6.0</Version>
</PackageReference>
<PackageReference Include="Azure.Storage.Blobs">
<Version>12.19.1</Version>
<Version>12.21.1</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>13.0.3</Version>
</PackageReference>
<PackageReference Include="NuGet.CommandLine" GeneratePathProperty="true">
<Version>6.9.1</Version>
<Version>6.10.1</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="AfterBuild">
<Copy SourceFiles="$(OpenSSLApiLibDir)\libcrypto-1_1-x64.dll" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="$(OpenSSLApiLibDir)\libssl-1_1-x64.dll" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="$(OpenSSLApiLibDir)\libcrypto-3-x64.dll" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="$(OpenSSLApiLibDir)\libssl-3-x64.dll" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="$(P4VFSCoreBuildDir)\$(P4VFSConfiguration)\P4VFS.Core.dll" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="$(P4VFSCoreBuildDir)\$(P4VFSConfiguration)\P4VFS.Core.pdb" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="$(PkgNuGet_CommandLine)\tools\nuget.exe" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
Expand Down
4 changes: 2 additions & 2 deletions source/P4VFS.CodeSign/Resource/SignInputStaging.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@
"SignRequestFiles": [
{
"CustomerCorrelationId": "01A7F55F-6CDD-4123-B255-77E6F212CDAD",
"SourceLocation": "libcrypto-1_1-x64.dll"
"SourceLocation": "libcrypto-3-x64.dll"
},
{
"CustomerCorrelationId": "01A7F55F-6CDD-4123-B255-77E6F212CDAD",
"SourceLocation": "libssl-1_1-x64.dll"
"SourceLocation": "libssl-3-x64.dll"
}
],
"SigningInfo": {
Expand Down
2 changes: 1 addition & 1 deletion source/P4VFS.CodeSign/Source/EsrpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Microsoft.P4VFS.CodeSign
{
public class EsrpClient : ICodeSignClient
{
private const string _EsrpClientVersion = "1.2.85";
private const string _EsrpClientVersion = "1.2.102";
private const string _EsrpClientPkgSource = "https://microsoft.pkgs.visualstudio.com/_packaging/ESRP/nuget/v3/index.json";

public EsrpClient()
Expand Down
4 changes: 2 additions & 2 deletions source/P4VFS.Console/P4VFS.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="AfterBuild">
<Copy SourceFiles="$(OpenSSLApiLibDir)\libcrypto-1_1-x64.dll" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="$(OpenSSLApiLibDir)\libssl-1_1-x64.dll" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="$(OpenSSLApiLibDir)\libcrypto-3-x64.dll" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="$(OpenSSLApiLibDir)\libssl-3-x64.dll" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="$(P4VFSCoreBuildDir)\$(P4VFSConfiguration)\P4VFS.Core.dll" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="$(P4VFSCoreBuildDir)\$(P4VFSConfiguration)\P4VFS.Core.pdb" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
</Target>
Expand Down
11 changes: 11 additions & 0 deletions source/P4VFS.Console/P4VFS.Notes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
Microsoft P4VFS Release Notes

Version [1.28.0.0]
* Addition of 'dehydrate' command as synonym for 'resident -v', for changing existing
files from #have to zero-byte placeholder files. Unit tests included.
* Fixing support for p4vfsflt driver backwards compatibility for Windows Server 2019 and
earlier, including Windows prior to Windows 10 version 2004. This addressed
down-level compatibility new zeroed allocation API's such as ExAllocatePool2
* Fixing bug causing some perforce sync errors not to be shown when doing a quite
single mode sync, such as 'populate', or 'sync -q -m Single'
* Update to P4API 2024.1 and OpenSSL 3.3.1. UnitTest now uses p4d.exe/p4.exe 2024.1
* Virtual sync details at the start of sync operation now write to StdOut instead of StdErr

Version [1.27.1.0]
* Now also ignoring specdef tag from P4API results, similar to P4API.NET
* The P4VFS install now configures the driver as allowed by Windows DevDrive, and
Expand Down
11 changes: 10 additions & 1 deletion source/P4VFS.Console/Source/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,12 @@ the service settings by name or substring.
p4vfs set [SettingName|SubString]
"},

{"resident,hydrate", @"
{"resident,hydrate,dehydrate", @"
resident Modify current resident status of local files. This can be used
to change existing files back to virtual state (zero downloaded size),
or change files to a resident state (full downloaded size).
hydrate Synonym for 'resident -r'
dehydrate Synonym for 'resident -v'

p4vfs resident [-r -v -x <csx> -p <reg>] [file ...]

Expand Down Expand Up @@ -337,6 +338,9 @@ public static int Main(string[] args)
case "hydrate":
status = CommandHydrate(cmdArgs);
break;
case "dehydrate":
status = CommandDehydrate(cmdArgs);
break;
case "populate":
status = CommandPopulate(cmdArgs);
break;
Expand Down Expand Up @@ -817,6 +821,11 @@ private static bool CommandHydrate(string[] args)
return CommandResident(new[]{"-r"}.Concat(args).ToArray());
}

private static bool CommandDehydrate(string[] args)
{
return CommandResident(new[]{"-v"}.Concat(args).ToArray());
}

private static bool CommandMonitor(string[] args)
{
bool show = args.Any(arg => Regex.Match("^(-s)|(-?show)$", arg).Success);
Expand Down
2 changes: 1 addition & 1 deletion source/P4VFS.Core/Include/DepotClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace P4 {

P4VFS_CORE_API LogDevice* Log();
P4VFS_CORE_API void Log(LogChannel::Enum channel, const DepotString& text);
P4VFS_CORE_API bool IsFaulted() const;
P4VFS_CORE_API bool IsFaulted();

struct Flags { enum Enum
{
Expand Down
8 changes: 4 additions & 4 deletions source/P4VFS.Core/Include/FileCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ namespace FileCore {
typedef AString TString;
typedef char TChar;

static char* Literal(char* A, wchar_t* W) { return A; }
static char Literal(char A, wchar_t W) { return A; }
static const char* Literal(const char* A, const wchar_t* W) { return A; }
static const char Literal(const char A, const wchar_t W) { return A; }
};

template <> struct Type<wchar_t>
Expand All @@ -371,8 +371,8 @@ namespace FileCore {
typedef WString TString;
typedef wchar_t TChar;

static wchar_t* Literal(char* A, wchar_t* W) { return W; }
static wchar_t Literal(char A, wchar_t W) { return W; }
static const wchar_t* Literal(const char* A, const wchar_t* W) { return W; }
static const wchar_t Literal(const char A, const wchar_t W) { return W; }
};
};

Expand Down
45 changes: 45 additions & 0 deletions source/P4VFS.Core/Include/LogDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,29 +77,60 @@ namespace FileCore {
WriteLine(LogChannel::Verbose, text);
}

template <typename TString>
static void Verbose(LogDevice* log, const TString& text)
{
WriteLine(log, LogChannel::Verbose, text);
}

template <typename TString>
void Info(const TString& text)
{
WriteLine(LogChannel::Info, text);
}

template <typename TString>
static void Info(LogDevice* log, const TString& text)
{
WriteLine(log, LogChannel::Info, text);
}

template <typename TString>
void Warning(const TString& text)
{
WriteLine(LogChannel::Warning, text);
}

template <typename TString>
static void Warning(LogDevice* log, const TString& text)
{
WriteLine(log, LogChannel::Warning, text);
}

template <typename TString>
void Error(const TString& text)
{
WriteLine(LogChannel::Error, text);
}

template <typename TString>
static void Error(LogDevice* log, const TString& text)
{
WriteLine(log, LogChannel::Error, text);
}

template <typename TString>
static void WriteLine(LogDevice* log, LogChannel::Enum channel, const TString& text)
{
if (log != nullptr)
{
log->WriteLine(channel, text);
}
}

static bool IsFaulted(LogDevice* log)
{
return log != nullptr && log->IsFaulted();
}
};

Expand Down Expand Up @@ -156,6 +187,20 @@ namespace FileCore {
Array<LogDevice*> m_Devices;
};

struct LogDeviceFilter : LogDevice
{
LogDeviceFilter(LogDevice* device, LogChannel::Enum level = LogChannel::Enum(0));

void SetLevel(LogChannel::Enum level);
LogChannel::Enum GetLevel() const;

virtual void Write(const LogElement& element) override;
virtual bool IsFaulted() override;

LogDevice* m_InnerDevice;
LogChannel::Enum m_Level;
};

class LogSystem : public LogDevice
{
public:
Expand Down
9 changes: 3 additions & 6 deletions source/P4VFS.Core/Source/DepotClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -996,15 +996,12 @@ LogDevice* FDepotClient::Log()

void FDepotClient::Log(LogChannel::Enum channel, const DepotString& text)
{
if (m_P4->m_FileContext && m_P4->m_FileContext->m_LogDevice)
{
m_P4->m_FileContext->m_LogDevice->WriteLine(channel, text);
}
LogDevice::WriteLine(Log(), channel, text);
}

bool FDepotClient::IsFaulted() const
bool FDepotClient::IsFaulted()
{
return m_P4->m_FileContext && m_P4->m_FileContext->m_LogDevice && m_P4->m_FileContext->m_LogDevice->IsFaulted();
return LogDevice::IsFaulted(Log());
}

FDepotClient::Flags::Enum FDepotClient::GetFlags() const
Expand Down
12 changes: 9 additions & 3 deletions source/P4VFS.Core/Source/DepotOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ DepotOperations::SyncVirtual(
}
}

depotClient->Log(LogChannel::Warning, StringInfo::Join(DepotStringArray{ "Virtual Sync:", ToString(syncOptions.m_Files), DepotSyncFlags::ToString(syncOptions.m_SyncFlags), DepotFlushType::ToString(syncOptions.m_FlushType), revision->ToString() }, " "));
depotClient->Log(LogChannel::Info, StringInfo::Join(DepotStringArray{ "Virtual Sync:", ToString(syncOptions.m_Files), DepotSyncFlags::ToString(syncOptions.m_SyncFlags), DepotFlushType::ToString(syncOptions.m_FlushType), revision->ToString() }, " "));
depotClient->Log(LogChannel::Info, StringInfo::Format("Started at [%s] version [%s]", DepotDateTime::Now().ToDisplayString().c_str(), CSTR_WTOA(FileSystem::GetModuleVersion())));
if (depotClient->IsFaulted())
{
Expand Down Expand Up @@ -665,7 +665,7 @@ DepotOperations::Reconfig(

if (hr != S_OK)
{
LogDevice::WriteLine(log, LogChannel::Error, StringInfo::Format("Failed to reconfig file '%s' with error [%s]", clientFile.c_str(), CSTR_WTOA(StringInfo::ToString(hr))));
LogDevice::Error(log, StringInfo::Format("Failed to reconfig file '%s' with error [%s]", clientFile.c_str(), CSTR_WTOA(StringInfo::ToString(hr))));
status = false;
}
}
Expand Down Expand Up @@ -792,10 +792,16 @@ DepotOperations::SyncCommand(
return nullptr;
}

if (log == nullptr && (syncFlags & DepotSyncFlags::Quiet) == 0)
if (log == nullptr)
{
log = depotClient->Log();
}

LogDeviceFilter quietLog(log, syncFlags & DepotSyncFlags::Flush ? LogChannel::Error : LogChannel::Warning);
if (syncFlags & DepotSyncFlags::Quiet)
{
log = &quietLog;
}

auto reportError = [&](const DepotString& context) -> void
{
Expand Down
2 changes: 1 addition & 1 deletion source/P4VFS.Core/Source/FileCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ WString StringInfo::Escape(const wchar_t* s, EscapeDirection::Enum direction)
const Encoding text[] = { {TEXT("\\\""), TEXT("\"")}, {TEXT("\\\\"), TEXT("\\")}, {TEXT("\\n"), TEXT("\n")}, {TEXT("\\r"), TEXT("\r")}, {TEXT("\\t"), TEXT("\t")} };
const int32_t src = (direction == EscapeDirection::Encode ? 1 : 0);
const int32_t dst = src ^ 1;
while (s != TEXT('\0'))
while (*s != TEXT('\0'))
{
size_t i = 0;
for (; i < _countof(text); ++i)
Expand Down
19 changes: 19 additions & 0 deletions source/P4VFS.Core/Source/LogDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,25 @@ bool LogDeviceAggregate::IsFaulted()
return false;
}

LogDeviceFilter::LogDeviceFilter(LogDevice* device, LogChannel::Enum level) :
m_InnerDevice(device),
m_Level(level)
{
}

void LogDeviceFilter::Write(const LogElement& element)
{
if (m_InnerDevice != nullptr && element.m_Channel >= m_Level)
{
m_InnerDevice->Write(element);
}
}

bool LogDeviceFilter::IsFaulted()
{
return m_InnerDevice != nullptr ? m_InnerDevice->IsFaulted() : false;
}

LogSystem::LogSystem() :
m_WriteThread(NULL),
m_WriteMutex(NULL),
Expand Down
Loading