Skip to content

Commit

Permalink
Installer work.
Browse files Browse the repository at this point in the history
Updated NuGet to v4.0.0
Fixed Cosmos.Debug.Hosts.VMWare
  • Loading branch information
jp2masa committed Mar 23, 2017
1 parent 168f011 commit 78d4bdb
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 21 deletions.
Binary file modified Build/Tools/nuget.exe
Binary file not shown.
7 changes: 4 additions & 3 deletions Setup/Cosmos.iss
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Source: ".\Build\Tools\mkisofs\*"; DestDir: "{app}\Build\Tools\mkisofs"; Flags:
;Source: ".\Build\VSIP\*.exe"; DestDir: "{app}\Build\IL2CPU"; Flags: ignoreversion uninsremovereadonly
;Source: ".\Build\VSIP\*.pdb"; DestDir: "{app}\Build\IL2CPU"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\VSIP\IL2CPU\*"; DestDir: "{app}\Build\IL2CPU"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\VSIP\NASM\*"; DestDir: "{app}\Build\NASM"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\VSIP\XSharp\*"; DestDir: "{app}\Build\XSharp"; Flags: ignoreversion uninsremovereadonly

;
Expand All @@ -105,10 +106,10 @@ Source: ".\source\Cosmos.Debug.DebugStub\*.xs"; DestDir: "{app}\XSharp\DebugStub

; VSIP stuff
;Source: ".\Build\VSIP\Cosmos.targets"; DestDir: "{pf32}\MSBuild\Cosmos"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\VSIP\Cosmos.Assembler.*"; DestDir: "{app}\Build\VSIP\"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\VSIP\Cosmos.Build.*"; DestDir: "{app}\Build\VSIP\"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\VSIP\Cosmos.Debug.*"; DestDir: "{app}\Build\VSIP\"; Flags: ignoreversion uninsremovereadonly
;Source: ".\Build\VSIP\Cosmos.VS.*"; DestDir: "{app}\Build\VSIP\"; Flags: ignoreversion uninsremovereadonly
;Source: ".\Build\VSIP\Cosmos.Debug.*"; DestDir: "{app}\Build\VSIP\"; Flags: ignoreversion uninsremovereadonly
;Source: ".\Build\VSIP\Cosmos.Build.*"; DestDir: "{app}\Build\VSIP\"; Flags: ignoreversion uninsremovereadonly
;Source: ".\Build\VSIP\Cosmos.Assembler.*"; DestDir: "{app}\Build\VSIP\"; Flags: ignoreversion uninsremovereadonly
;Source: ".\Build\VSIP\XSharp.Nasm.*"; DestDir: "{app}\Build\VSIP\"; Flags: ignoreversion uninsremovereadonly
;Source: ".\Build\VSIP\XSharp.VS.pdb"; DestDir: "{app}\Build\VSIP\"; Flags: ignoreversion uninsremovereadonly
;Source: ".\Build\VSIP\XSharp.VS.dll"; DestDir: "{app}\Build\VSIP\"; Flags: ignoreversion uninsremovereadonly
Expand Down
47 changes: 31 additions & 16 deletions Tests/Cosmos.TestRunner.Core/Engine.Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ private void RunExtractMapFromElfFile(string workingDir, string kernelFileName)

