Skip to content

Commit

Permalink
Use File Time (#168)
Browse files Browse the repository at this point in the history
* Convert to using file time

* Move force rebuild into evaluate engine

* Bump minor version

* Update Opal with File Times

* Load Operation Results into Soup View

* Update graph properties

* Test for duplicate output files

* Store input lookup state

* Pass in Operation graph to make testing easier

* Add checks for circular operations

* Update to use single try call for last write time

* Rename recipe build runner

* Convert to System interface

* Add ability to simulate IDetourCallback events

* Add check for multiple operations write to single file

* Add checks for new output dependency

* Add checks for observed input that is an output

* Add check for input output within single operation

* Normalize file system state paths

* Remove internal circular dependencies for now

* Delay load lookup tables

Co-authored-by: Matthew Asplund <mwasplund@outlook.com>
  • Loading branch information
mwasplund and Matthew Asplund authored Nov 21, 2022
1 parent aa3c192 commit 7c05a53
Show file tree
Hide file tree
Showing 68 changed files with 2,943 additions and 710 deletions.
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
"format": "cpp",
"*.tcc": "cpp",
"cinttypes": "cpp",
"memory_resource": "cpp"
"memory_resource": "cpp",
"ranges": "cpp",
"span": "cpp"
}
}
2 changes: 1 addition & 1 deletion Scripts/build-client.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SET ClientCLIDir=%SourceDir%\Client\CLI
SET MonitorClientDir=%SourceDir%\Monitor\Client
if %Flavor% == release (SET OutputX64DirectorPath=txTMowfPh1V3rPmbvNBmBW9Z8Jg) else (SET OutputX64DirectorPath=J3mu4cpISw6nDaCPED8gkqZ-q84)
if %Flavor% == release (SET OutputX86DirectorPath=ci_UJP5zJKyF-O0VVSVDMNi1Wwg) else (SET OutputX86DirectorPath=9fr4dmE4CrAXgS2yFzcvYJXkGDg)
SET ClientCLIOutputDirectory=%OutputDir%\Cpp\Soup\0.26.1\%OutputX64DirectorPath%
SET ClientCLIOutputDirectory=%OutputDir%\Cpp\Soup\0.27.0\%OutputX64DirectorPath%
SET MonitorClientOutputX64Directory=%OutputDir%\Cpp\Monitor.Client\1.0.0\%OutputX64DirectorPath%
SET MonitorClientOutputX86Directory=%OutputDir%\Cpp\Monitor.Client\1.0.0\%OutputX86DirectorPath%

Expand Down
2 changes: 1 addition & 1 deletion Scripts/soup.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SET RunDir=%OutDir%\run

REM - Use a copy of the final binary in case we are re-buiding itself
robocopy %ScriptsDir%\Install\ %RunDir%\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\Cpp\Soup\0.26.1\txTMowfPh1V3rPmbvNBmBW9Z8Jg\bin\ %RunDir%\Soup\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\Cpp\Soup\0.27.0\txTMowfPh1V3rPmbvNBmBW9Z8Jg\bin\ %RunDir%\Soup\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\msbuild\bin\Soup.Build.Generate\Release\net6.0\win-x64\publish\ %RunDir%\Soup\Generate\ /MIR /NJH /NJS /NDL > NUL
robocopy C:\Users\mwasp\.soup\out\CSharp\Soup.Cpp\0.4.0\txTMowfPh1V3rPmbvNBmBW9Z8Jg\bin\ %RunDir%\Soup\Extensions\Soup.Cpp\0.4.0\ /MIR /NJH /NJS /NDL > NUL
robocopy C:\Users\mwasp\.soup\out\CSharp\Soup.CSharp\0.7.0\txTMowfPh1V3rPmbvNBmBW9Z8Jg\bin\ %RunDir%\Soup\Extensions\Soup.CSharp\0.7.0\ /MIR /NJH /NJS /NDL > NUL
Expand Down
2 changes: 1 addition & 1 deletion Scripts/soupd.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SET RunDir=%OutDir%\run

