forked from MeloNX/MeloNX
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. :)
This commit is contained in:
parent
c15782d1c6
commit
5cc2854312
@ -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()}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user