Skip to content

Commit

Permalink
Start to convert to partitions (#298)
Browse files Browse the repository at this point in the history
* Fix installer and sign all dlls

* Update c++ build

* Update package version
  • Loading branch information
mwasplund authored Jan 26, 2025
1 parent f99c893 commit 7a64097
Show file tree
Hide file tree
Showing 114 changed files with 691 additions and 1,040 deletions.
4 changes: 2 additions & 2 deletions code/bench-tests/PackageLock.sml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Closures: {
}
Build0: {
Wren: {
'Soup|Cpp': { Version: 0.13.2 }
'Soup|Cpp': { Version: 0.14.0 }
}
}
Build1: {
Wren: {
'Soup|Cpp': { Version: 0.13.2 }
'Soup|Cpp': { Version: 0.14.0 }
'mwasplund|Soup.Test.Cpp': { Version: 0.11.0 }
}
}
Expand Down
6 changes: 3 additions & 3 deletions code/client/cli/PackageLock.sml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ Closures: {
}
Build0: {
Wren: {
'Soup|Cpp': { Version: 0.13.2 }
'Soup|Cpp': { Version: 0.14.0 }
}
}
Build1: {
Wren: {
'Soup|Cpp': { Version: 0.13.2 }
'mwasplund|Soup.Test.Cpp': { Version: 0.12.0 }
'Soup|Cpp': { Version: 0.14.0 }
'mwasplund|Soup.Test.Cpp': { Version: 0.13.0 }
}
}
Build2: {
Expand Down
50 changes: 0 additions & 50 deletions code/client/cli/source/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,62 +16,12 @@
#include <string>
#include <vector>

#ifdef SOUP_BUILD

import Monitor.Host;
import Opal;
import Soup.Core;

using namespace Opal;

#else

// import Opal
#include <algorithm>
#include <array>
#include <atomic>
#include <chrono>
#include <functional>
#include <fstream>
#include <filesystem>
#include <iostream>
#include <locale>
#include <map>
#include <optional>
#include <queue>
#include <sstream>
#include <string>

#include <spawn.h>
#include <sys/wait.h>

#include "utilities/Path.h"
#include "utilities/SemanticVersion.h"
#include "io/SystemConsoleManager.h"
#include "logger/Log.h"
#include "logger/ConsoleTraceListener.h"
#include "system/LinuxProcessManager.h"
#include "system/STLFileSystem.h"
#include "system/STLSystem.h"

using namespace Opal;

// import CryptoPP
#include "Interface.h"

// import Monitor.Host
#include "linux/LinuxMonitorProcessManager.h"

// import Soup.Core
#include <cstring>
#include <regex>
#include <set>
#include <variant>
#include "build/BuildEngine.h"
#include "package/PackageManager.h"

#endif

#include "Program.h"

int main(int argc, char** argv)
Expand Down
19 changes: 18 additions & 1 deletion code/client/core/Recipe.sml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,24 @@ Interface: 'source/Module.cpp'
Source: [
'source/recipe/LanguageReferenceParser.cpp'
'source/sml/SMLParser.cpp'
'source/value-table/Value.cpp'
]
Partitions: [
{ Source: 'source/build/BuildConstants.cpp' }
{ Source: 'source/build/BuildFailedException.cpp' }
{ Source: 'source/build/DependencyTargetSet.cpp' }
{ Source: 'source/build/FileSystemState.cpp' }
{ Source: 'source/build/KnownLanguage.cpp' }
{ Source: 'source/build/MacroManager.cpp' }
{ Source: 'source/build/RecipeBuildCacheState.cpp' }
{ Source: 'source/build/SystemAccessTracker.cpp' }
{ Source: 'source/operation-graph/CommandInfo.cpp' }
{ Source: 'source/recipe/LanguageReference.cpp' }
{ Source: 'source/recipe/PackageIdentifier.cpp', Imports: [ 'source/recipe/PackageName.cpp' ] }
{ Source: 'source/recipe/PackageName.cpp' }
{ Source: 'source/recipe/PackageReference.cpp', Imports: [ 'source/recipe/PackageIdentifier.cpp' ] }
{ Source: 'source/utilities/HandledException.cpp' }
{ Source: 'source/utilities/SequenceMap.cpp' }
{ Source: 'source/value-table/Value.cpp', Imports: [ 'source/recipe/LanguageReference.cpp', 'source/recipe/PackageReference.cpp' ] }
]
Dependencies: {
Build: [
Expand Down
69 changes: 24 additions & 45 deletions code/client/core/source/Module.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#ifdef SOUP_BUILD
module;
#endif
module;

// TODO: Add a converter level to Opal?
#define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
Expand Down Expand Up @@ -46,8 +44,6 @@ module;

#endif

#ifdef SOUP_BUILD

// TODO module
// TODO: Treat wren as C code
#include "wren/wren.h"
Expand All @@ -59,51 +55,34 @@ import CryptoPP;
import Monitor.Host;
import Opal;

using namespace Opal;

#else

// import Opal
#include <algorithm>
#include <array>
#include <atomic>
#include <chrono>
#include <functional>
#include <fstream>
#include <filesystem>
#include <iostream>
#include <locale>
#include <map>
#include <optional>
#include <queue>
#include <sstream>
#include <string>

#include "Utilities/Path.h"
#include "Utilities/SemanticVersion.h"
#include "IO/SystemConsoleManager.h"
#include "Logger/Log.h"
#include "Logger/ConsoleTraceListener.h"
#include "System/LinuxProcessManager.h"
#include "System/STLFileSystem.h"
#include "System/STLSystem.h"
// Build
export import :BuildConstants;
export import :BuildFailedException;
export import :CommandInfo;
export import :DependencyTargetSet;
export import :FileSystemState;
export import :KnownLanguage;
export import :MacroManager;
export import :RecipeBuildCacheState;
export import :SystemAccessTracker;

// Recipe
export import :LanguageReference;
export import :PackageIdentifier;
export import :PackageName;
export import :PackageReference;

// Utilities
export import :HandledException;
export import :SequenceMap;

// Value Table
export import :Value;

using namespace Opal;

// import CryptoPP
#include "Interface.h"

// import Monitor.Host
#include "Linux/LinuxMonitorProcessManager.h"

// import Wren
#include "wren/wren.h"

#endif

#define CLIENT_CORE_IMPLEMENTATION

#include "utilities/SequenceMap.h"
#include "build/RecipeBuildLocationManager.h"
#include "build/BuildEngine.h"
#include "local-user-config/LocalUserConfigExtensions.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
// <copyright file="BuildConstants.h" company="Soup">
// <copyright file="BuildConstants.cpp" company="Soup">
// Copyright (c) Soup. All rights reserved.
// </copyright>

#pragma once
module;

export module Soup.Core:BuildConstants;

import Opal;

using namespace Opal;

namespace Soup::Core
{
/// <summary>
/// The constants used throughout the build
/// </summary>
#ifdef SOUP_BUILD
export
#endif
class BuildConstants
export class BuildConstants
{
public:
static const Path& EvaluateGraphFileName()
Expand Down
5 changes: 1 addition & 4 deletions code/client/core/source/build/BuildEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ namespace Soup::Core
/// <summary>
/// The core build system that brings together the individual build components to build a single root package
/// </summary>
#ifdef SOUP_BUILD
export
#endif
class BuildEngine
export class BuildEngine
{
public:
static std::map<std::string, KnownLanguage> GetKnownLanguages()
Expand Down
8 changes: 1 addition & 7 deletions code/client/core/source/build/BuildEvaluateEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@

#pragma once
#include "IEvaluateEngine.h"
#include "BuildFailedException.h"
#include "BuildHistoryChecker.h"
#include "FileSystemState.h"
#include "operation-graph/OperationGraph.h"
#include "SystemAccessTracker.h"

namespace Soup::Core
{
Expand Down Expand Up @@ -118,10 +115,7 @@ namespace Soup::Core
/// <summary>
/// The core build evaluation engine that knows how to perform a build from a provided Operation Graph.
/// </summary>
#ifdef SOUP_BUILD
export
#endif
class BuildEvaluateEngine : public IEvaluateEngine
export class BuildEvaluateEngine : public IEvaluateEngine
{
private:
bool _forceRebuild;
Expand Down
30 changes: 30 additions & 0 deletions code/client/core/source/build/BuildFailedException.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// <copyright file="BuildFailedException.cpp" company="Soup">
// Copyright (c) Soup. All rights reserved.
// </copyright>

module;

#include <exception>

export module Soup.Core:BuildFailedException;

import Opal;

using namespace Opal;

namespace Soup::Core
{
/// <summary>
/// The exception thrown to indicate that a build operation has failed
/// </summary>
export class BuildFailedException : public std::exception
{
public:
/// <summary>
/// Initializes a new instance of the <see cref="BuildFailedException"/> class.
/// </summary>
BuildFailedException()
{
}
};
}
25 changes: 0 additions & 25 deletions code/client/core/source/build/BuildFailedException.h

This file was deleted.

6 changes: 1 addition & 5 deletions code/client/core/source/build/BuildHistoryChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@
// </copyright>

#pragma once
#include "FileSystemState.h"

namespace Soup::Core
{
#ifdef SOUP_BUILD
export
#endif
class BuildHistoryChecker
export class BuildHistoryChecker
{
private:
FileSystemState& _fileSystemState;
Expand Down
9 changes: 1 addition & 8 deletions code/client/core/source/build/BuildLoadEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
#pragma once
#include "package-lock/PackageLockExtensions.h"
#include "RecipeBuildArguments.h"
#include "recipe/PackageIdentifier.h"
#include "recipe/RecipeCache.h"
#include "utilities/HandledException.h"
#include "BuildConstants.h"
#include "KnownLanguage.h"

namespace Soup::Core
{
Expand All @@ -27,10 +23,7 @@ namespace Soup::Core
/// It is responsible for loading up the entire closure and validating build state to
/// create a package graph that can be evaluated by the build runner.
/// </summary>
#ifdef SOUP_BUILD
export
#endif
class BuildLoadEngine
export class BuildLoadEngine
{
private:
const int _packageLockVersion = 5;
Expand Down
Loading

0 comments on commit 7a64097

Please sign in to comment.