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

Add option to skip .repo files in the cloned repository #10

Closed
wants to merge 1 commit into from
Closed

Add option to skip .repo files in the cloned repository #10

wants to merge 1 commit into from

Conversation

yaymalaga
Copy link
Contributor

@yaymalaga yaymalaga commented Sep 19, 2023

I was checking the final install folder and noticed some extra dependencies being built. This was due to some ros2 packages also including their own .repo files. In my case, these packages were already found and installed automatically by rosdep, thus there was no point in manually building them.

In order to keep the previous behavior, I have added a new variable to disable recursively checking the .repo files within the cloned repos. I have decided to keep the current script to still find every .repo files available when calling the build script.

Copy link
Member

@lreiher lreiher left a comment

Choose a reason for hiding this comment

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

Thank you very much, I believe this is can be helpful! Would you mind implementing it the way I suggested?

Also, just out of curiosity, what are you using docker-ros for? :)

Comment on lines +59 to +60
ARG ENABLE_RECURSIVE_CLONED="True"
RUN /usr/local/bin/recursive_vcs_import.py src src/upstream ${ENABLE_RECURSIVE_CLONED}
Copy link
Member

Choose a reason for hiding this comment

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

I suggest to fall back to just calling vcs import directly, if recursion is disabled. Somewhat goes against the naming of recursive_vcs_import.py otherwise.

Suggested change
ARG ENABLE_RECURSIVE_CLONED="True"
RUN /usr/local/bin/recursive_vcs_import.py src src/upstream ${ENABLE_RECURSIVE_CLONED}
ARG ENABLE_RECURSIVE_CLONED="true"
RUN if [[ $ENABLE_RECURSIVE_ADDITIONAL_DEBS == 'true' ]]; then \
/usr/local/bin/recursive_vcs_import.py src src/upstream ; \
else \
# vcs import ... ; \
fi

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it possible to include every *.repo files in the current directory just using the vcs import command? I could see the benefit of a repository having for instance "hardware.repo", "vision.repo", etc. Thus, when I added the flag I was still interested in the recursive search, just not for the cloned packages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ping @lreiher

Copy link
Member

Choose a reason for hiding this comment

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

I have discussed this with my peers and we don't really see the necessity for multiple top-level .repo files that are all found. Either there is one that you would like to include, or you want to search recursively. The only additional argument that we could see being integrated is to have a variable for configuring the script to search for another filename, e.g., vision.repo instead of .repos. Similar to how you can configure CUSTOM_SCRIPT_FILE.

@@ -30,6 +30,7 @@ build_image() {
$(if [[ -n "${ENABLE_RECURSIVE_ADDITIONAL_PIP}" ]]; then echo "--build-arg ENABLE_RECURSIVE_ADDITIONAL_PIP=${ENABLE_RECURSIVE_ADDITIONAL_PIP}"; fi) \
$(if [[ -n "${CUSTOM_SCRIPT_FILE}" ]]; then echo "--build-arg CUSTOM_SCRIPT_FILE=${CUSTOM_SCRIPT_FILE}"; fi) \
$(if [[ -n "${ENABLE_RECURSIVE_CUSTOM_SCRIPT}" ]]; then echo "--build-arg ENABLE_RECURSIVE_CUSTOM_SCRIPT=${ENABLE_RECURSIVE_CUSTOM_SCRIPT}"; fi) \
$(if [[ -n "${ENABLE_RECURSIVE_CLONED}" ]]; then echo "--build-arg ENABLE_RECURSIVE_CLONED=${ENABLE_RECURSIVE_CLONED}"; fi) \
Copy link
Member

Choose a reason for hiding this comment

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

I suggest to name the variable ENABLE_RECURSIVE_VCS_IMPORT.

It also still needs to be added to the README.

@@ -30,6 +30,7 @@ build_image() {
$(if [[ -n "${ENABLE_RECURSIVE_ADDITIONAL_PIP}" ]]; then echo "--build-arg ENABLE_RECURSIVE_ADDITIONAL_PIP=${ENABLE_RECURSIVE_ADDITIONAL_PIP}"; fi) \
$(if [[ -n "${CUSTOM_SCRIPT_FILE}" ]]; then echo "--build-arg CUSTOM_SCRIPT_FILE=${CUSTOM_SCRIPT_FILE}"; fi) \
$(if [[ -n "${ENABLE_RECURSIVE_CUSTOM_SCRIPT}" ]]; then echo "--build-arg ENABLE_RECURSIVE_CUSTOM_SCRIPT=${ENABLE_RECURSIVE_CUSTOM_SCRIPT}"; fi) \
$(if [[ -n "${ENABLE_RECURSIVE_CLONED}" ]]; then echo "--build-arg ENABLE_RECURSIVE_CLONED=${ENABLE_RECURSIVE_CLONED}"; fi) \
Copy link
Member

Choose a reason for hiding this comment

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

The new variable must also be added to action.yml and .gitlab-ci.yml.

@yaymalaga
Copy link
Contributor Author

yaymalaga commented Sep 22, 2023

Also, just out of curiosity, what are you using docker-ros for? :)

I am using it to create ready to deploy images of my workspace. Abstracting everything from the dockerbuild is quite an interesting idea, as it reduces the maintenance and can be easily added as a github action.

@jpbusch
Copy link
Collaborator

jpbusch commented Oct 11, 2023

Due to the many changes, we have decided to cleanly redo the PR (see #13). There, the changes you suggested have been taken into account.

@jpbusch jpbusch closed this Oct 11, 2023
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