5ab5c95ea6e32a833ae923d7e212c99dd7285aa6
max
  Fri Dec 1 07:01:47 2023 -0800
prefer static_dot over sys-wide dot, refs #32691

diff --git src/hg/hgGeneGraph/hgGeneGraph src/hg/hgGeneGraph/hgGeneGraph
index 6bfca8f..090bd81 100755
--- src/hg/hgGeneGraph/hgGeneGraph
+++ src/hg/hgGeneGraph/hgGeneGraph
@@ -586,39 +586,37 @@
 
 def findDot():
     """ this would never be run on the RR but only on mirrors, because we specify it in hg.conf.
     It will try to find 'dot' and if it cannot find it, will fall back to cgi-bin/loader/dot_static:
 
         - if anything is specified in hg.conf, it will use that
         - if it can find "dot" in the PATH, it will use that next (dot
           installed from the repos will always work)
         - if that doesn't work either, we run cgi-bin/loader/dot_static (our
           static version may fail due to wrong glibc version) """
     binPath = cfgOption("graphvizPath")
 
     if binPath is not None and binPath.strip()!="":
         return binPath
 
-    installedBin = which("dot")
+    staticPath = join("loader", "dot_static")
+        return staticPath
 
+    installedBin = which("dot")
     if installedBin is None:
-        staticPath = join("loader", "dot_static")
-        if not isfile(staticPath):
         return None
     else:
-            return staticPath
-    else:
         sys.stderr.write("Using graphviz binary %s\n" % installedBin)
         return installedBin
 
 def printDotErrorHelpAndExit():
     print("This often means that on this UCSC Genome Browser, GraphViz is not installed or is too old and ")
     print("that the supplied program dot_static also did not work. It can also mean that the configuration option")
     print("graphvizPath in hg.conf specifies a program that does not work.<p>")
     print("To resolve any of these problems, you will have to contact the system administrator of this Genome Browser server.<p>")
     print("To install GraphViz, ask the administrator of this server to run one of the following commands:<br>")
     print("<tt>sudo apt-get install graphviz</tt><br>")
     print("<tt>sudo wget http://www.graphviz.org/graphviz-rhel.repo -o /etc/yum/repos.d/graphviz.rhel.repo; sudo yum install graphviz*</tt><br>")
     print("<p>")
     print("If you have graphviz installed but this error message still appears, then the ")
     print("graphviz version may be too old.<p>")
     print("Also, the Genome Browser ships with a statically compiled version of")