Skip to content

Conversation

@revati-naik-apex
Copy link
Contributor

The files passed during the configure stage using the repos_index_overlays are not accounted for when generating the setup file.

@revati-naik-apex revati-naik-apex linked an issue Feb 14, 2025 that may be closed by this pull request
@revati-naik-apex revati-naik-apex self-assigned this Feb 14, 2025
@revati-naik-apex
Copy link
Contributor Author

@kilian-funk-apexai The failing jobs will be fixed when my earlier MR gets merged. I can then rebase this one to allow the jobs to pass.

@revati-naik-apex revati-naik-apex force-pushed the 32-fix-overlays-functionality branch 2 times, most recently from 491d5dd to 6f2706f Compare February 25, 2025 00:21
@revati-naik-apex
Copy link
Contributor Author

@kilian-funk-apexai The MR is ready. Also, do you think we should update the documentation to add usage in an external workspace with customer *.repos and overlay_files?

kilian-funk

This comment was marked as resolved.

@revati-naik-apex revati-naik-apex force-pushed the 32-fix-overlays-functionality branch from 5740e5a to b57a74a Compare February 25, 2025 02:10
@kilian-funk
Copy link

@kilian-funk-apexai The MR is ready. Also, do you think we should update the documentation to add usage in an external workspace with customer *.repos and overlay_files?

Yes, please. That would be great.

@revati-naik-apex revati-naik-apex force-pushed the 32-fix-overlays-functionality branch 2 times, most recently from 4070d67 to 69eafeb Compare February 25, 2025 21:35
README.md Outdated
)
```

Note: The `repos_index_overlays` field is optional and can be used to pass additonal `*.repos` files containing more ROS2 repositories

Choose a reason for hiding this comment

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

The reason for the overlays is not to add additional repos but rather a way to declare the BUILD files. That is a syntax extension compared to the original .repos format of the VCS tool used by ROS.
So I would write:

Suggested change
Note: The `repos_index_overlays` field is optional and can be used to pass additonal `*.repos` files containing more ROS2 repositories
Note: The `repos_index_overlays` field is optional and can be used to pass additonal `*.repos` files declaring BUILD.bazel files to be injected into the ROS2 repositories.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kilian-funk I confused it to be another list of *.repos file. When I looked at the code, I saw that an additional bazel.repos is passed. Also, here it says it needs to be a list of *.repos file. So again, the overlays can only be repositories with BUILD file details? I am still trying to figure out the exact use case here.

Please correct me if I am wrong. This repo uses, by default, the @ros2//:ros2.repos file. We overlay it with the bazel.repos file to pass the BUILD file paths (more like associate) to the corresponding package.

Choose a reason for hiding this comment

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

@revati-naik-apex

The format for the .repos files is not our invention. It comes from the open-source VCS tool and does not allow the definition of BUILD files. So the purpose of the overlay files is to amend a .repos file with something that allows the definition of BUILD files. Even if the technical implementation is all the same, the intention is to allow users to reuse a .repos file taken from open source and augment it with additional stuff we need that is not compatible with VCS. The documentation should tell you about the intent, because that is what you cannot read from the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kilian-funk In that case, is this commit 483ffcf needed? Because what this does is adds the entries from overlays under repositories to the existing repos dict.

Choose a reason for hiding this comment

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

Doesn't that code add the BUILD files to the repositories struct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kilian-funk No, It added new entries of repositories in the overlay files to the main .repos files. This was my previous confusion that this field is used to pass additional repos. Without this code, the overlay file contents (BUILD files) are added to the existing repo data in the main .repos file.

@revati-naik-apex revati-naik-apex force-pushed the 32-fix-overlays-functionality branch from 69eafeb to 27dc8f9 Compare February 26, 2025 22:37
@revati-naik-apex revati-naik-apex force-pushed the 32-fix-overlays-functionality branch from 27dc8f9 to ad5110e Compare March 3, 2025 23:02

def build_http_archive_load_command(repo, spec):
return f"""\
patches = ',\n '.join(f'"{i}"' for i in spec.get('patches', []))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you change the formatting of the content?
I believe the first list item is not in the right place. It should start in a new line.

try:
overlay_content = yaml.safe_load(overlay_file)
except yaml.YAMLError as exc:
print(f"Error parsing YAML file {overlay}: {exc}")
Copy link
Contributor

Choose a reason for hiding this comment

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

A parsing error is a severe error. Don't you think the script should error out in that case?

@kilian-funk-apexai kilian-funk-apexai merged commit c095623 into main Mar 3, 2025
2 checks passed
@kilian-funk-apexai kilian-funk-apexai deleted the 32-fix-overlays-functionality branch March 3, 2025 23:43
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.

Fix overlays functionality

4 participants