private void RunIL2CPU(string kernelFileName, string outputFile)
{

References = new List<string>
{
kernelFileName,
Expand All @@ -173,7 +172,7 @@ private void RunIL2CPU(string kernelFileName, string outputFile)
Assembly.Load(new AssemblyName("Cosmos.System.Plugs")).Location
};

var xArguments = new List<string>
var xArgs = new List<string>
{
"DebugEnabled:true",
"StackCorruptionDetectionEnabled:" + EnableStackCorruptionChecks,
Expand All @@ -187,24 +186,40 @@ private void RunIL2CPU(string kernelFileName, string outputFile)
"EmitDebugSymbols:True",
"IgnoreDebugStubAttribute:False"
};
xArguments.AddRange(References.Select(aReference => "References:" + aReference));

if (DebugIL2CPU)
{
if (KernelsToRun.Count > 1)
xArgs.AddRange(References.Select(aReference => "References:" + aReference));
bool xUsingUserkit = false;
string xIL2CPUPath = Path.Combine(FindCosmosRoot(), "source", "IL2CPU");
if (!Directory.Exists(xIL2CPUPath))
{
throw new Exception("Cannot run multiple kernels with in-process compilation!");
xUsingUserkit = true;
xIL2CPUPath = Path.Combine(GetCosmosUserkitFolder(), "Build", "IL2CPU");
}

// ensure we're using the referenced (= solution) version
Cosmos.IL2CPU.CosmosAssembler.ReadDebugStubFromDisk = false;

Program.Run(xArguments.ToArray(), OutputHandler.LogMessage, OutputHandler.LogError);
if (xUsingUserkit)
{
RunProcess("IL2CPU.exe", xIL2CPUPath, xArgs, DebugIL2CPU);
}
else
{
string xIL2CPUPath = GetCosmosUserkitFolder();
RunProcess("IL2CPU", xIL2CPUPath, xArguments, DebugIL2CPU);
if (DebugIL2CPU)
{
if (KernelsToRun.Count > 1)
{
throw new Exception("Cannot run multiple kernels with in-process compilation!");
}

// ensure we're using the referenced (= solution) version
Cosmos.IL2CPU.CosmosAssembler.ReadDebugStubFromDisk = false;

Program.Run(xArgs.ToArray(), OutputHandler.LogMessage, OutputHandler.LogError);
}
else
{
xArgs.Insert(0, "run");
xArgs.Insert(1, " -- ");
RunProcess("dotnet", xIL2CPUPath, xArgs);
}
}
}

Expand All @@ -215,7 +230,7 @@ private void RunNasm(string inputFile, string outputFile, bool isElf)
if (!Directory.Exists(xNasmPath))
{
xUsingUserkit = true;
xNasmPath = Path.Combine(GetCosmosUserkitFolder(), "Tools", "NASM");
xNasmPath = Path.Combine(GetCosmosUserkitFolder(), "Build", "NASM");
}
if (!Directory.Exists(xNasmPath))
{
Expand All @@ -232,7 +247,7 @@ private void RunNasm(string inputFile, string outputFile, bool isElf)

if (xUsingUserkit)
{
RunProcess("NASM", xNasmPath, xArgs);
RunProcess("NASM.exe", xNasmPath, xArgs);
}
else
{
Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ build_script:
rem %APPVEYOR_BUILD_FOLDER%
nuget restore "Builder.sln"
nuget restore "Cosmos.sln"
msbuild "Builder.sln" /maxcpucount /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:Platform="Any CPU" /p:Configuration=Debug /p:DeployExtension=false
Expand Down
1 change: 1 addition & 0 deletions install-VS2017.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ else
}
}

Start-Process "Build\Tools\nuget.exe" "restore", "Builder.sln" -Wait
Start-Process "dotnet" "restore", "Cosmos.sln" -Wait

$MSBuildPath = [System.IO.Path]::Combine($CurrentInstance.InstallationPath, "MSBuild", "15.0", "Bin", "MSBuild.exe")
Expand Down
1 change: 1 addition & 0 deletions source/Cosmos.Build.Builder/CosmosTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ void CompileCosmos()
string xVSIPDir = Path.Combine(mCosmosDir, "Build", "VSIP");

DotnetPublish(@"source\IL2CPU", "netcoreapp1.0", "win7-x86", Path.Combine(xVSIPDir, "IL2CPU"));
DotnetPublish(@"Tools\NASM", "netcoreapp1.0", "win7-x86", Path.Combine(xVSIPDir, "NASM"));
DotnetPublish(@"source\XSharp.Compiler", "netcoreapp1.0", "win7-x86", Path.Combine(xVSIPDir, "XSharp"));

MSBuild(Path.Combine(mCosmosDir, @"Build.sln"), "Debug");
Expand Down
4 changes: 2 additions & 2 deletions source/Cosmos.Debug.Hosts/VMware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public override void Start() {
// Options must come beore the vmx, and cannot use shellexecute
xPSI.Arguments = "-x -q " + xVmxPath;
}
xPSI.UseShellExecute = true; //must be true to allow elevate the process, sometimes needed if vmware only runs with admin rights
xPSI.UseShellExecute = false; //must be true to allow elevate the process, sometimes needed if vmware only runs with admin rights
mProcess.EnableRaisingEvents = true;
mProcess.Exited += delegate(Object aSender, EventArgs e) {
if (OnShutDown != null) {
Expand Down Expand Up @@ -146,7 +146,7 @@ protected void CreateDebugVmx() {
using (var xSrc = new StreamReader(File.Open(Path.Combine(mDir, "Cosmos.vmx"), FileMode.OpenOrCreate))) {
try {
// Write out Debug.vmx
using (var xDest = new StreamWriter(File.Open(mVmxPath, FileMode.Open))) {
using (var xDest = new StreamWriter(File.Open(mVmxPath, FileMode.Create))) {
string xLine;
while ((xLine = xSrc.ReadLine()) != null) {
var xParts = xLine.Split('=');
Expand Down

0 comments on commit 78d4bdb

Please sign in to comment.