From ee4e18ff0d7bd254d8cda5ecee51f7baa0da94cb Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Sat, 22 Jul 2023 01:59:41 +0200 Subject: [PATCH] Fix PATH variable on Windows I spent ~7 hours debugging this. I searched for a bug in the Exec task and found nothing. I tried different ways to invoke the dotnet command to make sure PATH is always set before. I also modified Microsoft.NETCore.Native.Unix.targets to echo PATH via Exec and via Text. But in the end I was confused about seeing two PATH variables when checking the dotnet.exe subprocess with ProcessHacker. This made me try setting the Path variable instead of PATH and to my surprise this just worked. Turns out Windows environment variables are case-sensitive and Windows uses Path instead of PATH like Unix. God, I love Microsoft Windows. :) --- src/RyujinxAndroid/libryujinx/build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/RyujinxAndroid/libryujinx/build.gradle b/src/RyujinxAndroid/libryujinx/build.gradle index 4c48e1701..ca22a0faa 100644 --- a/src/RyujinxAndroid/libryujinx/build.gradle +++ b/src/RyujinxAndroid/libryujinx/build.gradle @@ -84,7 +84,8 @@ tasks.register('compileLibRyujinx', Exec) { OperatingSystem os = DefaultNativePlatform.currentOperatingSystem if (toolchainPath != null) { if (os.isWindows()) { - environment "PATH", "${toolchainPath};${providers.environmentVariable("PATH").get()}" + // NOTE: This is not a typo. dotnet.exe actually uses Path instead of PATH. + environment "Path", "${toolchainPath};${providers.environmentVariable("PATH").get()}" } else { environment "PATH", "${toolchainPath}:${providers.environmentVariable("PATH").get()}"