Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting AssertionError: Expected exactly one LC_BUILD_VERSION or LC_VERSION_MIN_MACOSX command! #8220

Closed
rohts-patil opened this issue Jan 11, 2024 · 4 comments
Labels
triage Please triage and relabel this issue

Comments

@rohts-patil
Copy link

Traceback (most recent call last):
File "/Users/rohit.patil/Desktop/Git/cs/llm/venv/bin/pyinstaller", line 8, in
sys.exit(_console_script_run())
File "/Users/rohit.patil/Desktop/Git/cs/llm/venv/lib/python3.9/site-packages/PyInstaller/main.py", line 214, in _console_script_run
run()
File "/Users/rohit.patil/Desktop/Git/cs/llm/venv/lib/python3.9/site-packages/PyInstaller/main.py", line 198, in run
run_build(pyi_config, spec_file, **vars(args))
File "/Users/rohit.patil/Desktop/Git/cs/llm/venv/lib/python3.9/site-packages/PyInstaller/main.py", line 69, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/Users/rohit.patil/Desktop/Git/cs/llm/venv/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 1071, in main
build(specfile, distpath, workpath, clean_build)
File "/Users/rohit.patil/Desktop/Git/cs/llm/venv/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 1011, in build
exec(code, spec_namespace)
File "hooks.spec", line 4, in
a = Analysis(
File "/Users/rohit.patil/Desktop/Git/cs/llm/venv/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 470, in init
self.postinit()
File "/Users/rohit.patil/Desktop/Git/cs/llm/venv/lib/python3.9/site-packages/PyInstaller/building/datastruct.py", line 184, in postinit
self.assemble()
File "/Users/rohit.patil/Desktop/Git/cs/llm/venv/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 854, in assemble
sdk_version = osxutils.get_macos_sdk_version(src_name)
File "/Users/rohit.patil/Desktop/Git/cs/llm/venv/lib/python3.9/site-packages/PyInstaller/utils/osx.py", line 113, in get_macos_sdk_version
version_cmd = _find_version_cmd(header)
File "/Users/rohit.patil/Desktop/Git/cs/llm/venv/lib/python3.9/site-packages/PyInstaller/utils/osx.py", line 98, in _find_version_cmd
assert len(version_cmd) == 1, "Expected exactly one LC_BUILD_VERSION or LC_VERSION_MIN_MACOSX command!"
AssertionError: Expected exactly one LC_BUILD_VERSION or LC_VERSION_MIN_MACOSX command!

Getting the above error while running pyinstaller hooks.spec --clean

@rohts-patil rohts-patil added the triage Please triage and relabel this issue label Jan 11, 2024
@bwoodsend
Copy link
Member

Could you edit your copy of /Users/rohit.patil/Desktop/Git/cs/llm/venv/lib/python3.9/site-packages/PyInstaller/utils/osx.py and insert a print(filename) at this line then rebuild, look at whatever filename gets printed immediately before the exception then upload that file (you might need to hide it in a zip file to stop GitHub from complaining) so that we can see what it is and why it has more than one SDK version?

@rokm
Copy link
Member

rokm commented Jan 11, 2024

Suppose we should add the number of version commands in the assertion error message, so we won't have to guess whether it was 0 or > 1.

And since the error originates from

if is_darwin:
binaries_with_invalid_sdk = []
for dest_name, src_name, typecode in self.binaries:
sdk_version = osxutils.get_macos_sdk_version(src_name)
if sdk_version < (10, 9, 0):
binaries_with_invalid_sdk.append((dest_name, src_name, sdk_version))
if binaries_with_invalid_sdk:
logger.warning("Found one or more binaries with invalid or incompatible macOS SDK version:")
for dest_name, src_name, sdk_version in binaries_with_invalid_sdk:
logger.warning(" * %r, collected as %r; version: %r", src_name, dest_name, sdk_version)
logger.warning("These binaries will likely cause issues with code-signing and hardened runtime!")

we should make it non-fatal, and instead just add the offending binary to the list of binaries to warn about.

@bwoodsend
Copy link
Member

In the absence of any information to the contrary, I'm assuming that #8221 fixes this.

@rohts-patil
Copy link
Author

@bwoodsend When will this get released?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
triage Please triage and relabel this issue
Projects
None yet
Development

No branches or pull requests

3 participants