codrsquad / codrsquad/portable-python

Building for different architecure on Apple Silicon

オープン
#48 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
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. リポジトリをフォークし、ブランチを切って変更します。
  4. 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 を短くまとめたダイジェスト。