Open felixf4xu opened 1 year ago
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?
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 https://github.com/ament/ament_cmake/pull/474#issuecomment-1628927181)
In Ros2,
ament_vendor
is mainly used like this: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 ofVCS_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 ofassimp_vendor_VCS_URL
in my case and use the mirror git site.Any comment? I can create a PR for it.