You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With #297 and #302, we added a feature to install cross-build packages only when we require them. However, as part of debugging the implementation devised in #21 and testing it in pyodide/pyodide-recipes#591, I think I have exposed a latent bug that has existed for a while, but our infrastructure has kept it from manifesting in CI builds.
The order is bash_runner.run(self.build_metadata.script, ...), which runs the CMake configuration, and then this is followed by self._compile(bash_runner), which is where we lazily load cross-build packages.
In this case, the RobotRaconteur recipe has a script section that needs host_site_packages populated before CMake runs, but host_site_packages/numpy/_core/include is still empty at execution time, so headers such as ndarrayobject.h are not found because they do not exist yet. There is no .cross-build-packages-installed marker either. Slightly before the last few commits I pushed in #21, we were not installing the cross-build packages; instead, we were only installing the cross-build files. ndarrayobject.h and other similar headers are not included in our cross-build files.
Why this has never showed up for us is because by the time the build order reaches RobotRaconteur, some earlier package that lists numpy as a host dependency (could be scipy, pandas, or any other scientific package, etc.), has already necessitated the existence of the _compile() step and warmed up the host_site_packages directory, which is then used by all the packages.
Building RobotRaconteur in isolation (just the recipe and its direct dependencies) does not trigger the lazy installation, so nothing is present in the cross-build packages.
Therefore, a fix could be to change when the lazy trigger runs, so that we detect the need to install, and install, the cross-build packages at the start of a package build rather than at a different event (if the package's recipe lists them in the host: section, of course).
With #297 and #302, we added a feature to install cross-build packages only when we require them. However, as part of debugging the implementation devised in #21 and testing it in pyodide/pyodide-recipes#591, I think I have exposed a latent bug that has existed for a while, but our infrastructure has kept it from manifesting in CI builds.
To reproduce:
pyodide build-recipes RobotRaconteurin the pyodide-recipes repository, fresh, before building anything else.Right now,
ensure_cross_build_packages_installed()onmainis called inside_build_in_isolated_env():pyodide-build/pyodide_build/pypabuild.py
Lines 122 to 123 in 2946127
pyodide-build/pyodide_build/pypabuild.py
Lines 183 to 184 in 2946127
Which is part of
_compile(). Now, looking at_build_packageatpyodide-build/pyodide_build/recipe/builder.py
Lines 564 to 584 in 2946127
The order is
bash_runner.run(self.build_metadata.script, ...), which runs the CMake configuration, and then this is followed byself._compile(bash_runner), which is where we lazily load cross-build packages.In this case, the RobotRaconteur recipe has a script section that needs
host_site_packagespopulated before CMake runs, buthost_site_packages/numpy/_core/includeis still empty at execution time, so headers such asndarrayobject.hare not found because they do not exist yet. There is no.cross-build-packages-installedmarker either. Slightly before the last few commits I pushed in #21, we were not installing the cross-build packages; instead, we were only installing the cross-build files.ndarrayobject.hand other similar headers are not included in our cross-build files.Why this has never showed up for us is because by the time the build order reaches RobotRaconteur, some earlier package that lists
numpyas a host dependency (could bescipy,pandas, or any other scientific package, etc.), has already necessitated the existence of the_compile()step and warmed up thehost_site_packagesdirectory, which is then used by all the packages.Building RobotRaconteur in isolation (just the recipe and its direct dependencies) does not trigger the lazy installation, so nothing is present in the cross-build packages.
Therefore, a fix could be to change when the lazy trigger runs, so that we detect the need to install, and install, the cross-build packages at the start of a package build rather than at a different event (if the package's recipe lists them in the
host:section, of course).