codrsquad / codrsquad/portable-python

Building for different architecure on Apple Silicon

未关闭
#48 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
86
派生
13
PR 合并指标
30 天内没有已合并 PR

描述

Hello,

I am trying to build i386 (x86) version of python 3.7 on a apple sillicon Mac. Because I want to embed a python tool (USDZ Tools) in my app's sandbox.

I tried to run this command in x86 and moved python 3.7 env to temp folder, then tried to build python3.7. Which spits out this error:
Traceback (most recent call last): File "./setup.py", line 2407, in <module> main() File "./setup.py", line 2402, in main "Tools/scripts/2to3", "Tools/scripts/pyvenv"] File "/Users/TD/Downloads/python3.7/build/components/cpython/Lib/distutils/core.py", line 148, in setup dist.run_commands() File "/Users/TD/Downloads/python3.7/build/components/cpython/Lib/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/Users/TD/Downloads/python3.7/build/components/cpython/Lib/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/Users/TD/Downloads/python3.7/build/components/cpython/Lib/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/Users/TD/Downloads/python3.7/build/components/cpython/Lib/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/Users/TD/Downloads/python3.7/build/components/cpython/Lib/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/Users/TD/Downloads/python3.7/build/components/cpython/Lib/distutils/command/build_ext.py", line 340, in run self.build_extensions() File "./setup.py", line 272, in build_extensions missing = self.detect_modules() File "./setup.py", line 868, in detect_modules (tuple(int(n) for n in dep_target.split('.')[0:2]) AttributeError: 'int' object has no attribute 'split' make[3]: *** [sharedmods] Error 1 make[2]: *** [build_all_generate_profile] Error 2 make[1]: *** [profile-gen-stamp] Error 2 make: *** [profile-run-stamp] Error 2 ERROR make exited with code 2

This is probably an error caused by the build script, might need to cast dep_target into a String.

Any potential fix? If not I might have to tear down the entire USDZ Tools and re-write it in modern python or Swift. (I really don't want to do this, it uses a lot of dynamic linked libraries and .so objects.)

Some key requirements:
USDZ Tools only supports python 3.7.x on the x86 architecture (Thx Pixar). And I can not find alternative commandline tools that works well.
Have to run in an app sandbox, because I want to keep this app tidy and get it on App Store.
My app have to write in Swift, because it calls an first party API only supports Swift calling.

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 setup.py 中的 detect_modules 开始,使用报告的 Python 3.7 i386 构建 traceback 来检查 dep_target 的处理方式。在 Apple Silicon 上重现构建,并验证生成的 x86 Python 3.7 构建能够完成,以便与 USDZ Tools 的要求一起使用。

由索引模型根据 Issue 内容生成。

评估

技术栈
macos, python
领域
build-system, operating-systems
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。