Skip to content

Ensure installation of cross-build packages before the build script runs#366

Open
agriyakhetarpal wants to merge 4 commits into
mainfrom
lazy-install-order-correction
Open

Ensure installation of cross-build packages before the build script runs#366
agriyakhetarpal wants to merge 4 commits into
mainfrom
lazy-install-order-correction

Conversation

@agriyakhetarpal

Copy link
Copy Markdown
Member

Closes #365

In our builder code, I've added a new method called _ensure_cross_build_packages_for_host_requirements to the base RecipeBuilder, and I am calling it before self._build_package(bash_runner) runs.

The idea is that we need to check whether the package's declared host requirements, say, numpy for RobotRaconteur) intersect with get_unisolated_packages(), and if so (and we are in an xbuildenv), we call our lazy-install machinery established via #302 a little earlier, to ensure that they get installed and the cross-build files are available when the build script runs.

I don't think I've found a better way to do this, as our build pipeline is pretty tricky to understand and test in isolation anyway.

There is an explanation in #365 for where this bug comes up in practice.

@agriyakhetarpal agriyakhetarpal added the integration This PR will run the integration tests. This label can be used as a persistent marker to do so. label Jun 7, 2026

@ryanking13 ryanking13 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I am okay with this as a workaround, but we should probably upstream the problematic packages and let them use unisolated build instead.

host_requirements = {req.lower() for req in self.recipe.requirements.host}

if unisolated_packages & host_requirements:
get_current_xbuildenv_manager().ensure_cross_build_packages_installed()

@ryanking13 ryanking13 Jun 8, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, wait. Actually, when building recipes, we don't rely on ensure_cross_build_packages_installed at all.

After building cross-build recipe such as numpy, it should install into the host_site_package as a post build step, so it should be already installed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration This PR will run the integration tests. This label can be used as a persistent marker to do so.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lazily installing cross-build packages is currently not reliable

2 participants