Skip to content

Commit

Permalink
Linux PTrace+seccomp and Create Migrate Tool (#271)
Browse files Browse the repository at this point in the history
* Merge swhere
* Merge packagemanager
* Add x64
* Start to parse csproj
* Enable tests
* Add conditionals
* Add missing funcs
* Remove safe language name
* update scripts
* Update version
* Rename system monitoring
* Hook up linux trace monitor
  • Loading branch information
mwasplund authored Nov 26, 2024
1 parent c284f02 commit 56344f0
Show file tree
Hide file tree
Showing 176 changed files with 4,568 additions and 3,633 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ jobs:
if: matrix.os != 'ubuntu-24.04'
run: soup build ./Soup/Samples/Cpp/WindowsApplication/ -flavor ${{matrix.config}}

# - name: Soup Restore CSharp BuildExtension
# run: soup restore ./Soup/Samples/CSharp/BuildExtension/Executable/
# - name: Soup Build CSharp BuildExtension
# run: soup build ./Soup/Samples/CSharp/BuildExtension/Executable/ -flavor ${{matrix.config}}
# - name: Soup Build CSharp ConsoleApplication
# run: soup build ./Soup/Samples/CSharp/ConsoleApplication/ -flavor ${{matrix.config}}
- name: Soup Restore CSharp BuildExtension
run: soup restore ./Soup/Samples/CSharp/BuildExtension/Executable/
- name: Soup Build CSharp BuildExtension
run: soup build ./Soup/Samples/CSharp/BuildExtension/Executable/ -flavor ${{matrix.config}}
- name: Soup Build CSharp ConsoleApplication
run: soup build ./Soup/Samples/CSharp/ConsoleApplication/ -flavor ${{matrix.config}}
- name: Soup Build CSharp Library
run: soup build ./Soup/Samples/CSharp/Library/Application/ -flavor ${{matrix.config}}
97 changes: 87 additions & 10 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,93 @@
"MIMode": "gdb"
},
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
},
{
"name": "Debug Soup Children",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/out/run/soup",
"args": [
"build",
"Samples/Cpp/ConsoleApplication/"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"linux": {
"MIMode": "gdb"
},
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
},
{
"description": "The new process is debugged after a fork. The parent process runs unimpeded.",
"text": "-gdb-set follow-fork-mode child",
"ignoreFailures": true
}
]
},
{
"name": "Debug Soup Core Test",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/out/C++/Local/Soup.Core/0.1.1/J_HqSstV55vlb-x6RWC_hLRFRDU/bin/Test/TestHarness.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"linux": {
"MIMode": "gdb"
},
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
},
{
"name": "(gdb) Attach",
"type": "cppdbg",
"request": "attach",
"program": "${workspaceFolder}/out/run/soup",
"processId": "${command:pickProcess}",
"linux": {
"MIMode": "gdb"
},
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion Docs/Samples/CSharp/Build-Extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Closures: {
Build0: {
Wren: {
'Samples.CSharp.BuildExtension.Extension': { Version: '../Extension/' }
'mwasplund|Soup.CSharp': { Version: 0.13.0 }
'mwasplund|Soup.CSharp': { Version: 0.15.0 }
}
}
Tool0: {
Expand Down
2 changes: 1 addition & 1 deletion Docs/Samples/CSharp/Console-Application.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Closures: {
}
Build0: {
Wren: {
'mwasplund|Soup.CSharp': { Version: 0.13.0 }
'mwasplund|Soup.CSharp': { Version: 0.15.0 }
}
}
Tool0: {
Expand Down
2 changes: 1 addition & 1 deletion Samples/CSharp/BuildExtension/Executable/PackageLock.sml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Closures: {
Build0: {
Wren: {
'Samples.CSharp.BuildExtension.Extension': { Version: '../Extension/' }
'mwasplund|Soup.CSharp': { Version: 0.14.0 }
'mwasplund|Soup.CSharp': { Version: 0.15.0 }
}
}
Tool0: {
Expand Down
1 change: 1 addition & 0 deletions Samples/CSharp/BuildExtension/Executable/Recipe.sml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Name: 'Samples.CSharp.BuildExtension.Executable'
Language: (C#@0)
TargetFramework: 'net8.0'
Type: 'Executable'
Version: 1.0.0
Dependencies: {
Expand Down
4 changes: 2 additions & 2 deletions Samples/CSharp/ConsoleApplication/PackageLock.sml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ Version: 5
Closures: {
Root: {
'C#': {
'Samples.CSharp.ConsoleApplication': { Version: '../ConsoleApplication', Build: 'Build0', Tool: 'Tool0' }
'Samples.CSharp.ConsoleApplication': { Version: './', Build: 'Build0', Tool: 'Tool0' }
}
}
Build0: {
Wren: {
'mwasplund|Soup.CSharp': { Version: 0.14.0 }
'Soup|CSharp': { Version: 0.15.0 }
}
}
Tool0: {
Expand Down
1 change: 1 addition & 0 deletions Samples/CSharp/ConsoleApplication/Recipe.sml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Name: 'Samples.CSharp.ConsoleApplication'
Language: (C#@0)
TargetFramework: 'net8.0'
Type: 'Executable'
Version: 1.0.0
1 change: 1 addition & 0 deletions Samples/CSharp/Library/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
out/
20 changes: 20 additions & 0 deletions Samples/CSharp/Library/Application/PackageLock.sml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Version: 5
Closures: {
Root: {
'C#': {
'Samples.CSharp.Library.Library': { Version: '../Library/', Build: 'Build0', Tool: 'Tool0' }
'Samples.CSharp.Library.ConsoleApplication': { Version: './', Build: 'Build0', Tool: 'Tool0' }
}
}
Build0: {
Wren: {
'mwasplund|Soup.CSharp': { Version: 0.15.0 }
}
}
Tool0: {
'C++': {
'mwasplund|copy': { Version: 1.1.0 }
'mwasplund|mkdir': { Version: 1.1.0 }
}
}
}
12 changes: 12 additions & 0 deletions Samples/CSharp/Library/Application/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

namespace Samples.CSharp.Library.Application
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine($"Hello World, {Helper.GetName()} Style!");
}
}
}
10 changes: 10 additions & 0 deletions Samples/CSharp/Library/Application/Recipe.sml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Name: 'Samples.CSharp.Library.ConsoleApplication'
Language: (C#@0)
TargetFramework: 'net8.0'
Type: 'Executable'
Version: 1.0.0
Dependencies: {
Runtime: [
'../Library/'
]
}
10 changes: 10 additions & 0 deletions Samples/CSharp/Library/Library/Helper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Samples.CSharp.Library
{
public class Helper
{
public static string GetName()
{
return "Soup";
}
};
}
4 changes: 4 additions & 0 deletions Samples/CSharp/Library/Library/Recipe.sml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Name: 'Samples.CSharp.Library.Library'
Language: (C#@0)
TargetFramework: 'net8.0'
Version: 1.0.0
3 changes: 2 additions & 1 deletion Samples/Cpp/BuildExtension/Executable/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ int main()
#else
std::cout << "Hello World..." << std::endl;
#endif

return 0;
}
}
3 changes: 2 additions & 1 deletion Samples/Cpp/BuildExtension/Executable/PackageLock.sml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Version: 5
Closures: {
Root: {
'C++': {
'Samples.SimpleBuildExtension.Executable': { Version: '../Executable', Build: 'Build0', Tool: 'Tool0' }
'Samples.SimpleBuildExtension.Executable': { Version: './', Build: 'Build0', Tool: 'Tool0' }
}
}
Build0: {
Expand All @@ -13,6 +13,7 @@ Closures: {
}
Tool0: {
'C++': {
'Samples.SimpleBuildExtension.Tool': { Version: '../Tool/' }
'mwasplund|copy': { Version: 1.1.0 }
'mwasplund|mkdir': { Version: 1.1.0 }
}
Expand Down
32 changes: 32 additions & 0 deletions Samples/Cpp/BuildExtension/Extension/CustomBuildTask.wren
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
// </copyright>

import "soup" for Soup, SoupTask
import "mwasplund|Soup.Build.Utils:./Path" for Path
import "mwasplund|Soup.Build.Utils:./ListExtensions" for ListExtensions
import "mwasplund|Soup.Build.Utils:./MapExtensions" for MapExtensions
import "mwasplund|Soup.Build.Utils:./SharedOperations" for SharedOperations

class CustomBuildTask is SoupTask {
/// <summary>
Expand Down Expand Up @@ -37,5 +39,35 @@ class CustomBuildTask is SoupTask {
ListExtensions.Append(
MapExtensions.EnsureList(buildTable, "PreprocessorDefinitions"),
preprocessorDefinitions)

var contextTable = Soup.globalState["Context"]
var packageRoot = Path.new(contextTable["PackageDirectory"])

CustomBuildTask.CreateCustomToolOperation(packageRoot)
}

/// <summary>
/// Create a build operation that will create a directory
/// </summary>
static CreateCustomToolOperation(workingDirectory) {
// Discover the dependency tool
var toolExecutable = SharedOperations.ResolveRuntimeDependencyRunExectable("Samples.SimpleBuildExtension.Tool")

var title = "Run Custom Tool"

var program = Path.new(toolExecutable)
var inputFiles = []
var outputFiles = []

// Build the arguments
var arguments = []

Soup.createOperation(
title,
program.toString,
arguments,
workingDirectory.toString,
ListExtensions.ConvertFromPathList(inputFiles),
ListExtensions.ConvertFromPathList(outputFiles))
}
}
2 changes: 1 addition & 1 deletion Samples/Cpp/BuildExtension/Extension/PackageLock.sml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Version: 5
Closures: {
Root: {
Wren: {
'mwasplund|Soup.Build.Utils': { Version: 0.7.0, Build: 'Build0', Tool: 'Tool0' }
'Samples.Cpp.BuildExtension.Extension': { Version: './', Build: 'Build0', Tool: 'Tool0' }
'mwasplund|Soup.Build.Utils': { Version: 0.7.0, Build: 'Build0', Tool: 'Tool0' }
}
}
Build0: {
Expand Down
3 changes: 3 additions & 0 deletions Samples/Cpp/BuildExtension/Extension/Recipe.sml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ Dependencies: {
Runtime: [
<mwasplund|Soup.Build.Utils@0>
]
Tool: [
'../Tool/'
]
}
8 changes: 8 additions & 0 deletions Samples/Cpp/BuildExtension/Tool/Main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <iostream>

int main()
{
std::cout << "Tool, Soup Style!" << std::endl;

return 0;
}
19 changes: 19 additions & 0 deletions Samples/Cpp/BuildExtension/Tool/PackageLock.sml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Version: 5
Closures: {
Root: {
'C++': {
'Samples.SimpleBuildExtension.Tool': { Version: './', Build: 'Build0', Tool: 'Tool0' }
}
}
Build0: {
Wren: {
'mwasplund|Soup.Cpp': { Version: 0.13.2 }
}
}
Tool0: {
'C++': {
'mwasplund|copy': { Version: 1.1.0 }
'mwasplund|mkdir': { Version: 1.1.0 }
}
}
}
4 changes: 4 additions & 0 deletions Samples/Cpp/BuildExtension/Tool/Recipe.sml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Name: 'Samples.SimpleBuildExtension.Tool'
Language: (C++@0)
Type: 'Executable'
Version: 1.0.0
12 changes: 6 additions & 6 deletions Scripts/Linux/build
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ echo $SCRIPTS_DIR/build-client $FLAVOR
eval $SCRIPTS_DIR/build-client $FLAVOR

# Build SWhere tool
echo $SCRIPTS_DIR/build-swhere
eval $SCRIPTS_DIR/build-swhere
echo $SCRIPTS_DIR/build-swhere $FLAVOR
eval $SCRIPTS_DIR/build-swhere $FLAVOR

# Build PackageManager
echo $SCRIPTS_DIR/build-packagemanager
eval $SCRIPTS_DIR/build-packagemanager
echo $SCRIPTS_DIR/build-packagemanager $FLAVOR
eval $SCRIPTS_DIR/build-packagemanager $FLAVOR

# Build View
echo $SCRIPTS_DIR/build-view
eval $SCRIPTS_DIR/build-view
echo $SCRIPTS_DIR/build-view $FLAVOR
eval $SCRIPTS_DIR/build-view $FLAVOR
Loading

0 comments on commit 56344f0

Please sign in to comment.