Running mach raptor leads to python error "Library not loaded: @executable_path/../Python3"
Categories
(Testing :: Raptor, defect)
Tracking
(Not tracked)
People
(Reporter: gregtatum, Unassigned)
References
Details
I initially got the warning to not use Python 3.11 on my macbook. I used brew to downgrade to Python 3.10, and got the same error. I removed all of my brew pythons and still got the error.
➤ ./mach raptor --test google-search
...
dyld[35372]: Library not loaded: @executable_path/../Python3
Referenced from: <D25FC34F-14C6-33D3-99D7-FA92FB86094B> /Users/greg/dev/frontend/obj-ff-artifact/testing/raptor-venv/bin/python
Reason: tried: '/Users/greg/dev/frontend/obj-ff-artifact/testing/raptor-venv/Python3' (no such file), '/usr/local/lib/Python3' (no such file), '/usr/lib/Python3' (no such file, not in dyld cache)
Here is the full error:
➤ ./mach raptor --test google-search
Setting up node for browsertime...
Node v16+ found at: /Users/greg/.mozbuild/node/bin/node
Missing browsertime files...attempting to install
Setting --clean to True to rebuild Python environment for Browsertime upgrade...
Using browsertime version 17.11.2 from https://github.com/sitespeedio/browsertime/tarball/e28c2ac64755a91f091e7c900d661f2c4757de41
18:57:13 INFO - ConsoleLogger online at 20230804 18:57:13Z in /Users/greg/dev/frontend
18:57:13 INFO - Run as ./mach raptor --test google-search
18:57:13 INFO - Dumping config to /Users/greg/dev/frontend/testing/mozharness/logs/localconfig.json.
18:57:13 INFO - {'app': 'firefox',
18:57:13 INFO - 'append_to_log': False,
18:57:13 INFO - 'base_work_dir': '/Users/greg/dev/frontend/testing/mozharness',
18:57:13 INFO - 'binary_path': '/Users/greg/dev/frontend/obj-ff-artifact/dist/Nightly.app/Contents/MacOS/firefox',
18:57:13 INFO - 'browsertime': True,
18:57:13 INFO - 'browsertime_browsertimejs': '/Users/greg/dev/frontend/tools/browsertime/node_modules/browsertime/bin/browsertime.js',
18:57:13 INFO - 'browsertime_no_ffwindowrecorder': False,
18:57:13 INFO - 'browsertime_node': '/Users/greg/.mozbuild/node/bin/node',
18:57:13 INFO - 'browsertime_user_args': (),
18:57:13 INFO - 'browsertime_video': False,
18:57:13 INFO - 'browsertime_vismet_script': '/Users/greg/dev/frontend/tools/browsertime/node_modules/browsertime/browsertime/visualmetrics-portable.py',
18:57:13 INFO - 'browsertime_visualmetrics': False,
18:57:13 INFO - 'chimera': False,
18:57:13 INFO - 'clean': True,
18:57:13 INFO - 'code_coverage': False,
18:57:13 INFO - 'cold': False,
18:57:13 INFO - 'collect_perfstats': False,
18:57:13 INFO - 'conditioned_profile': None,
18:57:13 INFO - 'config_files': (),
18:57:13 INFO - 'debug_mode': False,
18:57:13 INFO - 'default_actions': ('populate-webroot',
18:57:13 INFO - 'create-virtualenv',
18:57:13 INFO - 'install-chromium-distribution',
18:57:13 INFO - 'run-tests'),
18:57:13 INFO - 'device_name': None,
18:57:13 INFO - 'disable_ccov_upload': False,
18:57:13 INFO - 'disable_perf_tuning': False,
18:57:13 INFO - 'e10s': True,
18:57:13 INFO - 'enable_marionette_trace': False,
18:57:13 INFO - 'environment': (),
18:57:13 INFO - 'exes': {'python': '/Users/greg/.mozbuild/srcdirs/frontend-e8bfd858611c/_virtualenvs/common/bin/python',
18:57:13 INFO - 'virtualenv': ('/Users/greg/.mozbuild/srcdirs/frontend-e8bfd858611c/_virtualenvs/common/bin/python',
18:57:13 INFO - '/Users/greg/dev/frontend/third_party/python/virtualenv/virtualenv.py')},
18:57:13 INFO - 'extra_prefs': (),
18:57:13 INFO - 'extra_profiler_run': False,
18:57:13 INFO - 'extra_summary_methods': (),
18:57:13 INFO - 'find_links': ('https://pypi.pub.build.mozilla.org/pub/',),
18:57:13 INFO - 'fission': True,
18:57:13 INFO - 'gecko_profile': False,
18:57:13 INFO - 'host': '127.0.0.1',
18:57:13 INFO - 'is_release_build': False,
18:57:13 INFO - 'java_code_coverage': False,
18:57:13 INFO - 'live_sites': False,
18:57:13 INFO - 'log_level': 'info',
18:57:13 INFO - 'log_name': 'raptor',
18:57:13 INFO - 'log_to_console': True,
18:57:13 INFO - 'mozbuild_path': '/Users/greg/.mozbuild',
18:57:13 INFO - 'noinstall': False,
18:57:13 INFO - 'obj_path': '/Users/greg/dev/frontend/obj-ff-artifact',
18:57:13 INFO - 'opt_config_files': (),
18:57:13 INFO - 'per_test_coverage': False,
18:57:13 INFO - 'pip_index': False,
18:57:13 INFO - 'project': 'mozilla-central',
18:57:13 INFO - 'pypi_url': 'http://pypi.org/simple',
18:57:13 INFO - 'raptor_cmd_line_args': ('--test', 'google-search'),
18:57:13 INFO - 'raptor_path': '/Users/greg/dev/frontend/testing/raptor',
18:57:13 INFO - 'repo_path': '/Users/greg/dev/frontend',
18:57:13 INFO - 'requires_gpu': False,
18:57:13 INFO - 'run_local': True,
18:57:13 INFO - 'skip_preflight': False,
18:57:13 INFO - 'test_bytecode_cache': False,
18:57:13 INFO - 'title': 'Moogle.local',
18:57:13 INFO - 'verbose': False,
18:57:13 INFO - 'verify': False,
18:57:13 INFO - 'virtualenv_path': '/Users/greg/dev/frontend/obj-ff-artifact/testing/raptor-venv',
18:57:13 INFO - 'volatile_config': {'actions': None, 'add_actions': None, 'no_actions': None},
18:57:13 INFO - 'work_dir': 'build'}
18:57:13 INFO - [mozharness: 2023-08-04 18:57:13.097093Z] Skipping clobber step.
18:57:13 INFO - [mozharness: 2023-08-04 18:57:13.097116Z] Skipping download-and-extract step.
18:57:13 INFO - [mozharness: 2023-08-04 18:57:13.097137Z] Running populate-webroot step.
18:57:13 INFO - Running pre-action listener: _resource_record_pre_action
18:57:13 INFO - Running main action method: populate_webroot
18:57:13 INFO - Running post-action listener: _resource_record_post_action
18:57:13 INFO - [mozharness: 2023-08-04 18:57:13.097242Z] Finished populate-webroot step (success)
18:57:13 INFO - [mozharness: 2023-08-04 18:57:13.097778Z] Running create-virtualenv step.
18:57:13 INFO - Running pre-action listener: _resource_record_pre_action
18:57:13 INFO - Running main action method: create_virtualenv
18:57:13 INFO - Added local ffmpeg found at: /Users/greg/.mozbuild/browsertime/ffmpeg-macos to environment.
18:57:13 INFO - Creating virtualenv /Users/greg/dev/frontend/obj-ff-artifact/testing/raptor-venv
18:57:13 INFO - Running command: ['/Users/greg/.mozbuild/srcdirs/frontend-e8bfd858611c/_virtualenvs/common/bin/python', '--version']
18:57:13 INFO - Copy/paste: /Users/greg/.mozbuild/srcdirs/frontend-e8bfd858611c/_virtualenvs/common/bin/python --version
18:57:13 INFO - Python 3.9.6
18:57:13 INFO - Return code: 0
18:57:13 INFO - Running command: ['/Users/greg/.mozbuild/srcdirs/frontend-e8bfd858611c/_virtualenvs/common/bin/python', '-m', 'venv', '/Users/greg/dev/frontend/obj-ff-artifact/testing/raptor-venv'] in /Users/greg/dev/frontend/testing/mozharness/build
18:57:13 INFO - Copy/paste: /Users/greg/.mozbuild/srcdirs/frontend-e8bfd858611c/_virtualenvs/common/bin/python -m venv /Users/greg/dev/frontend/obj-ff-artifact/testing/raptor-venv
18:57:15 INFO - Return code: 0
18:57:15 INFO - Running command: ['/Users/greg/dev/frontend/obj-ff-artifact/testing/raptor-venv/bin/python', '-m', 'pip', 'install', '--only-binary', ':all:', '--disable-pip-version-check', '/Users/greg/dev/frontend/third_party/python/_venv/wheels/pip-23.0.1-py3-none-any.whl', '/Users/greg/dev/frontend/third_party/python/_venv/wheels/setuptools-51.2.0-py3-none-any.whl'] in /Users/greg/dev/frontend/testing/mozharness/build
18:57:15 INFO - Copy/paste: /Users/greg/dev/frontend/obj-ff-artifact/testing/raptor-venv/bin/python -m pip install --only-binary :all: --disable-pip-version-check /Users/greg/dev/frontend/third_party/python/_venv/wheels/pip-23.0.1-py3-none-any.whl /Users/greg/dev/frontend/third_party/python/_venv/wheels/setuptools-51.2.0-py3-none-any.whl
18:57:15 INFO - Processing /Users/greg/dev/frontend/third_party/python/_venv/wheels/pip-23.0.1-py3-none-any.whl
18:57:15 INFO - Processing /Users/greg/dev/frontend/third_party/python/_venv/wheels/setuptools-51.2.0-py3-none-any.whl
18:57:15 INFO - Installing collected packages: setuptools, pip
18:57:15 INFO - Attempting uninstall: setuptools
18:57:15 INFO - Found existing installation: setuptools 58.0.4
18:57:15 INFO - Uninstalling setuptools-58.0.4:
18:57:15 INFO - Successfully uninstalled setuptools-58.0.4
18:57:15 INFO - Attempting uninstall: pip
18:57:15 INFO - Found existing installation: pip 21.2.4
18:57:15 INFO - Uninstalling pip-21.2.4:
18:57:15 INFO - Successfully uninstalled pip-21.2.4
18:57:16 INFO - Successfully installed pip-23.0.1 setuptools-51.2.0
18:57:16 INFO - Return code: 0
18:57:16 INFO - macosx
18:57:16 INFO - Copying venv python binaries to /Users/greg/dev/frontend/obj-ff-artifact/testing/raptor-venv/bin/bak to clear for re-sign
18:57:16 INFO - Replacing venv python binaries with reset copies
18:57:16 INFO - codesign -s - --preserve-metadata=identifier,entitlements,flags,runtime -f /Users/greg/dev/frontend/obj-ff-artifact/testing/raptor-venv/bin/*
/Users/greg/dev/frontend/obj-ff-artifact/testing/raptor-venv/bin/python: replacing existing signature
/Users/greg/dev/frontend/obj-ff-artifact/testing/raptor-venv/bin/python3: replacing existing signature
/Users/greg/dev/frontend/obj-ff-artifact/testing/raptor-venv/bin/python3.9: replacing existing signature
18:57:16 INFO - Installing pip>=1.5 into virtualenv /Users/greg/dev/frontend/obj-ff-artifact/testing/raptor-venv
18:57:17 INFO - find_links: connection checks passed for https://pypi.pub.build.mozilla.org/pub/, adding.
18:57:17 INFO - retry: Calling run_command with args: [['/Users/greg/dev/frontend/obj-ff-artifact/testing/raptor-venv/bin/pip', 'install', '--timeout', '120', '--no-index', '--find-links', 'https://pypi.pub.build.mozilla.org/pub/', 'pip>=1.5']], kwargs: {'error_list': [{'substr': 'not found or a compiler error:', 'level': 'warning'}, {'regex': re.compile('\\d+: error: '), 'level': 'error'}, {'regex': re.compile('\\d+: warning: '), 'level': 'warning'}, {'regex': re.compile('Downloading .* \\(.*\\): *([0-9]+%)? *[0-9\\.]+[kmKM]b'), 'level': 'debug'}, {'substr': 'command not found', 'level': 'error'}, {'regex': re.compile('Warning:.*Error: '), 'level': 'warning'}, {'regex': re.compile('package.*> Error:'), 'level': 'error'}, {'substr': 'Traceback (most recent call last)', 'level': 'error'}, {'substr': 'SyntaxError: ', 'level': 'error'}, {'substr': 'TypeError: ', 'level': 'error'}, {'substr': 'NameError: ', 'level': 'error'}, {'substr': 'ZeroDivisionError: ', 'level': 'error'}, {'regex': re.compile('raise \\w*Exception: '), 'level': 'critical'}, {'regex': re.compile('raise \\w*Error: '), 'level': 'critical'}], 'cwd': '/Users/greg/dev/frontend/testing/mozharness/build', 'env': {...}, 'error_level': 'warning'}, attempt #1
18:57:17 INFO - Running command: ['/Users/greg/dev/frontend/obj-ff-artifact/testing/raptor-venv/bin/pip', 'install', '--timeout', '120', '--no-index', '--find-links', 'https://pypi.pub.build.mozilla.org/pub/', 'pip>=1.5'] in /Users/greg/dev/frontend/testing/mozharness/build
18:57:17 INFO - Copy/paste: /Users/greg/dev/frontend/obj-ff-artifact/testing/raptor-venv/bin/pip install --timeout 120 --no-index --find-links https://pypi.pub.build.mozilla.org/pub/ pip>=1.5
18:57:17 INFO - Using env: {'BASH_SILENCE_DEPRECATION_WARNING': '1',
18:57:17 INFO - 'CCACHE_COMPRESS': '',
18:57:17 INFO - 'CLICOLOR': '1',
18:57:17 INFO - 'COLORFGBG': '15;0',
18:57:17 INFO - 'COLORTERM': 'truecolor',
18:57:17 INFO - 'COMMAND_MODE': 'unix2003',
18:57:17 INFO - 'CPATH': '/usr/local/include',
18:57:17 INFO - 'DISPLAY': '/private/tmp/com.apple.launchd.JuOI5785HL/org.xquartz:0',
18:57:17 INFO - 'EDITOR': 'vim',
18:57:17 INFO - 'HISTFILESIZE': '50000000',
18:57:17 INFO - 'HISTSIZE': '1000000',
18:57:17 INFO - 'HOME': '/Users/greg',
18:57:17 INFO - 'ITERM_PROFILE': 'Default',
18:57:17 INFO - 'ITERM_SESSION_ID': 'w0t1p2:B486AA57-3608-4C5C-BAA5-E9A80917BB8C',
18:57:17 INFO - 'LANG': 'en_US.UTF-8',
18:57:17 INFO - 'LC_ALL': 'en_US.UTF-8',
18:57:17 INFO - 'LC_CTYPE': 'en_US.UTF-8',
18:57:17 INFO - 'LC_TERMINAL': 'iTerm2',
18:57:17 INFO - 'LC_TERMINAL_VERSION': '3.4.19',
18:57:17 INFO - 'LIBRARY_PATH': '/usr/local/lib',
18:57:17 INFO - 'LOGNAME': 'greg',
18:57:17 INFO - 'LSCOLORS': 'GxFxCxDxBxegedabagaced',
18:57:17 INFO - 'MACH_MAIN_PID': '35249',
18:57:17 INFO - 'MACH_NOTIFY_MINTIME': '0',
18:57:17 INFO - 'MACH_STDOUT_ISATTY': '1',
18:57:17 INFO - 'MANPATH': '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/share/man:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/share/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man:',
18:57:17 INFO - 'NVM_DIR': '/Users/greg/.nvm',
18:57:17 INFO - 'OLDPWD': '/Users/greg/dev/frontend',
18:57:17 INFO - 'PATH': '/Users/greg/.mozbuild/srcdirs/frontend-e8bfd858611c/_virtualenvs/common/bin:/Users/greg/.mozbuild/srcdirs/frontend-e8bfd858611c/_virtualenvs/mach/bin:/Users/greg/.nvm/versions/node/v12/bin:/Users/greg/scripts/phabricator/arcanist/bin:/Users/greg/dev/gecko-dev:./node_modules/.bin:/Users/greg/scripts/version-control-tools/git/commands:/Users/greg/scripts/moz-git-tools:/Users/greg/scripts:/usr/local/opt/python/libexec/bin:/Applications/VLC.app/Contents/MacOS:/Applications/fceux.app/Contents/MacOS:/usr/local/opt/llvm/bin:/Applications/MuseScore '
18:57:17 INFO - '3.app/Contents/MacOS:/Users/greg/Library/Android/sdk/platform-tools:/Users/greg/Library/Android/sdk/emulator:/opt/homebrew/bin:/Users/greg/.cargo/bin:/Users/greg/.mozbuild/git-cinnabar:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/greg/.cargo/bin:/Users/greg/Library/Python/3.11/bin:/Users/greg/.mozbuild/browsertime/ffmpeg-macos',
18:57:17 INFO - 'PROMPT': '\n\n\n%F{cyan}%~%f%k$(git_branch) 🍏\n%F{red}➤%f%k ',
18:57:17 INFO - 'PWD': '/Users/greg/dev/frontend',
18:57:17 INFO - 'PYTHONHTTPSVERIFY': '0',
18:57:17 INFO - 'REQUIRE_GPU': '0',
18:57:17 INFO - 'RUST_SRC_PATH': '/opt/homebrew/Cellar/rust/src/src',
18:57:17 INFO - 'SDKROOT': '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk',
18:57:17 INFO - 'SHELL': '/bin/zsh',
18:57:17 INFO - 'SHLVL': '1',
18:57:17 INFO - 'SSH_AUTH_SOCK': '/private/tmp/com.apple.launchd.cNodZFaffg/Listeners',
18:57:17 INFO - 'TERM': 'xterm-256color',
18:57:17 INFO - 'TERM_PROGRAM': 'iTerm.app',
18:57:17 INFO - 'TERM_PROGRAM_VERSION': '3.4.19',
18:57:17 INFO - 'TERM_SESSION_ID': 'w0t1p2:B486AA57-3608-4C5C-BAA5-E9A80917BB8C',
18:57:17 INFO - 'TMPDIR': '/var/folders/y7/0gx4dtxs223gpzqt_6rqjrmm0000gp/T/',
18:57:17 INFO - 'USER': 'greg',
18:57:17 INFO - 'VIRTUAL_ENV': '/Users/greg/.mozbuild/srcdirs/frontend-e8bfd858611c/_virtualenvs/common',
18:57:17 INFO - 'XPC_FLAGS': '0x0',
18:57:17 INFO - 'XPC_SERVICE_NAME': '0',
18:57:17 INFO - '_': '/Users/greg/dev/frontend/./mach',
18:57:17 INFO - '__CFBundleIdentifier': 'com.googlecode.iterm2',
18:57:17 INFO - '__CF_USER_TEXT_ENCODING': '0x1F6:0x0:0x0'}
18:57:17 INFO - dyld[35372]: Library not loaded: @executable_path/../Python3
18:57:17 INFO - Referenced from: <D25FC34F-14C6-33D3-99D7-FA92FB86094B> /Users/greg/dev/frontend/obj-ff-artifact/testing/raptor-venv/bin/python
18:57:17 INFO - Reason: tried: '/Users/greg/dev/frontend/obj-ff-artifact/testing/raptor-venv/Python3' (no such file), '/usr/local/lib/Python3' (no such file), '/usr/lib/Python3' (no such file, not in dyld cache)
18:57:17 INFO - Return code: -6
18:57:17 INFO - retry: Failed, sleeping 60 seconds before retrying
Comment 1•1 year ago
|
||
:gregtatum have you tried re clobbering/bootstrapping after downgrading python? (and removing the obj-* dir)
python env issues pop up time to time on mac and linux with raptor.
A bit more information here was added recently.
Looks like you did hit the /usr/local/lib/Python3' (no such file), '/usr/lib/Python3' (no such file)
message
If the clobber/bootstrapping etc doesn't work, I might suggest trying to use pyenv as suggested in the doc, to manage your local python environment versions. (that seems to fix the problem for most people)
Reporter | ||
Comment 2•1 year ago
|
||
pyenv
seems to fix the issue, thanks. I generally prefer not to have pyenv
as it's another layer of misdirection for my setup, but I can use it for the workaround. I had clobbered and even removed the ~/.mozbuild directory. It really didn't seem to matter for how I setup the configuration of which python I was using, it wasn't working previously. I even tried to go manually and invoke the venv
command inside of the object directory.
Comment 3•1 year ago
|
||
I agree having to use pyenv is not ideal.
I will file bug for us to look into this one day so it can be avoided all together
(however py 3.11 compat is a separate issue entirely, as we first need to find the necessary whls and upload them to https://pypi.pub.build.mozilla.org/pub/)
Reporter | ||
Comment 4•1 year ago
|
||
Maybe even just adding "pyenv" as a recommendation to the 3.10 notice would be a good enough workaround for future folks, especially as if you are on the latest python you will hit it.
Comment 5•1 year ago
|
||
pyenv for the notice is a good idea!
Comment 6•1 year ago
|
||
I will close this for now, tracking the environment work in Bug 1847773
And in the meantime looks like I had already filed a bug on general improvements to incompat messaging Bug 1822903
In there I'll look into filing a new sub task of suggesting pyenv as part of the error message
Description
•