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

env value for VCS_URL #474

Open
wants to merge 2 commits into
base: rolling
Choose a base branch
from
Open

env value for VCS_URL #474

wants to merge 2 commits into from

Conversation

felixf4xu
Copy link

to resolve #473

@felixf4xu felixf4xu requested a review from mjeronimo as a code owner July 8, 2023 01:32
Signed-off-by: CW01\uig08771 <[email protected]>
Signed-off-by: CW01\uig08771 <[email protected]>
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

This feature would indeed let you specify the VCS_URL for different packages (by using different environment variable names), but it seems clunky. For building the ROS 2 core with this, for instance, you'd need to specify something like 24 different environment variables.

@felixf4xu What if we did a prefix instead? That is, assume you are vendoring something from https://github.com/org/foo. Then you could specify VCS_URL_PREFIX=https://mydomain.com/myorg, and the resulting URL that would be attempted would be https://mydomain.com/myorg/foo. Would that work for your use case?

@felixf4xu
Copy link
Author

Mirror sites are usually internal and can't be hardcoded then committed into github, that's why I want to use ENV value. I know it's not perfect but the ENV values can be easily set by one script cmd/file which is easy enough to be maintained.

==

the ideal way to do is to use a separated file (like json) which provide mirror url for each url used. It's kind of dictionary or map, for each hardcoded url string, there is 0, or 1, or more mirror url strings. It's kind of a global config file and it can be maintained all in one place.

@clalancette
Copy link
Contributor

Mirror sites are usually internal and can't be hardcoded then committed into github

Right, understood. In my proposal, the domain name would be replaced by the PREFIX. But maybe that is too limiting.

I like your idea of use a separate file to control this, though I have to say I like @sloretz 's idea of using a gitconfig instead. Can you explain in detail why that solution wouldn't work for you?

@felixf4xu
Copy link
Author

I'm not sure if git config can work for this one

ament_vendor(sqlite3_vendor
  SATISFIED ${SQLite3_FOUND}
  VCS_TYPE zip
  VCS_URL https://www.sqlite.org/2022/sqlite-amalgamation-3370200.zip
  VCS_VERSION sqlite-amalgamation-3370200
  CMAKE_ARGS ${CMAKE_ARGS}
  PATCHES patches
)

Luckily it is the only ament_vendor that does not use git :-)

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.

ament_vendor should be able to use mirror site of git
2 participants