<div dir="ltr"><div>No, its a pyqtdeploy-sysroot issue.</div><div><br></div>- It looks like the `apple_sdk` is hardcoded in the pyqtdeploy platform and there is no way to extend it. See hack below<div>- The python component won't build because getentropy, sendfile, and chroot are not available (I don't use the latter two so luckily could just make them a noop)<br><div>- The zlib plugin doesn't have a way to compile with both architectures, so you have to hack that too.</div><div>- You can't have two sysroots in the same --sysroots-dir (I imagine because of the unextendable platforms isse) so you have to make a separate one for the simulator</div><div><br></div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;line-height:18px;white-space:pre"><div><span style="color:rgb(86,156,214)">with</span> contextlib.ExitStack() <span style="color:rgb(86,156,214)">as</span> stack:</div><div> stack.enter_context(</div><div> patch.dict(</div><div> os.environ,</div><div> {<span style="color:rgb(206,145,120)">"PATH"</span>: <span style="color:rgb(206,145,120)">"/Users/patrick/dev/lib/Qt/5.15.2/ios/bin:"</span> + os.getenv(<span style="color:rgb(206,145,120)">"PATH"</span>)},</div><div> )</div><div> )</div><div> <span style="color:rgb(86,156,214)">if</span> os.getenv(<span style="color:rgb(206,145,120)">"PK_IPHONE_SIMULATOR"</span>):</div><div> stack.enter_context(</div><div> patch(<span style="color:rgb(206,145,120)">"pyqtdeploy.platforms.iOS.sdk_name"</span>, <span style="color:rgb(206,145,120)">"iphonesimulator"</span>)</div><div> )</div><div> stack.enter_context(</div><div> patch(<span style="color:rgb(206,145,120)">"pyqtdeploy.platforms.iOS.sdk_prefix"</span>, <span style="color:rgb(206,145,120)">"iPhoneOSSimulator"</span>)</div><div> )</div><br><div> pyqtdeploysysroot_main.main()</div></div></div><div><br></div><div><br></div><div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(86,156,214)"><br class="gmail-Apple-interchange-newline">class</span> PythonComponent(Python.PythonComponent):</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"><br></div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(86,156,214)">def</span> run(self, *args, capture=<span style="color:rgb(86,156,214)">False</span>):</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(206,145,120)">"""Add multiprocessing to make."""</span></div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> qt = <span style="color:rgb(86,156,214)">self</span>.get_component(<span style="color:rgb(206,145,120)">"Qt"</span>)</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"><br></div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> _args = tuple(args)</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(86,156,214)">if</span> args[<span style="color:rgb(181,206,168)">0</span>] == <span style="color:rgb(86,156,214)">self</span>.host_make:</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(86,156,214)">self</span>.verbose(<span style="color:rgb(206,145,120)">"Adding args for concurrent build."</span>)</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(86,156,214)">if</span> <a href="http://os.name">os.name</a> == <span style="color:rgb(206,145,120)">"nt"</span>:</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> os.environ[<span style="color:rgb(206,145,120)">"CL"</span>] = <span style="color:rgb(206,145,120)">"/MP"</span></div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(86,156,214)">else</span>:</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> _args += (<span style="color:rgb(206,145,120)">"-j16"</span>,)</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(86,156,214)">elif</span> args[<span style="color:rgb(181,206,168)">0</span>] == qt.host_qmake <span style="color:rgb(86,156,214)">and</span> <span style="color:rgb(86,156,214)">self</span>.target_arch_name == <span style="color:rgb(206,145,120)">"macos-64"</span>:</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> _args += (<span style="color:rgb(206,145,120)">"QMAKE_CFLAGS=-Wno-implicit-function-declaration"</span>,)</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(86,156,214)">with</span> contextlib.ExitStack() <span style="color:rgb(86,156,214)">as</span> stack:</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(86,156,214)">if</span> args[<span style="color:rgb(181,206,168)">0</span>] == <span style="color:rgb(86,156,214)">self</span>.host_make <span style="color:rgb(86,156,214)">and</span> <span style="color:rgb(86,156,214)">self</span>.target_arch_name == <span style="color:rgb(206,145,120)">"ios-64"</span>:</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> stack.enter_context(</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> patch.dict(</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> os.environ,</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> {<span style="color:rgb(206,145,120)">"LDFLAGS"</span>: os.environ[<span style="color:rgb(206,145,120)">"LDFLAGS"</span>] + <span style="color:rgb(206,145,120)">" -framework Security"</span>},</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> )</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> )</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> ret = super().run(*_args, capture=capture)</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(86,156,214)">return</span> ret</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"><br></div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(86,156,214)">def</span> unpack_archive(self, archive, chdir=<span style="color:rgb(86,156,214)">True</span>):</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> archive_root = super().unpack_archive(archive, chdir)</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(86,156,214)">self</span>.patch_file(<span style="color:rgb(206,145,120)">"Python/bootstrap_hash.c"</span>, <span style="color:rgb(86,156,214)">self</span>._patch_boostrap_hash)</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(86,156,214)">if</span> <span style="color:rgb(86,156,214)">self</span>.target_platform_name == <span style="color:rgb(206,145,120)">"ios"</span>:</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(86,156,214)">self</span>.patch_file(<span style="color:rgb(206,145,120)">"Modules/posixmodule.c"</span>, <span style="color:rgb(86,156,214)">self</span>._patch_posixmodule_ios)</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(86,156,214)">return</span> archive_root<br></div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"><br></div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> @staticmethod</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(86,156,214)">def</span> _patch_boostrap_hash(line, patch_file):</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> patch_file.write(</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> line.replace(</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(206,145,120)">'#include "Python.h"'</span>,</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(206,145,120)">"""</span></div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(206,145,120)">#include "Python.h"</span></div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(206,145,120)">#include <Security/Security.h></span></div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(206,145,120)">"""</span>,</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> ).replace(</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(206,145,120)">"getentropy(buffer, len)"</span>,</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(206,145,120)">"SecRandomCopyBytes(kSecRandomDefault, size, buffer) == errSecSuccess ? 0 : -1"</span>,</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> )</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> )</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> @staticmethod</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(86,156,214)">def</span> _patch_posixmodule_ios(line, patch_file):</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> patch_file.write(</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> line.replace(</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(206,145,120)">"#ifdef HAVE_CHROOT"</span>,</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(206,145,120)">"#if HAVE_CHROOT\n\n int chroot(const char *path) {return 1;}\n\n"</span>,</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> ).replace(</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(206,145,120)">"#ifdef HAVE_SENDFILE"</span>,</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> <span style="color:rgb(206,145,120)">"#ifdef HAVE_SENDFILE\n\n int sendfile(int, int, off_t, off_t *, struct sf_hdtr *, int) {return -1;}"</span>,</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> )</div><div style="color:rgb(212,212,212);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(30,30,30)"> )</div><br></div><div><br></div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;line-height:18px;white-space:pre"><br><br><div><span style="color:rgb(86,156,214)">class</span> zlibComponent(zlib.zlibComponent):</div><br><div> <span style="color:rgb(86,156,214)">def</span> run(self, *args, capture=<span style="color:rgb(86,156,214)">False</span>):</div><br><div> IPHONE_SIMULATOR = (</div><div> <span style="color:rgb(86,156,214)">self</span>.target_platform_name == <span style="color:rgb(206,145,120)">"ios"</span></div><div> <span style="color:rgb(86,156,214)">and</span> <span style="color:rgb(86,156,214)">self</span>._sysroot.target.platform.sdk_name == <span style="color:rgb(206,145,120)">"iphonesimulator"</span></div><div> )</div><div> _args = args</div><div> <span style="color:rgb(86,156,214)">with</span> contextlib.ExitStack() <span style="color:rgb(86,156,214)">as</span> stack:</div><div> <span style="color:rgb(86,156,214)">if</span> (</div><div> args[<span style="color:rgb(181,206,168)">0</span>] <span style="color:rgb(86,156,214)">in</span> (<span style="color:rgb(86,156,214)">self</span>.host_make, <span style="color:rgb(206,145,120)">"./configure"</span>)</div><div> <span style="color:rgb(86,156,214)">and</span> IPHONE_SIMULATOR</div><div> <span style="color:rgb(86,156,214)">and</span> <span style="color:rgb(86,156,214)">self</span>.install_from_source</div><div> ):</div><div> stack.enter_context(</div><div> patch.dict(</div><div> os.environ,</div><div> {</div><div> <span style="color:rgb(206,145,120)">"CFLAGS"</span>: <span style="color:rgb(206,145,120)">"-fembed-bitcode -O3 -arch x86_64 -isysroot "</span></div><div> + <span style="color:rgb(86,156,214)">self</span>.apple_sdk</div><div> },</div><div> )</div><div> )</div><div> <span style="color:rgb(86,156,214)">return</span> super().run(*_args, capture=capture)</div><br></div><br class="gmail-Apple-interchange-newline"></div></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sat, May 3, 2025 at 1:16 PM Phil Thompson <<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On 03/05/2025 18:38, Patrick Stinson wrote:<br>
> What is the correct way to build for iOS simulator in pyqtdeploy-3.3.0?<br>
> <br>
> I am looking through the sysroot / platform src in pyqtdeploy and <br>
> having<br>
> trouble finding the thread through the code to a component parameter,<br>
> subclassing a Platform, building a separate sysroot for iOS or <br>
> something<br>
> else. Not seeing anything in the docs, searched for "simulator"<br>
> <br>
> Cheers,<br>
> -patrick<br>
<br>
Isn't that an Xcode issue?<br>
<br>
Phil<br>
</blockquote></div>