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

Real Linux #213

Merged
merged 25 commits into from
Aug 9, 2023
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
56 changes: 23 additions & 33 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
windows-build:
strategy:
matrix:
os: [ windows-2022 ]
os: [ windows-2022, ubuntu-22.04 ]
config: [ Debug, Release ]
name: PR Build ${{matrix.os}} ${{matrix.config}}
runs-on: ${{ matrix.os }}
Expand All @@ -27,24 +27,30 @@ jobs:

# Build DotNet
- name: DotNet Restore
if: matrix.os != 'ubuntu-22.04'
run: dotnet restore ./Soup/Source/GenerateSharp/GenerateSharp.sln
- name: DotNet Build
if: matrix.os != 'ubuntu-22.04'
run: dotnet build -c ${{matrix.config}} --no-restore ./Soup/Source/GenerateSharp/GenerateSharp.sln
- name: DotNet Test
if: matrix.os != 'ubuntu-22.04'
run: dotnet test -c ${{matrix.config}} --no-build --verbosity normal ./Soup/Source/GenerateSharp/GenerateSharp.sln

# Build Soup
- name: Soup Where
run: swhere
- name: Soup Restore
- name: Soup Restore Client
run: soup restore ./Soup/Source/Client/CLI/ -v:d
- name: Soup Build
- name: Soup Build Client
if: matrix.os != 'ubuntu-22.04'
run: soup build ./Soup/Source/Client/CLI/ -v:d -flavor ${{matrix.config}}
- name: Soup Run Version
if: matrix.os != 'ubuntu-22.04'
run: soup run ./Soup/Source/Client/CLI/ -v:d -flavor ${{matrix.config}} -args version
- name: Soup Restore GenerateTest
run: soup restore ./Soup/Source/GenerateTest/
- name: Soup Build GenerateTest
if: matrix.os != 'ubuntu-22.04'
run: soup build ./Soup/Source/GenerateTest/ -flavor ${{matrix.config}} -v:d
# - name: Soup Restore SWhere
# run: soup restore ./Soup/Source/GenerateSharp/Swhere/
Expand All @@ -59,24 +65,31 @@ jobs:
- name: Soup Restore PrintGraph
run: soup restore ./Soup/Source/Tools/PrintGraph/
- name: Soup Build PrintGraph
if: matrix.os != 'ubuntu-22.04'
run: soup build ./Soup/Source/Tools/PrintGraph/ -flavor ${{matrix.config}} -v:d
- name: Soup Restore PrintValueTable
run: soup restore ./Soup/Source/Tools/PrintValueTable/
- name: Soup Build PrintValueTable
if: matrix.os != 'ubuntu-22.04'
run: soup build ./Soup/Source/Tools/PrintValueTable/ -flavor ${{matrix.config}} -v:d

# Build Samples
- name: Soup Restore C BuildExtension
run: soup restore ./Soup/Samples/C/BuildExtension/Executable/
- name: Soup Build C BuildExtension
if: matrix.os != 'ubuntu-22.04'
run: soup build ./Soup/Samples/C/BuildExtension/Executable/ -flavor ${{matrix.config}} -v:d
- name: Soup Build C ConsoleApplication
if: matrix.os != 'ubuntu-22.04'
run: soup build ./Soup/Samples/C/ConsoleApplication/ -flavor ${{matrix.config}} -v:d
- name: Soup Build C DynamicLibrary
if: matrix.os != 'ubuntu-22.04'
run: soup build ./Soup/Samples/C/DynamicLibrary/Application/ -flavor ${{matrix.config}} -v:d
- name: Soup Build C StaticLibrary
if: matrix.os != 'ubuntu-22.04'
run: soup build ./Soup/Samples/C/StaticLibrary/Application/ -flavor ${{matrix.config}} -v:d
- name: Soup Build C WindowsApplication
if: matrix.os != 'ubuntu-22.04'
run: soup build ./Soup/Samples/C/WindowsApplication/ -flavor ${{matrix.config}} -v:d

