[m-rev.] diff: futher powershell integration

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Dec 14 13:28:12 AEDT 2012


Branches: main, 12.08(?)

Further work on PowerShell integration -- PowerShell is now usable as a host
environment type for Mercury.  As a target environment type, PowerShell is
currently treated as identical to cmd.exe by Mercury.

compiler/module_cmds.m:
     Fix an XXX: on Windows with PowerShell we can redirect standard
     error in the shell; do so.

compiler/compile_target_code.m:
     When --verbose-commands is enabled, include any escapes for @files
     in the verbose message.   (This assists with manually debugging
     such command lines.)

Julien.

Index: compiler/compile_target_code.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/compile_target_code.m,v
retrieving revision 1.192
diff -u -r1.192 compile_target_code.m
--- compiler/compile_target_code.m      13 Dec 2012 16:22:23 -0000      1.192
+++ compiler/compile_target_code.m      14 Dec 2012 02:17:54 -0000
@@ -3479,7 +3479,8 @@
              globals.lookup_bool_option(Globals, very_verbose, VeryVerbose),
              (
                  VeryVerbose = yes,
-                io.write_string("% Args placed in @" ++ TmpFile ++ ": `", !IO),
+                io.write_string("% Args placed in ", !IO),
+                io.write_string(at_file_name(Globals, TmpFile) ++ ": `", !IO),
                  io.write_string(TmpFileArgs, !IO),
                  io.write_string("'\n", !IO),
                  io.flush_output(!IO)
Index: compiler/module_cmds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/module_cmds.m,v
retrieving revision 1.24
diff -u -r1.24 module_cmds.m
--- compiler/module_cmds.m      13 Dec 2012 16:22:23 -0000      1.24
+++ compiler/module_cmds.m      14 Dec 2012 02:17:56 -0000
@@ -617,10 +617,9 @@
          ( use_win32 ->
              get_host_env_type(Globals, HostEnvType),
              ( HostEnvType = env_type_powershell ->
-                % XXX we should be able to redirect stderr here too.
                  ProcessOutputRedirected = string.append_list(
                      ["Get-Content ", TmpFile, " | ", ProcessOutput,
-                        " > ", ProcessedTmpFile])
+                        " > ", ProcessedTmpFile, " 2>&1"])
              ;
                  % On windows we can't in general redirect standard
                  % error in the shell.



More information about the reviews mailing list