From: Tom Clegg Date: Wed, 22 Mar 2017 16:04:43 +0000 (-0400) Subject: Do not let golang.org/x/tools/cmd/bundle get ahead of Ruby bundler. X-Git-Tag: 1.1.0~368 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/5689f1de6e1a263237303b73013dcebb4ad77e1f Do not let golang.org/x/tools/cmd/bundle get ahead of Ruby bundler. refs https://dev.arvados.org/projects/arvados/wiki/Emacs_and_Go No issue # --- diff --git a/sdk/python/tests/run_test_server.py b/sdk/python/tests/run_test_server.py index 776ff728cb..da35f4fc9b 100644 --- a/sdk/python/tests/run_test_server.py +++ b/sdk/python/tests/run_test_server.py @@ -34,9 +34,19 @@ import arvados.config ARVADOS_DIR = os.path.realpath(os.path.join(MY_DIRNAME, '../../..')) SERVICES_SRC_DIR = os.path.join(ARVADOS_DIR, 'services') if 'GOPATH' in os.environ: + # Add all GOPATH bin dirs to PATH -- but insert them after the + # ruby gems bin dir, to ensure "bundle" runs the Ruby bundler + # command, not the golang.org/x/tools/cmd/bundle command. gopaths = os.environ['GOPATH'].split(':') - gobins = [os.path.join(path, 'bin') for path in gopaths] - os.environ['PATH'] = ':'.join(gobins) + ':' + os.environ['PATH'] + addbins = [os.path.join(path, 'bin') for path in gopaths] + newbins = [] + for path in os.environ['PATH'].split(':'): + newbins.append(path) + if os.path.exists(os.path.join(path, 'bundle')): + newbins += addbins + addbins = [] + newbins += addbins + os.environ['PATH'] = ':'.join(newbins) TEST_TMPDIR = os.path.join(ARVADOS_DIR, 'tmp') if not os.path.exists(TEST_TMPDIR):