Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Shebangs replaced by non working ones on install #4934

Open
AlexisTM opened this issue Apr 2, 2025 · 1 comment
Open

[BUG] Shebangs replaced by non working ones on install #4934

AlexisTM opened this issue Apr 2, 2025 · 1 comment
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.

Comments

@AlexisTM
Copy link

AlexisTM commented Apr 2, 2025

setuptools version

setuptools==78.1.0

Python version

python 3.10

OS

Ubuntu 22.04 ARM64

Additional environment information

I am building rosmaster

It creates a package then calls setup(...) for the install part.

Source: https://github.com/ros/ros_comm/tree/noetic-devel/tools/rosmaster

Description

The shebangs #!/usr/bin/env python are being replaced by #!python making the scripts non working.

This seems to be related to

if shebang_match:
log.info("copying and adjusting %s -> %s", script, self.build_dir)
if not self.dry_run:
post_interp = shebang_match.group(1) or ''
shebang = f"#!python{post_interp}\n"
self._validate_shebang(shebang, f.encoding)
with open(outfile, "w", encoding=f.encoding) as outf:
outf.write(shebang)
outf.writelines(f.readlines())

Expected behavior

The shebangs are not modified

How to Reproduce

pip install rosinstall_generator

rosinstall_generator --rosdistro noetic --deps --tar \
    rosmaster    > rosmaster.rosinstall && \
    mkdir -p src && \
    vcs import src < rosmaster.rosinstall 

ROS_VERSION=1 ./src/catkin/bin/catkin_make_isolated --install \
      -DCMAKE_BUILD_TYPE=Release \
      -DPYTHON_EXECUTABLE=/usr/bin/python3

Output

$ cat install_isolated/bin/rosmaster
#!python
[...]
@AlexisTM AlexisTM added bug Needs Triage Issues that need to be evaluated for severity and status. labels Apr 2, 2025
@AlexisTM
Copy link
Author

AlexisTM commented Apr 2, 2025

Reverting setuptools with pip install setuptools==75.8.2 fixes it.

The commit is c712663

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.
Projects
None yet
Development

No branches or pull requests

1 participant