NVIDIA-ISAAC-ROS / NVIDIA-ISAAC-ROS/isaac_ros_common
`version_info.yaml` is written into the source tree for `ament_python` packages
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 317
- Forks
- 227
- PR merge metrics
- No merged PRs in 30d
Description
version_info.yaml is written into the source tree for ament_python packages
Summary
For ament_python packages, GenerateVersionInfoCommand writes version_info.yaml into the source directory (<source>/build/version_info.yaml) instead of the colcon build space. Every colcon build therefore creates/updates files inside the checked-out repo, leaving the working tree (and, when consumed as a git submodule, the parent repo) permanently dirty.
Affected packages
The ament_python packages whose setup.py uses GenerateVersionInfoCommand, e.g.:
isaac_ros_test→isaac_ros_test/build/version_info.yamlisaac_ros_launch_utils→isaac_ros_launch_utils/build/version_info.yamlisaac_common_py
CMake packages are not affected — their generate_version_info() macro writes to CMAKE_BINARY_DIR, which is correctly out-of-source.
Root cause
isaac_ros_common/scripts/isaac_ros_common-version-info.py, in generate_version_info():
build_dir = os.path.join(os.getcwd(), 'build')
os.makedirs(build_dir, exist_ok=True)
output_path = os.path.join(build_dir, 'version_info.yaml')
When colcon builds an ament_python package it invokes setup.py with cwd = the package source directory, so os.getcwd()/build resolves inside the source tree. The output path ignores the build base that setuptools already provides.
Expected behavior
version_info.yaml should be generated in the build directory (as the CMake path already does) and not modify the source tree.
Suggested fix
GenerateVersionInfoCommand subclasses setuptools' build_py, which already exposes the correct out-of-source build directory as self.build_lib. Thread it through:
# GenerateVersionInfoCommand.run()
output_path, install_destination = generate_version_info(
project_name, project_path, build_dir=self.build_lib)
# generate_version_info(...)
def generate_version_info(project_name, source_dir, build_dir=None):
...
if build_dir is None: # keep old behavior as fallback
build_dir = os.path.join(os.getcwd(), 'build')
os.makedirs(build_dir, exist_ok=True)
output_path = os.path.join(build_dir, 'version_info.yaml')
The file still gets installed to share/<package> via data_files, but is no longer written into the source tree.
Steps to reproduce
- Clone
isaac_ros_commoninto a colcon workspace. colcon build --packages-select isaac_ros_test isaac_ros_launch_utilsgit statusin the source tree → untrackedisaac_ros_test/build/version_info.yamlandisaac_ros_launch_utils/build/version_info.yaml.
Environment
- Isaac ROS version: 4.2.0 (commit
0eb5434c695cc649a501428876380c3e371dbc00, release-4.2) - Build tool: colcon (
ament_pythonbuild type)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in isaac_ros_common/scripts/isaac_ros_common-version-info.py, inspecting GenerateVersionInfoCommand and generate_version_info(), then review the affected packages' setup.py files. Reproduce with colcon build --packages-select isaac_ros_test isaac_ros_launch_utils and check git status; done means version_info.yaml is produced in the build directory, installed to share/, and no source-tree files are created.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 86/100