diff --git a/scripts/Makefile b/scripts/Makefile index 9a1027347..1f49d7d91 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -183,14 +183,14 @@ run-file: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-release-clr pester-tests: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-release-clr # execute the pester tests, pester needs a TEMP environment variable to be set - exec_env/app_base/runps-simple.sh 'cd ../src/pester-tests; $$env:TEMP="/tmp"; invoke-pester' + exec_env/app_base/runps-simple.sh 'cd ../../../src/pester-tests; $$env:TEMP="/tmp"; invoke-pester' test: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-release-clr $(addprefix $(TESTRUN_FOLDER)/, ps_test.dll xunit.console.netcore.exe xunit.runner.utility.dll xunit.abstractions.dll xunit.execution.dll) pester-tests dotnetlibs/monad_native cd exec_env/app_base && PSMODULEPATH=$(shell pwd)/exec_env/app_base/Modules LD_LIBRARY_PATH=../coreclr:. ../coreclr/corerun xunit.console.netcore.exe ps_test.dll -xml ../../xunittests.xml # run the c++ tests cd dotnetlibs && ./monad_native # test the 3rdparty/hashbang sample - PATH=$(PATH):$(shell pwd)/exec_env/app_base 3rdparty/hashbang/script.ps1 + PATH=$(PATH):$(shell pwd)/exec_env/app_base $(shell pwd)/3rdparty/hashbang/script.ps1 run-debugclr: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-debug-clr PAL_DBG_CHANNELS="+LOADER.TRACE" exec_env/app_base/runps-simple.sh get-location diff --git a/scripts/powershell-run.mk b/scripts/powershell-run.mk index 712b75c69..71a741266 100644 --- a/scripts/powershell-run.mk +++ b/scripts/powershell-run.mk @@ -19,5 +19,3 @@ dotnetlibs/powershell-run.exe: $(POWERSHELL_RUN_SRCS) $(POWERSHELL_RUN_DEPS) dotnetlibs/powershell-simple.exe: $(POWERSHELL_SIMPLE_SRCS) $(POWERSHELL_RUN_DEPS) $(CSC) -out:$@ -noconfig -nostdlib -target:exe $(POWERSHELL_RUN_REFS) $(COREREF) $(POWERSHELL_SIMPLE_SRCS) - - diff --git a/scripts/runps-file.sh b/scripts/runps-file.sh index e3239ccdc..4dcf52cd1 100755 --- a/scripts/runps-file.sh +++ b/scripts/runps-file.sh @@ -3,4 +3,3 @@ SCRIPTDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) "$SCRIPTDIR/runps.sh" --file "$@" - diff --git a/scripts/runps-simple-debug.sh b/scripts/runps-simple-debug.sh index 6bbe7a82d..5d3fbe4fb 100755 --- a/scripts/runps-simple-debug.sh +++ b/scripts/runps-simple-debug.sh @@ -5,5 +5,4 @@ SCRIPTDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) cd "$SCRIPTDIR" echo "launching PS debug now" -PSMODULEPATH="$SCRIPTDIR/Modules" LD_LIBRARY_PATH="$SCRIPTDIR:/usr/lib/llvm-3.6/lib" lldb-3.6 ./host_cmdline -- -c ../coreclr -alc Microsoft.PowerShell.CoreCLR.AssemblyLoadContext.dll -tpa powershell-simple.exe "powershell-simple, version=1.0.0.0, culture=neutral, PublicKeyToken=null" "ps_hello_world.Program" "UnmanagedMain" --working-dir "$CWD" "$@" - +PSMODULEPATH="$SCRIPTDIR/Modules" LD_LIBRARY_PATH="$SCRIPTDIR:/usr/lib/llvm-3.6/lib" lldb-3.6 ./host_cmdline -- -c ../coreclr -alc Microsoft.PowerShell.CoreCLR.AssemblyLoadContext.dll -tpa powershell-simple.exe powershell-simple.exe "$@" diff --git a/scripts/runps-simple-trace.sh b/scripts/runps-simple-trace.sh index d8e08c031..f2932e827 100755 --- a/scripts/runps-simple-trace.sh +++ b/scripts/runps-simple-trace.sh @@ -5,5 +5,4 @@ SCRIPTDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) cd "$SCRIPTDIR" echo "launching PS trace now" -PSMODULEPATH="$SCRIPTDIR/Modules" LD_LIBRARY_PATH="$SCRIPTDIR" strace -e trace=file ./host_cmdline -c ../coreclr -alc Microsoft.PowerShell.CoreCLR.AssemblyLoadContext.dll -tpa powershell-simple.exe "powershell-simple, version=1.0.0.0, culture=neutral, PublicKeyToken=null" "ps_hello_world.Program" "UnmanagedMain" --working-dir "$CWD" "$@" - +PSMODULEPATH="$SCRIPTDIR/Modules" LD_LIBRARY_PATH="$SCRIPTDIR" strace -e trace=file ./host_cmdline -c ../coreclr -alc Microsoft.PowerShell.CoreCLR.AssemblyLoadContext.dll -tpa powershell-simple.exe powershell-simple.exe "$@" diff --git a/scripts/runps-simple.sh b/scripts/runps-simple.sh index 214fc6465..63615f271 100755 --- a/scripts/runps-simple.sh +++ b/scripts/runps-simple.sh @@ -4,5 +4,4 @@ CWD=$(pwd) SCRIPTDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) cd "$SCRIPTDIR" -PSMODULEPATH="$SCRIPTDIR/Modules" LD_LIBRARY_PATH="$SCRIPTDIR" ./host_cmdline -c ../coreclr -alc Microsoft.PowerShell.CoreCLR.AssemblyLoadContext.dll -tpa powershell-simple.exe "powershell-simple, version=1.0.0.0, culture=neutral, PublicKeyToken=null" "ps_hello_world.Program" "UnmanagedMain" --working-dir "$CWD" "$@" - +PSMODULEPATH="$SCRIPTDIR/Modules" LD_LIBRARY_PATH="$SCRIPTDIR" ./host_cmdline -c ../coreclr -alc Microsoft.PowerShell.CoreCLR.AssemblyLoadContext.dll -tpa powershell-simple.exe powershell-simple.exe "$@" diff --git a/scripts/runps.sh b/scripts/runps.sh index 5f672c053..d47a5e77e 100755 --- a/scripts/runps.sh +++ b/scripts/runps.sh @@ -4,5 +4,4 @@ CWD=$(pwd) SCRIPTDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) cd "$SCRIPTDIR" -PSMODULEPATH="$SCRIPTDIR/Modules" LD_LIBRARY_PATH="$SCRIPTDIR" ./host_cmdline -c ../coreclr -alc Microsoft.PowerShell.CoreCLR.AssemblyLoadContext.dll -tpa powershell-run.exe "powershell-run, version=1.0.0.0, culture=neutral, PublicKeyToken=null" "Microsoft.Samples.PowerShell.Host.PSListenerConsoleSample" "UnmanagedMain" --working-dir "$CWD" "$@" - +PSMODULEPATH="$SCRIPTDIR/Modules" LD_LIBRARY_PATH="$SCRIPTDIR" ./host_cmdline -c ../coreclr -alc Microsoft.PowerShell.CoreCLR.AssemblyLoadContext.dll -tpa powershell-run.exe powershell-run.exe "$@" diff --git a/src/monad b/src/monad index df562ce7e..2793b76e2 160000 --- a/src/monad +++ b/src/monad @@ -1 +1 @@ -Subproject commit df562ce7ecd60fb42e30702116123c8a58bf04d4 +Subproject commit 2793b76e2d48f012a82b8e9106b9e9f496d3b785 diff --git a/src/monad-ext b/src/monad-ext index 20468e65d..ea31eca62 160000 --- a/src/monad-ext +++ b/src/monad-ext @@ -1 +1 @@ -Subproject commit 20468e65dac6fa5a1b4cf6971ff490e548531822 +Subproject commit ea31eca6223992fa9729af67518930b6b45829d3 diff --git a/src/monad-native b/src/monad-native index a99c56eea..440cf6a23 160000 --- a/src/monad-native +++ b/src/monad-native @@ -1 +1 @@ -Subproject commit a99c56eea3264b8c492bc0edf5e3a65102397af9 +Subproject commit 440cf6a236067eba2d5dcfd5e3707a36295cee97 diff --git a/src/powershell-run/powershell-simple.cs b/src/powershell-run/powershell-simple.cs index ca0b39358..a3455c1b0 100644 --- a/src/powershell-run/powershell-simple.cs +++ b/src/powershell-run/powershell-simple.cs @@ -456,25 +456,6 @@ namespace ps_hello_world } } - public static void init() - { - //string psBasePath = System.IO.Directory.GetCurrentDirectory(); - //PowerShellAssemblyLoadContextInitializer.SetPowerShellAssemblyLoadContext(psBasePath); - - //Assembly a = Assembly.Load(new AssemblyName("System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")); - //Console.WriteLine("##########################\nloaded assembly a=" + a + " during init\n#########################"); - - // PH: this debugging requires a change in the core PS stuff that was stashed away - // during source cleanup - /* - PowerShellAssemblyLoadContext asmLoadContext = PowerShellAssemblyLoadContextInitializer.AsmLoadContext; - IEnumerable assemblies = asmLoadContext.GetAssemblies("System.Management.Automation"); - foreach (Assembly a in assemblies) - { - Console.WriteLine("a: " + a); - }*/ - } - static void test1(string[] args) { InitialSessionState iss = InitialSessionState.CreateDefault2(); @@ -525,50 +506,8 @@ namespace ps_hello_world } } - public static int UnmanagedMain(int argc, [MarshalAs(UnmanagedType.LPArray,ArraySubType=UnmanagedType.LPStr,SizeParamIndex=0)] String[] argv) - { - init(); - List allArgs = new List(); - - for (int i = 0; i < argc; ++i) - { - allArgs.Add(argv[i]); - } - - List filteredArgs = new List(); - if (allArgs.Count > 0) - { - for (int i = 0; i < allArgs.Count; ++i) - { - string arg = allArgs[i]; - bool hasNext = (i+1)