From cae6a617db55c43ad09db7cc307bda548f9c914f Mon Sep 17 00:00:00 2001 From: Jean-Christophe Morin Date: Fri, 22 Sep 2023 13:05:13 -0400 Subject: [PATCH] Add a way to print the full command line being executed by the launcher --- .github/workflows/wheel.yaml | 2 ++ launcher/remote-appended.patch | 41 ++++++++++++++++++++++------------ 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/.github/workflows/wheel.yaml b/.github/workflows/wheel.yaml index 510e39218d..608c57a8dd 100644 --- a/.github/workflows/wheel.yaml +++ b/.github/workflows/wheel.yaml @@ -85,6 +85,8 @@ jobs: set -ex cat .venv/Scripts/rez/rez-script.py cat .venv/Scripts/rez/jctest-script.py + export REZ_LAUNCHER_DEBUG=1 + jctest rez --help diff --git a/launcher/remote-appended.patch b/launcher/remote-appended.patch index 9c616ac7d4..5e07dfb524 100644 --- a/launcher/remote-appended.patch +++ b/launcher/remote-appended.patch @@ -1,14 +1,27 @@ -diff --git a/launcher.c b/launcher.c -index 727f7916..2447d378 100644 ---- a/launcher.c -+++ b/launcher.c -@@ -35,8 +35,6 @@ - - #pragma comment (lib, "Shlwapi.lib") - --#define APPENDED_ARCHIVE --#define USE_ENVIRONMENT - #define SUPPORT_RELATIVE_PATH - - #define MSGSIZE 1024 - +diff --git a/launcher.c b/launcher.c +index 727f7916..431e0339 100644 +--- a/launcher.c ++++ b/launcher.c +@@ -35,8 +35,6 @@ + + #pragma comment (lib, "Shlwapi.lib") + +-#define APPENDED_ARCHIVE +-#define USE_ENVIRONMENT + #define SUPPORT_RELATIVE_PATH + + #define MSGSIZE 1024 +@@ -822,6 +820,13 @@ run_child(wchar_t * cmdline) + #endif + si.dwFlags |= STARTF_USESTDHANDLES; + } ++ ++ size_t rez_envvar_size = 0; ++ getenv_s(&rez_envvar_size, NULL, 0, "REZ_LAUNCHER_DEBUG"); ++ if (rez_envvar_size > 0) { ++ printf("Launching: %ls\n", cmdline); ++ } ++ + ok = CreateProcessW(NULL, cmdline, NULL, NULL, TRUE, 0, NULL, NULL, &si, &child_process_info); + if (!ok) { + // Failed to create process. See if we can find out why.