- name: Soup Restore Cpp BuildExtension
Expand All @@ -86,52 +99,29 @@ jobs:
- name: Soup Build Cpp ConsoleApplication
run: soup build ./Soup/Samples/Cpp/ConsoleApplication/ -flavor ${{matrix.config}} -v:d
- name: Soup Build Cpp DirectX
if: matrix.os != 'ubuntu-22.04'
run: soup build ./Soup/Samples/Cpp/DirectX/ -flavor ${{matrix.config}} -v:d
- name: Soup Build Cpp DynamicLibrary
if: matrix.os != 'ubuntu-22.04'
run: soup build ./Soup/Samples/Cpp/DynamicLibrary/Application/ -flavor ${{matrix.config}} -v:d
- name: Soup Build Cpp ModuleInterface
if: matrix.os != 'ubuntu-22.04'
run: soup build ./Soup/Samples/Cpp/ModuleInterface/ -flavor ${{matrix.config}} -v:d
- name: Soup Restore Cpp ParseJsonFile
run: soup restore ./Soup/Samples/Cpp/ParseJsonFile/
- name: Soup Build Cpp ParseJsonFile
if: matrix.os != 'ubuntu-22.04'
run: soup build ./Soup/Samples/Cpp/ParseJsonFile/ -flavor ${{matrix.config}} -v:d
- name: Soup Build Cpp StaticLibrary
if: matrix.os != 'ubuntu-22.04'
run: soup build ./Soup/Samples/Cpp/StaticLibrary/Application/ -flavor ${{matrix.config}} -v:d
- name: Soup Build Cpp WindowsApplication
if: matrix.os != 'ubuntu-22.04'
run: soup build ./Soup/Samples/Cpp/WindowsApplication/ -flavor ${{matrix.config}} -v:d

# - 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}} -v:d
# - name: Soup Build CSharp ConsoleApplication
# run: soup build ./Soup/Samples/CSharp/ConsoleApplication/ -flavor ${{matrix.config}} -v:d
linux-build:
strategy:
matrix:
os: [ ubuntu-22.04 ]
config: [ Debug ]
name: PR Build ${{matrix.os}} ${{matrix.config}}
runs-on: ${{ matrix.os }}
steps:
# Setup Environment
- uses: actions/checkout@v2
with:
path: "Soup"
submodules: true
- name: Setup Soup Build
uses: soupbuild/setup-soup@v1
with:
version: latest

# Build Soup
- name: Soup Restore
run: soup restore ./Soup/Source/Client/CLI/ -v:d
- name: Soup Build
run: soup build ./Soup/Source/Client/CLI/ -v:d -flavor ${{matrix.config}}
- name: Soup Run Version
run: soup run ./Soup/Source/Client/CLI/ -v:d -flavor ${{matrix.config}} -args version

