ros / meta-ros

OpenEmbedded Layers for ROS 1 and ROS 2
MIT License
382 stars 251 forks source link

[scarthgap] maximum shebang size exceeded, the maximum size is 128. [shebang-size] on beluga-ros #1220

Open mark-bchoi opened 6 days ago

mark-bchoi commented 6 days ago

Hi,

I have an issue in building beluga-ros package.

error is

ERROR: beluga-ros-2.0.1-1-r0 do_populate_sysroot: QA Issue: : /work/armv8a-oe4t-linux/beluga-ros/2.0.1-1/sysroot-destdir/opt/ros/humble/lib/beluga_ros/occupancy_grid_to_ndt maximum shebang size exceeded, the maximum size is 128. [shebang-size]
ERROR: beluga-ros-2.0.1-1-r0 do_populate_sysroot: do_populate_sysroot for this recipe installed files with QA issues
ERROR: Logfile of failure stored in: /home/bchoi/nvidia-yocto-bsp/bchoi-build/tmp/work/armv8a-oe4t-linux/beluga-ros/2.0.1-1/temp/log.do_populate_sysroot.1117401
ERROR: Task (/home/bchoi/nvidia-yocto-bsp/layers/meta-ros/meta-ros2-humble/generated-recipes/beluga/beluga-ros_2.0.1-1.bb:do_populate_sysroot) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3595 tasks of which 3591 didn't need to be rerun and 1 failed.

My build branches are

Yocto branch : scarthgap
ROS2 branch : humble

I think it was caused by shebang size in below files.

bchoi@ubuntu-22:~/nvidia-yocto-bsp/bchoi-build/tmp/work/armv8a-oe4t-linux/beluga-ros/2.0.1-1/image$ cat opt/ros/humble/lib/beluga_ros/occupancy_grid_to_ndt
#!/home/bchoi/nvidia-yocto-bsp/bchoi-build/tmp/work/armv8a-oe4t-linux/beluga-ros/2.0.1-1/recipe-sysroot-native/usr/bin/python3-native/python3
# EASY-INSTALL-ENTRY-SCRIPT: 'beluga-ros==2.0.1','console_scripts','occupancy_grid_to_ndt'
import re
import sys

# for compatibility with easy_install; see #2198
__requires__ = 'beluga-ros==2.0.1'

try:
    from importlib.metadata import distribution
except ImportError:
    try:
        from importlib_metadata import distribution
    except ImportError:
        from pkg_resources import load_entry_point

def importlib_load_entry_point(spec, group, name):
    dist_name, _, _ = spec.partition('==')
    matches = (
        entry_point
        for entry_point in distribution(dist_name).entry_points
        if entry_point.group == group and entry_point.name == name
    )
    return next(matches).load()

globals().setdefault('load_entry_point', importlib_load_entry_point)

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(load_entry_point('beluga-ros==2.0.1', 'console_scripts', 'occupancy_grid_to_ndt')())
bchoi@ubuntu-22:~/nvidia-yocto-bsp/bchoi-build/tmp/work/armv8a-oe4t-linux/beluga-ros/2.0.1-1/image$

Perhaps, it can be related with https://github.com/ros/meta-ros/pull/1215.

If I apply https://github.com/ros/meta-ros/pull/1215, Can I clear this issue?

BR, Mark

jiaxshi commented 5 days ago

I think you can add install append to delete the HOST prefix, refer to do_install:append() in meta-ros2/classes/ros_ament_python.bbclass

mark-bchoi commented 5 days ago

Hi @jiaxshi

Thanks for reply. Yes, I added it.

By the way, I think it would not be fundamental solution. there are in many cases added host path to build results in building packages.

WARNING: beluga-ros-2.0.1-1-r0 do_package_qa: QA Issue: File /opt/ros/humble/share/ament_index/resource_index/parent_prefix_path/beluga_ros in package beluga-ros contains reference to TMPDIR [buildpaths]

I hope to find how to fix it fundamentally.