Skip to content

[master]{common} boost: Stop requiring NumPy for Boost.Python - #1720

Open
eigendude wants to merge 1 commit into
ros:masterfrom
eigendude:boost-numpy
Open

[master]{common} boost: Stop requiring NumPy for Boost.Python#1720
eigendude wants to merge 1 commit into
ros:masterfrom
eigendude:boost-numpy

Conversation

@eigendude

@eigendude eigendude commented May 8, 2026

Copy link
Copy Markdown
Contributor

Description

This PR removes the python3-numpy-native dependency from boost. It should instead be added by downstream consumers of boost.

Boost.Python can be built without NumPy. The meta-ros Boost append adds python3-numpy-native unconditionally and packages libboost_numpy with the Boost.Python package, causing unrelated Boost users to depend on NumPy.

Only package Boost.Python here. Recipes that require Boost.NumPy should enable and depend on it explicitly instead of making all Boost users depend on NumPy.

Motivation and context

It was increasing the time of my build without ROS, from 63mins 50s, to 64mins, 32s.

How has this been tested?

Tested on my work OS, based on Scarthgap, with this change backported.

Before

  • Build tasks: 7293
  • Build time: 64mins 32s

After

  • Build tasks: 7279
  • Build time: 63mins 50s

Additional verification: Remove meta-ros entirely

  • Tasks: 7278
  • Build time: 63min 52s

(The final task I traced down to a summary or benign action or something.)

Additional verification: Blocklist python3-numpy-native

To scrutinize the size of my OTA, I did:

SKIP_RECIPE[python3-numpy-native] = "${@'python3-numpy-native is not allowed.' if d.getVar('BUILD_DEVELOPMENT') == '0' else ''}"

Before:

My build failed because boost pulled in python3-numpy-native.

After:

Build succeeded because numpy-native wasn't built.

@jpao79

jpao79 commented May 14, 2026

Copy link
Copy Markdown

What was causing the gFortran requirement?

I couldn't figure out why it was already checking for gFortran installation when I was just building curie core which doesn't have any ROS requirements that I could tell.

@jpao79

jpao79 commented May 15, 2026

Copy link
Copy Markdown

Briefly looking at it, I think what maybe happening from my limited knowledge is that something we do need actually needs boost and the meta-ros layer is modding the boost recipe and was adding numpy.

So seems like this is one way to solve it, but somewhat unnecessarily complicated since we actually don't need meta-ros layer.

The cleanest way to fix the build would be to remove the meta-ros layer (which we aren't currently using at the moment) and if we do need to use it in the future we can add this fix (or add gFortran as a req).

@jpao79 jpao79 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍 if we really want to keep meta-ros for some reason.

@robwoolley robwoolley changed the title boost: Stop requiring NumPy for Boost.Python [master]{common} boost: Stop requiring NumPy for Boost.Python May 21, 2026
@eigendude

Copy link
Copy Markdown
Contributor Author

@robwoolley any appetite for this change?

@robwoolley

Copy link
Copy Markdown
Collaborator

@eigendude Thanks for submitting this. I am open to merging this as I think removing the unnecessary dependency will be very helpful in reducing size of the runtime, build, and SDK size. I hope to test it soon after I get the latest releases merged in.

@eigendude

Copy link
Copy Markdown
Contributor Author

Cool, take your time, I'm just carrying the patch in our local scarthgap branch.

Boost.Python can be built without NumPy. The meta-ros Boost append adds
python3-numpy-native unconditionally and packages libboost_numpy with the
Boost.Python package, causing unrelated Boost users to depend on NumPy.

Only package Boost.Python here. Recipes that require Boost.NumPy should
enable and depend on it explicitly instead of making all Boost users depend
on NumPy.

Signed-off-by: Garrett Brown <garrett.brown@aclima.earth>
@mergify

mergify Bot commented Jul 19, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants