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

ament_vendor should be able to use mirror site of git #473

Open
felixf4xu opened this issue Jul 7, 2023 · 2 comments · May be fixed by #474
Open

ament_vendor should be able to use mirror site of git #473

felixf4xu opened this issue Jul 7, 2023 · 2 comments · May be fixed by #474

Comments

@felixf4xu
Copy link

In Ros2, ament_vendor is mainly used like this:

ament_vendor(assimp_vendor
  SATISFIED ${assimp_FOUND}
  VCS_URL https://github.com/assimp/assimp.git
  VCS_VERSION v5.2.2
  CMAKE_ARGS
    -DASSIMP_BUILD_ASSIMP_TOOLS:BOOL=OFF
    -DASSIMP_BUILD_TESTS:BOOL=OFF
    -DASSIMP_BUILD_SAMPLES:BOOL=OFF
    "${ASSIMP_CMAKE_FLAGS}"
    "-DCMAKE_CXX_FLAGS=${ASSIMP_CXX_FLAGS}"
  PATCHES patches
)

and VCS_URL https://github.com/assimp/assimp.git is usually hardcoded.

When a mirror site of github is needed to build ros2, it's very difficult to set the mirror site URL unless the source code is modified.

I'm proposing an updated version of macro ament_vendor so that it can use env variable (if set) as a prioritized value of VCS_URL.

As a result, for all the xxxxx_vendor projects, it's not necessary to touch the source code of VCS_URL but to set an environmental value of assimp_vendor_VCS_URL in my case and use the mirror git site.

Any comment? I can create a PR for it.

@felixf4xu felixf4xu linked a pull request Jul 8, 2023 that will close this issue
@sloretz
Copy link
Contributor

sloretz commented Jul 10, 2023

Upstream CMake had an issue for this: https://gitlab.kitware.com/cmake/cmake/-/issues/22688 . It looks like they closed it in favor of git's url.<base>.insteadOf: https://git-scm.com/docs/git-config#Documentation/git-config.txt-urlltbasegtinsteadOf

Would that work for your use case?

@felixf4xu
Copy link
Author

My original idea is close to the cmake issue. The git config solution is very limited for some very specific cases.

If cmake is not planning to do it, will ament_cmake do it? (Please see also my other comment #474 (comment))

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 a pull request may close this issue.

2 participants