[meld] Clear MinGW environment variable to avoid library path issues (#267)



commit 5d8a55e643e3c821066f97d64767f61b677914a1
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Tue Dec 31 08:09:41 2019 +1000

    Clear MinGW environment variable to avoid library path issues (#267)
    
    The MSYSTEM environment variable causes issues for our msys-bundled
    binary when it looks for DLLs. There's not a lot of accessible
    information on what this is supposed to do, but clearing the variable
    fixes the problem, which is good enough for now.

 bin/meld | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/bin/meld b/bin/meld
index 6b27294d..ac72f0f2 100755
--- a/bin/meld
+++ b/bin/meld
@@ -401,8 +401,9 @@ def setup_glib_logging():
 
 def environment_hacks():
     # We manage cwd ourselves for git operations, and GIT_DIR in particular
-    # can mess with this when set.
-    for var in ('GIT_DIR', 'GIT_WORK_TREE'):
+    # can mess with this when set. MSYSTEM is set by git, and confuses our
+    # msys-packaged version's library search path.
+    for var in ('GIT_DIR', 'GIT_WORK_TREE', 'MSYSTEM'):
         try:
             del os.environ[var]
         except KeyError:
@@ -423,13 +424,13 @@ def run_application():
 
 
 def main():
+    environment_hacks()
     setup_logging()
     disable_stdout_buffering()
     check_requirements()
     setup_glib_logging()
     setup_resources()
     setup_settings()
-    environment_hacks()
     return run_application()
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]