REM - Use a copy of the final binary in case we are re-buiding itself
robocopy %ScriptsDir%\Install\ %RunDir%\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\Cpp\Soup\0.26.1\J3mu4cpISw6nDaCPED8gkqZ-q84\bin\ %RunDir%\Soup\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\Cpp\Soup\0.27.0\J3mu4cpISw6nDaCPED8gkqZ-q84\bin\ %RunDir%\Soup\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\msbuild\bin\Soup.Build.Generate\Debug\net6.0\win-x64\publish\ %RunDir%\Soup\Generate\ /MIR /NJH /NJS /NDL > NUL
robocopy C:\Users\mwasp\.soup\out\CSharp\Soup.Cpp\0.4.0\J3mu4cpISw6nDaCPED8gkqZ-q84\bin\ %RunDir%\Soup\Extensions\Soup.Cpp\0.4.0\ /MIR /NJH /NJS /NDL > NUL
robocopy C:\Users\mwasp\.soup\out\CSharp\Soup.CSharp\0.7.0\J3mu4cpISw6nDaCPED8gkqZ-q84\bin\ %RunDir%\Soup\Extensions\Soup.CSharp\0.7.0\ /MIR /NJH /NJS /NDL > NUL
Expand Down
2 changes: 1 addition & 1 deletion Source/Client/CLI/PackageLock.sml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Closures: {
{ Name: "mkdir", Version: "../../Tools/Mkdir/", Build: "Build0" }
{ Name: "Monitor.Host", Version: "../../Monitor/Host/", Build: "Build0" }
{ Name: "Monitor.Shared", Version: "../../Monitor/Shared/", Build: "Build0" }
{ Name: "Opal", Version: "0.5.1", Build: "Build0" }
{ Name: "Opal", Version: "0.7.1", Build: "Build0" }
{ Name: "reflex", Version: "1.0.1", Build: "Build0" }
{ Name: "Soup", Version: "../CLI", Build: "Build0" }
{ Name: "Soup.Core", Version: "../Core/", Build: "Build1" }
Expand Down
2 changes: 1 addition & 1 deletion Source/Client/CLI/Recipe.sml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: "Soup"
Version: "0.26.1"
Version: "0.27.0"
Language: "C++|0.1"

Type: "Executable"
Expand Down
4 changes: 2 additions & 2 deletions Source/Client/CLI/Source/Commands/BuildCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace Soup::Client
if (_options.Path.empty())
{
// Build in the current directory
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory2();
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory();
}
else
{
Expand All @@ -43,7 +43,7 @@ namespace Soup::Client
// Check if this is relative to current directory
if (!workingDirectory.HasRoot())
{
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory2() + workingDirectory;
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory() + workingDirectory;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Client/CLI/Source/Commands/InitializeCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace Soup::Client
Log::HighPriority("The initialize utility will walk through the creation of the most basic Console recipe.\n");

// Use the current directory as the default names
auto workingDirectory = System::IFileSystem::Current().GetCurrentDirectory2();
auto workingDirectory = System::IFileSystem::Current().GetCurrentDirectory();
auto recipePath =
workingDirectory +
Core::BuildConstants::RecipeFileName();
Expand Down
4 changes: 2 additions & 2 deletions Source/Client/CLI/Source/Commands/InstallCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace Soup::Client
if (_options.Path.empty())
{
// Build in the current directory
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory2();
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory();
}
else
{
Expand All @@ -42,7 +42,7 @@ namespace Soup::Client
// Check if this is relative to current directory
if (!workingDirectory.HasRoot())
{
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory2() + workingDirectory;
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory() + workingDirectory;
}
}

Expand Down
4 changes: 2 additions & 2 deletions Source/Client/CLI/Source/Commands/PublishCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace Soup::Client
if (_options.Path.empty())
{
// Buildin the current directory
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory2();
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory();
}
else
{
Expand All @@ -42,7 +42,7 @@ namespace Soup::Client
// Check if this is relative to current directory
if (!workingDirectory.HasRoot())
{
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory2() + workingDirectory;
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory() + workingDirectory;
}
}

Expand Down
4 changes: 2 additions & 2 deletions Source/Client/CLI/Source/Commands/RestoreCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace Soup::Client
if (_options.Path.empty())
{
// Build in the current directory
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory2();
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory();
}
else
{
Expand All @@ -42,7 +42,7 @@ namespace Soup::Client
// Check if this is relative to current directory
if (!workingDirectory.HasRoot())
{
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory2() + workingDirectory;
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory() + workingDirectory;
}
}

Expand Down
4 changes: 2 additions & 2 deletions Source/Client/CLI/Source/Commands/RunCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace Soup::Client
if (_options.Path.empty())
{
// Buildin the current directory
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory2();
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory();
}
else
{
Expand All @@ -42,7 +42,7 @@ namespace Soup::Client
// Check if this is relative to current directory
if (!workingDirectory.HasRoot())
{
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory2() + workingDirectory;
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory() + workingDirectory;
}
}

Expand Down
4 changes: 2 additions & 2 deletions Source/Client/CLI/Source/Commands/TargetCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace Soup::Client
if (_options.Path.empty())
{
// Buildin the current directory
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory2();
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory();
}
else
{
Expand All @@ -42,7 +42,7 @@ namespace Soup::Client
// Check if this is relative to current directory
if (!workingDirectory.HasRoot())
{
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory2() + workingDirectory;
workingDirectory = System::IFileSystem::Current().GetCurrentDirectory() + workingDirectory;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Client/CLI/Source/Commands/VersionCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace Soup::Client

// TODO var version = Assembly.GetExecutingAssembly().GetName().Version;
// Log::Message($"{version.Major}.{version.Minor}.{version.Build}");
Log::HighPriority("0.26.1");
Log::HighPriority("0.27.0");
}

private:
Expand Down
1 change: 1 addition & 0 deletions Source/Client/CLI/Source/Program.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ namespace Soup::Client
false));

// Setup the real services
System::ISystem::Register(std::make_shared<System::STLSystem>());
System::IFileSystem::Register(std::make_shared<System::STLFileSystem>());
System::IProcessManager::Register(std::make_shared<System::WindowsProcessManager>());
Monitor::IDetourProcessManager::Register(std::make_shared<Monitor::WindowsDetourProcessManager>());
Expand Down
10 changes: 6 additions & 4 deletions Source/Client/Core/Source/Build/BuildEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// </copyright>

#pragma once
#include "RecipeBuildRunner.h"
#include "BuildRunner.h"
#include "BuildEvaluateEngine.h"
#include "BuildLoadEngine.h"
#include "LocalUserConfig/LocalUserConfigExtensions.h"
Expand Down Expand Up @@ -92,14 +92,16 @@ namespace Soup::Core
auto fileSystemState = FileSystemState();

// Initialize a shared Evaluate Engine
auto evaluateEngine = BuildEvaluateEngine(fileSystemState);
auto evaluateEngine = BuildEvaluateEngine(
arguments.ForceRebuild,
fileSystemState);

// Initialize shared location manager
auto locationManager = RecipeBuildLocationManager(builtInLanguages);

// Initialize the build runner that will perform the generate and evaluate phase
// for each individual package
auto buildRunner = RecipeBuildRunner(
auto buildRunner = BuildRunner(
arguments,
sdkParameters,
sdkReadAccess,
Expand All @@ -114,7 +116,7 @@ namespace Soup::Core
endTime = std::chrono::high_resolution_clock::now();
duration = std::chrono::duration_cast<std::chrono::duration<double>>(endTime - startTime);

// std::cout << "RecipeBuildRunner: " << std::to_string(duration.count()) << " seconds." << std::endl;
// std::cout << "BuildRunner: " << std::to_string(duration.count()) << " seconds." << std::endl;
}

private:
Expand Down
Loading

0 comments on commit 7c05a53

Please sign in to comment.