Skip to content

Commit

Permalink
Fix bugs in launcher, remove Inno Setup installer and update workflow (
Browse files Browse the repository at this point in the history
…#1037)

* Fix bugs in launcher

* Add CIL v2 decoder argument in *.sh scripts

* Remove -cilv2 argument (no longer needed)

* Remove Inno Setup installer

* Update workflow; add docs generation

* Add missing pydot dependency

* Actually install graphviz

---------

Co-authored-by: AnErrupTion <anerruption@disroot.org>
  • Loading branch information
AnErrupTion and AnErrupTion committed Apr 8, 2023
1 parent a0ce960 commit 7ca4b1e
Show file tree
Hide file tree
Showing 9 changed files with 139 additions and 127 deletions.
48 changes: 34 additions & 14 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,23 @@ jobs:
NUGET_ENABLE_LEGACY_CSPROJ_PACK: true
steps:
- name: Set net7.0
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: View Build Version
run: echo ${{ env.BUILD_VERSION }}.${{ github.run_number }}
- name: View Github Info
run: echo repository=${{ github.repository }} event_name=${{ github.event_name }} ref=${{ github.ref }} head_ref=${{ github.head_ref }} base_ref=${{ github.base_ref }}
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
uses: microsoft/setup-msbuild@v1.1
- name: Setup Nuget.exe
uses: nuget/setup-nuget@v1
- name: Restore nuget Packages
run: dotnet restore Mosa.sln
working-directory: Source
run: dotnet restore Source/Mosa.sln
- name: Build
run: dotnet build Source/Mosa.sln /p:Version=${{ env.BUILD_VERSION }}
- name: Unit Tests - All Performance Optimizations
Expand All @@ -57,8 +56,6 @@ jobs:
# run: bin\Mosa.Tool.Launcher.Console.exe bin\Mosa.Demo.HelloWorld.x86.dll -s Launcher.Test=true
# - name: Test Demo - Mosa.Demo.CoolWorld.x86
# run: bin\Mosa.Tool.Launcher.Console.exe bin\Mosa.Demo.CoolWorld.x86.dll -s Launcher.Test=true
- name: Create Installer
run: ISCC.exe /DMyAppVersion=${{ env.BUILD_VERSION }}.${{ github.run_number }} Source/Inno-Setup-Script/Mosa-Installer.iss
- name: Build Project - Mosa.Templates
run: dotnet build Source\Mosa.Templates\Mosa.Templates.csproj
- name: Create Package - Mosa.Templates
Expand All @@ -79,11 +76,6 @@ jobs:
run: nuget pack Source\Mosa.Packages\Mosa.Platform.x64.nuspec -OutputDirectory bin\nupkg -Version ${{ env.BUILD_VERSION }}.${{ github.run_number }}
- name: Create Package - Mosa.Kernel.x64
run: nuget pack Source\Mosa.Packages\Mosa.Kernel.x64.nuspec -OutputDirectory bin\nupkg -Version ${{ env.BUILD_VERSION }}.${{ github.run_number }}
- name: Create Installer Artifact
uses: actions/upload-artifact@master
with:
name: MOSA-Installer-${{ env.BUILD_VERSION }}.${{ github.run_number }}.exe
path: bin\MOSA-Installer-${{ env.BUILD_VERSION }}.${{ github.run_number }}.exe
- name: Create Nuget Packages Artifact
uses: actions/upload-artifact@master
with:
Expand Down Expand Up @@ -122,11 +114,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set net7.0
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3
with:
submodules: recursive
- name: Restore nuget Packages
Expand Down Expand Up @@ -157,3 +149,31 @@ jobs:
run: dotnet bin/Mosa.Utility.UnitTests.dll -o7 -s Emulator.Display=false
- name: Unit Tests - Optimization Level 8
run: dotnet bin/Mosa.Utility.UnitTests.dll -o8 -s Emulator.Display=false

generate-docs:
name: Generate documentation
runs-on: ubuntu-latest
steps:
- name: Set python3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Update package respository
run: sudo apt-get -y -o Acquire::Check-Valid-Until=false update
- name: Install Graphviz
run: sudo apt-get install -y graphviz
- name: Install Sphinx dependencies
run: pip3 install sphinx sphinxcontrib.httpdomain sphinx-prompt sphinx_rtd_theme sphinx-tabs
- name: Generate HTML website
run: sphinx-build -b html Source/Docs sphinx-docs
- name: Create ZIP archive
run: zip -r docs-${{ env.BUILD_VERSION }}.${{ github.run_number }}.zip sphinx-docs
- name: Create artifact
uses: actions/upload-artifact@master
with:
name: docs-${{ env.BUILD_VERSION }}.${{ github.run_number }}.zip
path: docs-${{ env.BUILD_VERSION }}.${{ github.run_number }}.zip
2 changes: 1 addition & 1 deletion Demos/Run-Demo.CoolWorld.x86.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
cd ../bin
./Mosa.Tool.Launcher.Console -autostart -oMax -output-asm -output-debug -output-hash Mosa.Demo.CoolWorld.x86.dll
./Mosa.Tool.Launcher.Console -autostart -oMax -output-asm -output-debug -output-hash Mosa.Demo.CoolWorld.x86.dll
2 changes: 1 addition & 1 deletion Demos/Run-Demo.HelloWorld.x86.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
cd ../bin
./Mosa.Tool.Launcher.Console -autostart -oMax -output-asm -output-debug -output-hash Mosa.Demo.HelloWorld.x86.dll
./Mosa.Tool.Launcher.Console -autostart -oMax -output-asm -output-debug -output-hash Mosa.Demo.HelloWorld.x86.dll
2 changes: 1 addition & 1 deletion Demos/Run-Demo.TestWorld.x86.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
cd ../bin
./Mosa.Tool.Launcher.Console -autostart -oMax -output-asm -output-debug -output-hash Mosa.Demo.TestWorld.x86.dll
./Mosa.Tool.Launcher.Console -autostart -oMax -output-asm -output-debug -output-hash Mosa.Demo.TestWorld.x86.dll
5 changes: 0 additions & 5 deletions Source/Create-Installer.bat

This file was deleted.

95 changes: 0 additions & 95 deletions Source/Inno-Setup-Script/Mosa-Installer.iss

This file was deleted.

4 changes: 0 additions & 4 deletions Source/Inno-Setup-Script/create-installer.bat

This file was deleted.

5 changes: 0 additions & 5 deletions Source/Inno-Setup-Script/readme.md

This file was deleted.

103 changes: 102 additions & 1 deletion Source/Mosa.Tool.Launcher/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ public void Initialize(string[] args)
// Load the CLI arguments
settings.Merge(SettingsLoader.RecursiveReader(args));

// Update the GUI settings
UpdateGuiSettings();

var sb = new StringBuilder();

foreach (var arg in args)
Expand All @@ -105,7 +108,7 @@ public void Initialize(string[] args)
if (src != null)
{
OsNameTxt.Text = Path.GetFileNameWithoutExtension(src);
SrcLbl.Content = Path.GetFileName(src);
SrcLbl.Content = Path.GetFullPath(src);
}

foreach (var file in files)
Expand Down Expand Up @@ -179,6 +182,104 @@ private void UpdateInterfaceAppLocations()
vmwarePathLbl.Content = string.IsNullOrEmpty(workstation) ? settings.GetValue("AppLocation.VmwarePlayer", "N/A") : workstation;
}

