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

SignTools-CI insert_dylib is not built with Apple Silicon support #411

Open
2 tasks done
TJWeiten opened this issue Mar 24, 2024 · 1 comment
Open
2 tasks done

SignTools-CI insert_dylib is not built with Apple Silicon support #411

TJWeiten opened this issue Mar 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@TJWeiten
Copy link

!! Please fill in this template, DO NOT ignore or delete it. !!

I tried basic troubleshooting first

Describe the bug

Pretty simple bug that would only impact folks like me who are self-hosting their builder with SignTools-Builder, but the included insert_dylib executable in the SignTools-CI repo is built for Intel processors and fails if run (as-is) on Apple Silicon.

Logs

Found tweaks, injecting...
Processing ca.jeffrey.apollo-improvedcustomapi_1.0.11_iphoneos-arm.deb
Injecting /var/folders/j2/4fygn1pd2f16byg_tydy43jm0000gn/T/tmp9ig0e6_l/Frameworks/ApolloImprovedCustomApi.dylib @executable_path/Frameworks/ApolloImprovedCustomApi.dylib
Traceback (most recent call last):
  File "/opt/signtools-builder/ios-signer2337820949/sign.py", line 1271, in <module>
    run()
  File "/opt/signtools-builder/ios-signer2337820949/sign.py", line 1212, in run
    inject_tweaks(temp_dir, tweaks_dir)
  File "/opt/signtools-builder/ios-signer2337820949/sign.py", line 630, in inject_tweaks
    insert_dylib(app_bin, binary_fixed)
  File "/opt/signtools-builder/ios-signer2337820949/sign.py", line 277, in insert_dylib
    return run_process("./insert_dylib", "--inplace", "--no-strip-codesig", str(path), str(binary))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/signtools-builder/ios-signer2337820949/sign.py", line 45, in run_process
    result = subprocess.run(cmd, capture_output=capture, check=check, env=env, cwd=cwd, timeout=timeout)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 1953, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 86] Bad CPU type in executable: './insert_dylib'
Cleaning up...

Resolution

Up to you how you want to handle this, but I went and rebuilt insert_dylib from source into a universal binary that should support Apple Silicon and Intel Macs. After replacing the default binary with my rebuilt one, I had no problem signing with my injected deb on my self-hosted builder on an M2 Mac.

However, I did not test that it would still work with GitHub Actions or Semaphore, which is obviously the much more common setup.

System configuration

  • SignTools version: 3.0.1
  • Builder type: SignTools-Builder
  • Builder version: 1.1.12; 13250eb
@TJWeiten TJWeiten added the bug Something isn't working label Mar 24, 2024
@ViRb3
Copy link
Member

ViRb3 commented Mar 24, 2024

I've switched Github Actions to use a M1 runner, so it definitely works. Just needs Rosetta installed for emulation, which you appear to be missing. Good suggestion though, can add a universal binary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants