Add a batch script to wrap certain command invocations under WSL draft
authorTed Mielczarek <ted@mielczarek.org>
Thu, 14 Sep 2017 06:46:13 -0400
changeset 668589 15c81ce4e038c5db7b6eb1682d38144233701531
parent 668588 6b5464233197bc531e3e85304f4ca0c9ddadefec
child 668590 64d1de14b18da52e92d83eab9d8fb737cd0d5a3c
push id81087
push userbmo:ted@mielczarek.org
push dateThu, 21 Sep 2017 20:59:05 +0000
milestone57.0a1
Add a batch script to wrap certain command invocations under WSL Environment variables in WSL are not passed to native Windows processes that are invoked. There are a few cases where we really need to set something like PATH in the environment for a Windows process, so this change adds a configure subst'ed batch file that sets a few important variables before invoking the process. MozReview-Commit-ID: 5iHAbxnksMb
build/win32/moz.build
build/win32/vcrun.bat.in
--- a/build/win32/moz.build
+++ b/build/win32/moz.build
@@ -21,8 +21,11 @@ if CONFIG['WIN32_REDIST_DIR'] and CONFIG
             '%%%s/%s' % (CONFIG['WIN32_REDIST_DIR'], CONFIG[f])
         ]
 
 if CONFIG['WIN_UCRT_REDIST_DIR'] and CONFIG['COMPILE_ENVIRONMENT']:
     for f in ['api-ms-win-*.dll', 'ucrtbase.dll']:
         FINAL_TARGET_FILES += [
             '%%%s/%s' % (CONFIG['WIN_UCRT_REDIST_DIR'], f)
         ]
+
+if CONFIG['HOST_IS_WSL']:
+    CONFIGURE_SUBST_FILES += ['vcrun.bat']
new file mode 100644
--- /dev/null
+++ b/build/win32/vcrun.bat.in
@@ -0,0 +1,5 @@
+set INCLUDE=@WININCLUDE@
+set LIB=@LIB@
+set PATH=@WINPATH@
+
+%*