private void UpdateGuiSettings()
{
SsaOpts.IsChecked = settings.GetValue("Optimizations.SSA", SsaOpts.IsChecked!.Value);
BasicOpts.IsChecked = settings.GetValue("Optimizations.Basic", BasicOpts.IsChecked!.Value);
SccpOpts.IsChecked = settings.GetValue("Optimizations.SCCP", SccpOpts.IsChecked!.Value);
DevirtOpts.IsChecked = settings.GetValue("Optimizations.Devirtualization", DevirtOpts.IsChecked!.Value);
InlineOpts.IsChecked = settings.GetValue("Optimizations.Inline", InlineOpts.IsChecked!.Value);
InlineExplOpts.IsChecked = settings.GetValue("Optimizations.Inline.Explicit", InlineExplOpts.IsChecked!.Value);
LongExpOpts.IsChecked = settings.GetValue("Optimizations.LongExpansion", LongExpOpts.IsChecked!.Value);
TwoOptPass.IsChecked = settings.GetValue("Optimizations.TwoPass", TwoOptPass.IsChecked!.Value);
ValueNumOpts.IsChecked = settings.GetValue("Optimizations.ValueNumbering", ValueNumOpts.IsChecked!.Value);
BtOpts.IsChecked = settings.GetValue("Optimizations.BitTracker", BtOpts.IsChecked!.Value);
PlatOpts.IsChecked = settings.GetValue("Optimizations.Platform", PlatOpts.IsChecked!.Value);
LicmOpts.IsChecked = settings.GetValue("Optimizations.LoopInvariantCodeMotion", LicmOpts.IsChecked!.Value);

EmtSymbs.IsChecked = settings.GetValue("Linker.Symbols", EmtSymbs.IsChecked!.Value);
EmtRelocs.IsChecked = settings.GetValue("Linker.StaticRelocations", EmtRelocs.IsChecked!.Value);
EmtDwarf.IsChecked = settings.GetValue("Linker.Dwarf", EmtDwarf.IsChecked!.Value);
BaseAddrTxt.Text = settings.GetValue("Compiler.BaseAddress");

NasmFile.IsChecked = !string.IsNullOrEmpty(settings.GetValue("CompilerDebug.NasmFile"));
AsmFile.IsChecked = !string.IsNullOrEmpty(settings.GetValue("CompilerDebug.AsmFile"));
MapFile.IsChecked = !string.IsNullOrEmpty(settings.GetValue("CompilerDebug.MapFile"));
DbgFile.IsChecked = !string.IsNullOrEmpty(settings.GetValue("CompilerDebug.DebugFile"));
InlLstFile.IsChecked = !string.IsNullOrEmpty(settings.GetValue("CompilerDebug.InlinedFile"));
HashFiles.IsChecked = !string.IsNullOrEmpty(settings.GetValue("CompilerDebug.PreLinkHashFile"));
CompTimeFile.IsChecked = !string.IsNullOrEmpty(settings.GetValue("CompilerDebug.CompileTimeFile"));

ExitOnLaunch.IsChecked = settings.GetValue("Launcher.Exit", ExitOnLaunch.IsChecked!.Value);

QemuGdb.IsChecked = settings.GetValue("Emulator.GDB", QemuGdb.IsChecked!.Value);
LaunchGdb.IsChecked = settings.GetValue("Launcher.LaunchGDB", LaunchGdb.IsChecked!.Value);
MosaDbger.IsChecked = settings.GetValue("Launcher.LaunchDebugger", MosaDbger.IsChecked!.Value);

MultiThreading.IsChecked = settings.GetValue("Compiler.Multithreading", MultiThreading.IsChecked!.Value);
MethodScanner.IsChecked = settings.GetValue("Compiler.MethodScanner", MethodScanner.IsChecked!.Value);

MemVal.Value = settings.GetValue("Emulator.Memory", (int)MemVal.Value);
CpuVal.Value = settings.GetValue("Emulator.Cores", (int)CpuVal.Value);

EnableVbe.IsChecked = settings.GetValue("Multiboot.Video", EnableVbe.IsChecked!.Value);
VbeWidth.Value = settings.GetValue("Multiboot.Width", (int)VbeWidth.Value);
VbeHeight.Value = settings.GetValue("Multiboot.Height", (int)VbeHeight.Value);
VbeDepth.Value = settings.GetValue("Multiboot.Depth", (int)VbeDepth.Value);

PlugKorlib.IsChecked = settings.GetValue("Launcher.PlugKorlib", PlugKorlib.IsChecked!.Value);
OsNameTxt.Text = settings.GetValue("OS.Name");

ImgCmb.SelectedIndex = settings.GetValue("Image.Format") switch
{
"IMG" => 0,
"VHD" => 1,
"VDI" => 2,
"VMDK" => 3,
_ => ImgCmb.SelectedIndex
};

EmuCmb.SelectedIndex = settings.GetValue("Emulator") switch
{
"Qemu" => 0,
"Bochs" => 1,
"VMware" => 2,
"VirtualBox" => 3,
_ => EmuCmb.SelectedIndex
};

CntCmb.SelectedIndex = settings.GetValue("Emulator.Serial") switch
{
"None" => 0,
"Pipe" => 1,
"TCPServer" => 2,
"TCPClient" => 3,
_ => CntCmb.SelectedIndex
};

FsCmb.SelectedIndex = settings.GetValue("Image.FileSystem") switch
{
"FAT12" => 0,
"FAT16" => 1,
"FAT32" => 2,
_ => FsCmb.SelectedIndex
};

PltCmb.SelectedIndex = settings.GetValue("Compiler.Platform") switch
{
"x86" => 0,
"x64" => 1,
"ARMv8A32" => 2,
_ => 0
};

FrmCmb.SelectedIndex = settings.GetValue("Image.Firmware") switch
{
"bios" => 0,
_ => FrmCmb.SelectedIndex
};
}

private void UpdateSettings()
{
settings.SetValue("Optimizations.SSA", SsaOpts.IsChecked!.Value);
Expand Down

0 comments on commit 7ca4b1e

Please sign in to comment.