# Build Samples
- name: Soup Build Cpp ConsoleApplication
run: soup build ./Soup/Samples/Cpp/ConsoleApplication/ -flavor ${{matrix.config}} -v:d
# run: soup build ./Soup/Samples/CSharp/ConsoleApplication/ -flavor ${{matrix.config}} -v:d
16 changes: 15 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Swhere",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "",
"program": "${workspaceFolder}/Source/out/msbuild/bin/Swhere/Debug/net7.0/Swhere.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"console": "internalConsole"
},
{
"name": "Debug Soup",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/out/soup",
"args": [ "restore", "Source/Client/CLI" ],
"args": [
"restore",
"Source/Client/CLI"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
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 @@ -124,7 +124,7 @@ Closures: {
{ Name: "Samples.CSharp.BuildExtension.Extension", Version: "../Extension/" }
]
Wren: [
{ Name: "Soup.CSharp", Version: "0.10.0" }
{ Name: "Soup.CSharp", Version: "0.11.1" }
]
}
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 @@ -31,7 +31,7 @@ Closures: {
{ Name: "Samples.CSharp.BuildExtension.Extension", Version: "../Extension/" }
]
Wren: [
{ Name: "Soup.CSharp", Version: "0.9.0" }
{ Name: "Soup.CSharp", Version: "0.11.1" }
]
}
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: [
{ Name: "Samples.CSharp.BuildExtension.Extension", Version: "../Extension/" }
{ Name: "Soup.CSharp", Version: "0.10.0" }
{ Name: "Soup.CSharp", Version: "0.11.1" }
]
}
Tool0: {
Expand Down
2 changes: 1 addition & 1 deletion Samples/CSharp/ConsoleApplication/PackageLock.sml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Closures: {
}
Build0: {
Wren: [
{ Name: "Soup.CSharp", Version: "0.10.0" }
{ Name: "Soup.CSharp", Version: "0.11.1" }
]
}
Tool0: {
Expand Down
2 changes: 1 addition & 1 deletion Samples/Cpp/BuildExtension/Executable/PackageLock.sml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Closures: {
Build0: {
Wren: [
{ Name: "Samples.Cpp.BuildExtension.Extension", Version: "../Extension/" }
{ Name: "Soup.Cpp", Version: "0.9.0" }
{ Name: "Soup.Cpp", Version: "0.9.1" }
]
}
Tool0: {
Expand Down
2 changes: 1 addition & 1 deletion Samples/Cpp/ConsoleApplication/PackageLock.sml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Closures: {
}
Build0: {
Wren: [
{ Name: "Soup.Cpp", Version: "0.9.0" }
{ Name: "Soup.Cpp", Version: "0.9.1" }
]
}
Tool0: {
Expand Down
2 changes: 1 addition & 1 deletion Samples/Cpp/DirectX/PackageLock.sml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Closures: {
}
Build0: {
Wren: [
{ Name: "Soup.Cpp", Version: "0.9.0" }
{ Name: "Soup.Cpp", Version: "0.9.1" }
]
}
Tool0: {
Expand Down
2 changes: 1 addition & 1 deletion Samples/Cpp/DynamicLibrary/Application/PackageLock.sml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Closures: {
}
Build0: {
Wren: [
{ Name: "Soup.Cpp", Version: "0.9.0" }
{ Name: "Soup.Cpp", Version: "0.9.1" }
]
}
Tool0: {
Expand Down
2 changes: 1 addition & 1 deletion Samples/Cpp/ModuleInterface/PackageLock.sml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Closures: {
}
Build0: {
Wren: [
{ Name: "Soup.Cpp", Version: "0.9.0" }
{ Name: "Soup.Cpp", Version: "0.9.1" }
]
}
Tool0: {
Expand Down
2 changes: 1 addition & 1 deletion Samples/Cpp/ParseJsonFile/PackageLock.sml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Closures: {
}
Build0: {
Wren: [
{ Name: "Soup.Cpp", Version: "0.9.0" }
{ Name: "Soup.Cpp", Version: "0.9.1" }
]
}
Tool0: {
Expand Down
2 changes: 1 addition & 1 deletion Samples/Cpp/StaticLibrary/Application/PackageLock.sml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Closures: {
}
Build0: {
Wren: [
{ Name: "Soup.Cpp", Version: "0.9.0" }
{ Name: "Soup.Cpp", Version: "0.9.1" }
]
}
Tool0: {
Expand Down
2 changes: 1 addition & 1 deletion Samples/Cpp/WindowsApplication/PackageLock.sml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Closures: {
}
Build0: {
Wren: [
{ Name: "Soup.Cpp", Version: "0.9.0" }
{ Name: "Soup.Cpp", Version: "0.9.1" }
]
}
Tool0: {
Expand Down
4 changes: 2 additions & 2 deletions Scripts/Linux/build-swhere
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ SOURCE_DIR=$SCRIPTS_DIR/../../Source
SWHERE_DIR=$SOURCE_DIR/GenerateSharp/Swhere

# Build SWhere tool
echo dotnet publish $SWHERE_DIR -c Debug
eval dotnet publish $SWHERE_DIR -c Debug
echo dotnet publish $SWHERE_DIR -c Release -r linux-x64 --self-contained
eval dotnet publish $SWHERE_DIR -c Release -r linux-x64 --self-contained
4 changes: 3 additions & 1 deletion Scripts/Linux/soup
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ mkdir -p $RUN_DIR/BuiltIn/Soup.Wren/$SOUP_WREN_VERSION
cp $GLOBAL_PACKAGES_DIR/Wren/Soup.Wren/$SOUP_WREN_VERSION/Recipe.sml $RUN_DIR/BuiltIn/Soup.Wren/$SOUP_WREN_VERSION/Recipe.sml
cp -R $GLOBAL_OUT_DIR/Wren/Soup.Wren/$SOUP_WREN_VERSION/J_HqSstV55vlb-x6RWC_hLRFRDU/ $RUN_DIR/BuiltIn/Soup.Wren/$SOUP_WREN_VERSION/out/

cp -R $ROOT_DIR/Source/out/msbuild/bin/Soup.Build.PackageManager/Debug/net7.0/linux-x64/publish/ $RUN_DIR/PackageManager
cp -R $ROOT_DIR/Source/out/msbuild/bin/Soup.Build.PackageManager/Release/net7.0/linux-x64/publish/ $RUN_DIR/PackageManager

cp -R $ROOT_DIR/Source/out/msbuild/bin/Swhere/Release/net7.0/linux-x64/publish/Swhere $RUN_DIR/swhere

eval $RUN_DIR/soup "$@"
11 changes: 11 additions & 0 deletions Scripts/Linux/swhere
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Stop on first error
set -e

SCRIPTS_DIR=$(dirname "$0")
ROOT_DIR=$SCRIPTS_DIR/../..
OUT_DIR=$ROOT_DIR/Source/out


eval $OUT_DIR/msbuild/bin/Swhere/Release/net7.0/linux-x64/publish/Swhere "$@"
8 changes: 8 additions & 0 deletions Scripts/Windows/release.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ SET ScriptsDir=%~dp0
SET RootDir=%ScriptsDir%..\..
SET OutDir=%RootDir%\out
SET RunDir=%OutDir%\run
SET SourceDir=%RootDir%\Source
SET InstallerDir=%SourceDir%\Installer\SoupInstaller

SET SOUP_VERSION=0.35.0

REM - Build MSI Installer
echo msbuild %InstallerDir% -p:Configuration=Release
call msbuild %InstallerDir% -p:Configuration=Release
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%

REM - Generate zip release
tar -a -cf %OutDir%\soup-build-%SOUP_VERSION%-windows-x64.zip -C %RunDir% *
4 changes: 2 additions & 2 deletions Source/Client/CLI/PackageLock.sml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ Closures: {
}
Build0: {
Wren: [
{ Name: "Soup.Cpp", Version: "0.9.0" }
{ Name: "Soup.Cpp", Version: "0.9.1" }
]
}
Build1: {
Wren: [
{ Name: "Soup.Cpp", Version: "0.9.0" }
{ Name: "Soup.Cpp", Version: "0.9.1" }
{ Name: "Soup.Test.Cpp", Version: "0.9.0" }
]
}
Expand Down
2 changes: 1 addition & 1 deletion Source/GenerateSharp/Api.Client/ApiException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public ApiException(
int statusCode,
IReadOnlyDictionary<string, IEnumerable<string>> headers,
Exception? innerException)
: base(message, innerException)
: base($"{message} - StatusCode {statusCode}", innerException)
{
StatusCode = statusCode;
Headers = headers;
Expand Down
5 changes: 3 additions & 2 deletions Source/GenerateSharp/Api.Client/ClosureClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ public virtual async Task<GenerateClosureResultModel> GenerateClosureAsync(
{
using var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false);
using var jsonContent = new MemoryStream();
using var content = new StreamContent(jsonContent);

await JsonSerializer.SerializeAsync(
jsonContent, request, SourceGenerationContext.Default.GenerateClosureRequestModel, cancellationToken);
jsonContent.Seek(0, SeekOrigin.Begin);

using var content = new StreamContent(jsonContent);
content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json");

request_.Content = content;
request_.Method = new HttpMethod("GET");
request_.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json"));
Expand Down
4 changes: 3 additions & 1 deletion Source/GenerateSharp/Api.Client/PackagesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,14 @@ public virtual async Task<PackageModel> CreateOrUpdatePackageAsync(
{
using var request = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false);
using var jsonContent = new MemoryStream();
using var content = new StreamContent(jsonContent);

await JsonSerializer.SerializeAsync(
jsonContent, model, SourceGenerationContext.Default.PackageCreateOrUpdateModel, cancellationToken);
jsonContent.Seek(0, SeekOrigin.Begin);

using var content = new StreamContent(jsonContent);
content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json");

request.Content = content;
request.Method = new HttpMethod("PUT");
request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json"));
Expand Down
2 changes: 1 addition & 1 deletion Source/GenerateSharp/Api.Client/SoupBuildApi.nswag
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"runtime": "Net60",
"runtime": "Net70",
"defaultVariables": null,
"documentGenerator": {
"fromDocument": {
Expand Down
2 changes: 1 addition & 1 deletion Source/GenerateSharp/PackageManager/PackageLock.sml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Closures: {
}
Build0: {
Wren: [
{ Name: "Soup.CSharp", Version: "0.10.0" }
{ Name: "Soup.CSharp", Version: "0.11.1" }
{ Name: "Soup.CSharp.Nuget", Version: "0.1.0" }
]
}
Expand Down
Loading
Loading