[llvm] [llvm-lit] Resolve env subcommand required error (PR #98414)

Paul Kirth via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 09:50:58 PDT 2024


================
@@ -744,7 +744,9 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
                 args = updateEnv(cmd_shenv, args)
                 if not args:
                     # Return the environment variables if no argument is provided 
-                    return {key: value for key, value in cmd_shenv.env.items()}
+                    env_str = "\n".join(f"{key}={value}" for key, value in cmd_shenv.env.items())
+                    results.append(ShellCommandResult(j, env_str, "", 0 , timeoutHelper.timeoutReached(), []))
+                    return 0
----------------
ilovepi wrote:

I'm still not 100% that we should be returning here. Have you tested this on the rest of the project? So not just the unit tests, but by running something like `check-all` w/ the internal shell enabled?

https://github.com/llvm/llvm-project/pull/98414


More information about the llvm-commits mailing list