Skip to content

Commit

Permalink
Mwasplund/cryptopp (#123)
Browse files Browse the repository at this point in the history
* Convert to CryptoPP with Sha1
* Update scripts
* Remove submodules
* Update docs
* Bump version
  • Loading branch information
mwasplund authored Apr 20, 2022
1 parent 1208358 commit f6cf50f
Show file tree
Hide file tree
Showing 20 changed files with 25 additions and 146 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
run: swhere
- name: Soup Restore
run: soup restore ./Soup/Source/Client/CLI/ -v:d
# TODO: Disabled for openssl - name: Soup Build
# run: soup build ./Soup/Source/Client/CLI/ -v:d -flavor ${{matrix.config}}
- name: Soup Build
run: soup build ./Soup/Source/Client/CLI/ -v:d -flavor ${{matrix.config}}

# Build Samples
- name: Soup Restore Cpp BuildExtension
Expand Down
6 changes: 0 additions & 6 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion Dependencies/Detours
Submodule Detours deleted from 245c93
1 change: 0 additions & 1 deletion Dependencies/openssl
Submodule openssl deleted from b971d4
20 changes: 3 additions & 17 deletions Docs/Developer-Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@
## Requirements
* Windows 10
* Build Tools
* [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/) with "Desktop development with c++" workload.
* [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/) with "Desktop development with c++" workload.
* OR
* [Build Tools For Visual Studio 2019](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019) with "c++ build tools" workload.
* [Latest Release](https://github.com/mwasplund/Soup/releases)

### OpenSSL Requirements
* Perl. We recommend Strawberry https://strawberryperl.com/download/5.30.3.1/strawberry-perl-5.30.3.1-64bit.msi
* Netwide Assembler, a.k.a. NASM, available from https://www.nasm.us
* [Build Tools For Visual Studio 2022](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022) with "c++ build tools" workload.
* [Latest Release](https://github.com/SoupBuild/Soup/releases)

## Setup
Clone the repository and all submodules recursively.
Expand All @@ -21,16 +17,6 @@ git clone --recursive https://github.com/mwasplund/Soup.git

## Build

### Build openssl
using x64 Native Tools Command Prompt for VS 2022
```
cd Dependencies/openssl
PATH=%PATH%;"C:\NASM"
perl Configure VC-WIN64A
nmake
nmake test
```

### Build the Client
```
cd Source/Client
Expand Down
4 changes: 2 additions & 2 deletions Scripts/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ SET ClientCLIDir=%SourceDir%\Client\CLI
SET ExtensionCppDir=%SourceDir%\GenerateSharp\Extensions\Cpp\Extension
SET ExtensionCSharpDir=%SourceDir%\GenerateSharp\Extensions\CSharp\Extension
SET MonitorClientDir=%SourceDir%\Monitor\Client
if %Flavor% == release (SET OutputX64DirectorPath=1281a639dd5d393781f4188942c6bc05544b7c2c0124eae4cc59236248e36) else (SET OutputX64DirectorPath=3d80717e7d2695f0a7aa5c38e2849624beeaa5714331ca96898fe4b8b8023fe)
if %Flavor% == release (SET OutputX86DirectorPath=a15736f28dbf78415c82858ab76573eb6efdf98c85e3d67b3984210f54747) else (SET OutputX86DirectorPath=9e1e87dea39eeb349e44752a9a37cdf3ed1c2e7aea3044a45ed8bb44609efd)
if %Flavor% == release (SET OutputX64DirectorPath=txTMowfPh1V3rPmbvNBmBW9Z8Jg) else (SET OutputX64DirectorPath=J3mu4cpISw6nDaCPED8gkqZ-q84)
if %Flavor% == release (SET OutputX86DirectorPath=ci_UJP5zJKyF-O0VVSVDMNi1Wwg) else (SET OutputX86DirectorPath=9e1e87dea39eeb349e44752a9a37cdf3ed1c2e7aea3044a45ed8bb44609efd)
SET ClientCLIOutputDirectory=%OutputDir%\C++\Soup\%OutputX64DirectorPath%
SET MonitorClientOutputX64Directory=%OutputDir%\C++\Monitor.Client\%OutputX64DirectorPath%
SET MonitorClientOutputX86Directory=%OutputDir%\C++\Monitor.Client\%OutputX86DirectorPath%
Expand Down
6 changes: 3 additions & 3 deletions Scripts/soup.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ SET OutDir=%RootDir%\out
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%\C++\Soup\1281a639dd5d393781f4188942c6bc05544b7c2c0124eae4cc59236248e36\bin\ %RunDir%\Soup\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\C++\Soup\txTMowfPh1V3rPmbvNBmBW9Z8Jg\bin\ %RunDir%\Soup\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\msbuild\bin\Soup.Build.Generate\Release\net5.0\ %RunDir%\Soup\Generate\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\C#\Soup.Cpp\1281a639dd5d393781f4188942c6bc05544b7c2c0124eae4cc59236248e36\bin %RunDir%\Soup\Generate\Extensions\Soup.Cpp\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\C#\Soup.CSharp\1281a639dd5d393781f4188942c6bc05544b7c2c0124eae4cc59236248e36\bin %RunDir%\Soup\Generate\Extensions\Soup.CSharp\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\C#\Soup.Cpp\txTMowfPh1V3rPmbvNBmBW9Z8Jg\bin %RunDir%\Soup\Generate\Extensions\Soup.Cpp\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\C#\Soup.CSharp\txTMowfPh1V3rPmbvNBmBW9Z8Jg\bin %RunDir%\Soup\Generate\Extensions\Soup.CSharp\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\msbuild\bin\Soup.Build.PackageManager\Release\net5-windows10.0.17763.0\ %RunDir%\Soup\PackageManager\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\msbuild\bin\Swhere\Release\net5-windows10.0.17763.0\ %RunDir%\Swhere\ /MIR /NJH /NJS /NDL > NUL
%RunDir%\Soup.cmd %*
6 changes: 3 additions & 3 deletions Scripts/soupd.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ SET OutDir=%RootDir%\out
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%\C++\Soup\3d80717e7d2695f0a7aa5c38e2849624beeaa5714331ca96898fe4b8b8023fe\bin\ %RunDir%\Soup\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\C++\Soup\J3mu4cpISw6nDaCPED8gkqZ-q84\bin\ %RunDir%\Soup\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\msbuild\bin\Soup.Build.Generate\Debug\net5.0\ %RunDir%\Soup\Generate\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\C#\Soup.Cpp\3d80717e7d2695f0a7aa5c38e2849624beeaa5714331ca96898fe4b8b8023fe\bin %RunDir%\Soup\Generate\Extensions\Soup.Cpp\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\C#\Soup.CSharp\3d80717e7d2695f0a7aa5c38e2849624beeaa5714331ca96898fe4b8b8023fe\bin %RunDir%\Soup\Generate\Extensions\Soup.CSharp\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\C#\Soup.Cpp\J3mu4cpISw6nDaCPED8gkqZ-q84\bin %RunDir%\Soup\Generate\Extensions\Soup.Cpp\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\C#\Soup.CSharp\J3mu4cpISw6nDaCPED8gkqZ-q84\bin %RunDir%\Soup\Generate\Extensions\Soup.CSharp\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\msbuild\bin\Soup.Build.PackageManager\Debug\net5-windows10.0.17763.0\ %RunDir%\Soup\PackageManager\ /MIR /NJH /NJS /NDL > NUL
robocopy %OutDir%\msbuild\bin\Swhere\Debug\net5-windows10.0.17763.0\ %RunDir%\Swhere\ /MIR /NJH /NJS /NDL > NUL
%RunDir%\Soup.cmd %*
3 changes: 2 additions & 1 deletion Source/Client/CLI/PackageLock.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
"C++" = [
{ Name = "Soup", Version = "./" },
{ Name = "Soup.Core", Version = "../Core/" },
{ Name = "CryptoPP", Version = "[email protected]" },
{ Name = "json11", Version = "[email protected]" },
{ Name = "Opal", Version = "[email protected]" },
{ Name = "toml11", Version = "[email protected]" },
{ Name = "Monitor.Host", Version = "../../Monitor/Host/" },
{ Name = "Detours", Version = "../../../Dependencies/Detours/src/" },
{ Name = "Detours", Version = "[email protected]" },
{ Name = "Monitor.Shared", Version = "../../../Monitor/Shared/" },
{ Name = "Soup.Test.Assert", Version = "[email protected]" },
{ Name = "copy", Version = "../../Tools/Copy/" },
Expand Down
2 changes: 1 addition & 1 deletion Source/Client/CLI/Recipe.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name = "Soup"
Language = "C++"
Version = "0.17.6"
Version = "0.18.0"
Type = "Executable"

Source = [
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.17.6");
Log::HighPriority("0.18.0");
}

private:
Expand Down
13 changes: 1 addition & 12 deletions Source/Client/Core/Recipe.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,12 @@ Defines = [
]
IncludePaths = [
"Source/",
"../../../Dependencies/OpenSSL/include/",
]
Interface = "Source/Module.cpp"
Source = [
"Source/ValueTable/Value.cpp",
]

LinkLibraries = [
# Link against the dynamic libraries
"../../../Dependencies/OpenSSL/libcrypto.lib",
"../../../Dependencies/OpenSSL/libssl.lib",
]
RuntimeDependencies = [
# Copy the dynamic libraries
"../../../Dependencies/OpenSSL/libcrypto-3-x64.dll",
"../../../Dependencies/OpenSSL/libssl-3-x64.dll",
]

[Dependencies]
Build = [
# "[email protected]",
Expand All @@ -34,6 +22,7 @@ Runtime = [
"[email protected]",
"[email protected]",
"../../Monitor/Host/",
"[email protected]",
]
Test = [
"[email protected]",
Expand Down
3 changes: 1 addition & 2 deletions Source/Client/Core/Source/Build/RecipeBuildRunner.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "OperationGraph/OperationGraphManager.h"
#include "Utils/HandledException.h"
#include "ValueTable/ValueTableManager.h"
#include "Sha3_256.h"
#include "Recipe/RecipeBuildStateConverter.h"
#include "PathList/PathListManager.h"

Expand Down Expand Up @@ -121,7 +120,7 @@ namespace Soup::Core
// Add unique folder name for parameters
auto parametersStream = std::stringstream();
ValueTableWriter::Serialize(globalParameters, parametersStream);
auto hashParameters = Sha3_256::HashBase64(parametersStream.str());
auto hashParameters = CryptoPP::Sha1::HashBase64(parametersStream.str());
auto uniqueParametersFolder = Path(hashParameters + "/");
rootOutput = rootOutput + uniqueParametersFolder;

Expand Down
3 changes: 1 addition & 2 deletions Source/Client/Core/Source/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@
#undef min
#undef CreateProcess

#include <openssl/evp.h>

export module Soup.Core;

import CryptoPP;
import json11;
import toml11;
import Monitor.Host;
Expand Down
87 changes: 0 additions & 87 deletions Source/Client/Core/Source/Sha3_256.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"Soup.Build.Generate": {
"commandName": "Project",
"commandLineArgs": "C:\\Users\\mwasp\\source\\repos\\SoupTest\\out\\C++\\Cpp.Sample\\3d80717e7d2695f0a7aa5c38e2849624beeaa5714331ca96898fe4b8b8023fe\\.soup\\"
"commandLineArgs": "C:\\Users\\mwasp\\source\\repos\\SoupTest\\out\\C++\\Cpp.Sample\\J3mu4cpISw6nDaCPED8gkqZ-q84\\.soup\\"
}
}
}
2 changes: 1 addition & 1 deletion Source/Installer/SoupInstaller/Setup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static public void Main()
};

// Upgrade values
project.Version = new Version(0, 17, 5);
project.Version = new Version(0, 18, 0);

Compiler.BuildMsi(project);
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Monitor/Client/Recipe.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Source = [

[Dependencies]
Runtime = [
"../../../Dependencies/Detours/src/",
"[email protected]",
"../Shared/",
"[email protected]"
]
2 changes: 1 addition & 1 deletion Source/Monitor/Host/Recipe.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Interface = "Module.cpp"

[Dependencies]
Runtime = [
"../../../Dependencies/Detours/src/",
"[email protected]",
"../Shared/",
"[email protected]",
]
2 changes: 1 addition & 1 deletion Source/Monitor/Log/Recipe.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Source = [

[Dependencies]
Runtime = [
"../../../Dependencies/Detours/src/",
"[email protected]",
"[email protected]",
"../Shared/",
]

0 comments on commit f6cf50f

Please sign in to comment.