From 23470368b2c9c17f798804de90bc7c080ef8113b Mon Sep 17 00:00:00 2001 From: Gaurav Khanna Date: Tue, 29 Dec 2015 16:21:49 -0800 Subject: [PATCH] Fix the trimming of terminating slashes when computing ILCSDKPath Remove lxstubs.cpp from Linux JIT compile --- src/Microsoft.DotNet.Tools.Compiler.Native/ArgValues.cs | 5 +++++ .../IntermediateCompilation/Linux/LinuxCppCompileStep.cs | 5 +---- .../IntermediateCompilation/Linux/LinuxRyuJitCompileStep.cs | 3 --- .../IntermediateCompilation/Mac/MacCppCompileStep.cs | 5 +---- .../IntermediateCompilation/Windows/WindowsCppCompileStep.cs | 4 ---- 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/Microsoft.DotNet.Tools.Compiler.Native/ArgValues.cs b/src/Microsoft.DotNet.Tools.Compiler.Native/ArgValues.cs index 4212fb0b9..16b519a74 100644 --- a/src/Microsoft.DotNet.Tools.Compiler.Native/ArgValues.cs +++ b/src/Microsoft.DotNet.Tools.Compiler.Native/ArgValues.cs @@ -65,6 +65,11 @@ namespace Microsoft.DotNet.Tools.Compiler.Native config.IlcSdkPath = IlcSdkPath; } + // Get the directory name to ensure there are no trailing slashes as they may conflict + // with the terminating " we suffix to account for paths with spaces in them. + char[] charsToTrim = {'\\', '/'}; + config.IlcSdkPath = config.IlcSdkPath.TrimEnd(charsToTrim); + if (!string.IsNullOrEmpty(LogPath)) { config.LogPath = LogPath; diff --git a/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Linux/LinuxCppCompileStep.cs b/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Linux/LinuxCppCompileStep.cs index 034f93a14..19d23d8a7 100644 --- a/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Linux/LinuxCppCompileStep.cs +++ b/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Linux/LinuxCppCompileStep.cs @@ -67,10 +67,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Native // TODO: Enable this when https://github.com/dotnet/cli/pull/469 goes through. // var ilcSdkIncPath = Path.Combine(config.IlcSdkPath, "inc"); - // - // Get the directory name to ensure there are no trailing slashes as they may conflict - // with the terminating " we suffix to account for paths with spaces in them. - var ilcSdkIncPath = Path.GetDirectoryName(config.IlcSdkPath); + var ilcSdkIncPath = config.IlcSdkPath; argsList.Add("-I"); argsList.Add($"\"{ilcSdkIncPath}\""); diff --git a/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Linux/LinuxRyuJitCompileStep.cs b/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Linux/LinuxRyuJitCompileStep.cs index de0d30179..9668a14d0 100644 --- a/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Linux/LinuxRyuJitCompileStep.cs +++ b/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Linux/LinuxRyuJitCompileStep.cs @@ -95,9 +95,6 @@ namespace Microsoft.DotNet.Tools.Compiler.Native var libOut = DetermineOutputFile(config); argsList.Add($"-o \"{libOut}\""); - // Add Stubs - argsList.Add(Path.Combine(config.AppDepSDKPath, "CPPSdk/ubuntu.14.04/lxstubs.cpp")); - this.CompilerArgStr = string.Join(" ", argsList); } diff --git a/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Mac/MacCppCompileStep.cs b/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Mac/MacCppCompileStep.cs index 1a7bbeac5..156d26692 100644 --- a/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Mac/MacCppCompileStep.cs +++ b/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Mac/MacCppCompileStep.cs @@ -69,10 +69,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Native // TODO: Enable this when https://github.com/dotnet/cli/pull/469 goes through. // var ilcSdkIncPath = Path.Combine(config.IlcSdkPath, "inc"); - // - // Get the directory name to ensure there are no trailing slashes as they may conflict - // with the terminating " we suffix to account for paths with spaces in them. - var ilcSdkIncPath = Path.GetDirectoryName(config.IlcSdkPath); + var ilcSdkIncPath = config.IlcSdkPath; argsList.Add("-I"); argsList.Add($"\"{ilcSdkIncPath}\""); diff --git a/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Windows/WindowsCppCompileStep.cs b/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Windows/WindowsCppCompileStep.cs index a6b0575c0..64e331a92 100644 --- a/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Windows/WindowsCppCompileStep.cs +++ b/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Windows/WindowsCppCompileStep.cs @@ -71,11 +71,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Native // // TODO: Enable this when https://github.com/dotnet/cli/pull/469 goes through. // var ilcSdkIncPath = Path.Combine(config.IlcSdkPath, "inc"); - // - // Get the directory name to ensure there are no trailing slashes as they may conflict - // with the terminating " we suffix to account for paths with spaces in them. var ilcSdkIncPath = config.IlcSdkPath; - ilcSdkIncPath = ilcSdkIncPath.TrimEnd(new char[] {'\\'}); argsList.Add("/I"); argsList.Add($"\"{ilcSdkIncPath}\"");