~hristoast/wem

7b62435662a80e0a30f1b81042e7f4198db740b6 — Hristos N. Triantafillou 11 months ago 8707067
Set WINE_LARGE_ADDRESS_AWARE=1 when DXVK is in use (#10)
2 files changed, 8 insertions(+), 3 deletions(-)

M env/main.go
M env/main_test.go
M env/main.go => env/main.go +5 -0
@@ 165,6 165,10 @@ func (e *WineEnv) ExeString(exec string, execArgs []string) (string, error) {
		}
	}

	if e.WineOpts.DxvkVersion != "" {
		s.WriteString("WINE_LARGE_ADDRESS_AWARE=1 ")
	}

	s.WriteString(fmt.Sprintf("WINEARCH=%s ", e.WineOpts.WineArch))
	s.WriteString(fmt.Sprintf("WINEPREFIX=%s ", e.WineOpts.WinePrefix))



@@ 430,6 434,7 @@ func (e *WineEnv) RunCtx(cacheDir string) (*exe.ExeCtx, error) {
				overrides += ";"
			}
			overrides += "d3d9,d3d10,d3d10core,d3d11=native"
			e.SysOpts.SysEnvVars = append(e.SysOpts.SysEnvVars, "WINE_LARGE_ADDRESS_AWARE=1")

		} else {
			return nil, fmt.Errorf("invalid DXVK version: %s", e.WineOpts.DxvkVersion)

M env/main_test.go => env/main_test.go +3 -3
@@ 150,7 150,7 @@ WinetricksPath = "Seventeen"
		if err != nil {
			t.Errorf("Got an error: %s", err.Error())
		}
		expected := fmt.Sprintf("Seven; cd Nine; foo=bar baz=zow lala=lolo WINEARCH=Thirteen WINEPREFIX=%s VK_ICD_FILENAMES=Eighteen WINEDLLOVERRIDES=d3d9,d3d10,d3d10core,d3d11=native;d3d12=native;Fourteen Five Fifteen idk jaja explorer /desktop=Eleven Four a b c Six; Eight", prefixPath)
		expected := fmt.Sprintf("Seven; cd Nine; foo=bar baz=zow lala=lolo WINE_LARGE_ADDRESS_AWARE=1 WINEARCH=Thirteen WINEPREFIX=%s VK_ICD_FILENAMES=Eighteen WINEDLLOVERRIDES=d3d9,d3d10,d3d10core,d3d11=native;d3d12=native;Fourteen Five Fifteen idk jaja explorer /desktop=Eleven Four a b c Six; Eight", prefixPath)
		if es != expected {
			t.Errorf("got: %s; want: %s", es, expected)
		}


@@ 161,7 161,7 @@ WinetricksPath = "Seventeen"
		if err != nil {
			t.Errorf("Got an error: %s", err.Error())
		}
		expected := fmt.Sprintf("cd Nine; foo=bar baz=zow lala=lolo WINEARCH=Thirteen WINEPREFIX=%s VK_ICD_FILENAMES=Eighteen WINEDLLOVERRIDES=d3d9,d3d10,d3d10core,d3d11=native;d3d12=native;Fourteen Five Fifteen idk jaja explorer /desktop=Eleven toExec", prefixPath)
		expected := fmt.Sprintf("cd Nine; foo=bar baz=zow lala=lolo WINE_LARGE_ADDRESS_AWARE=1 WINEARCH=Thirteen WINEPREFIX=%s VK_ICD_FILENAMES=Eighteen WINEDLLOVERRIDES=d3d9,d3d10,d3d10core,d3d11=native;d3d12=native;Fourteen Five Fifteen idk jaja explorer /desktop=Eleven toExec", prefixPath)
		if es != expected {
			t.Errorf("got: %s; want: %s", es, expected)
		}


@@ 172,7 172,7 @@ WinetricksPath = "Seventeen"
		if err != nil {
			t.Errorf("Got an error: %s", err.Error())
		}
		expected := fmt.Sprintf("cd Nine; foo=bar baz=zow lala=lolo WINEARCH=Thirteen WINEPREFIX=%s VK_ICD_FILENAMES=Eighteen WINEDLLOVERRIDES=d3d9,d3d10,d3d10core,d3d11=native;d3d12=native;Fourteen Five Fifteen idk jaja explorer /desktop=Eleven toExec arg1 arg2 arg3", prefixPath)
		expected := fmt.Sprintf("cd Nine; foo=bar baz=zow lala=lolo WINE_LARGE_ADDRESS_AWARE=1 WINEARCH=Thirteen WINEPREFIX=%s VK_ICD_FILENAMES=Eighteen WINEDLLOVERRIDES=d3d9,d3d10,d3d10core,d3d11=native;d3d12=native;Fourteen Five Fifteen idk jaja explorer /desktop=Eleven toExec arg1 arg2 arg3", prefixPath)
		if es != expected {
			t.Errorf("got: %s; want: %s", es, expected)
		}