Support source archives in rosdistro_additional_recipes.yaml - #132
Open
diegoferigo-rai wants to merge 1 commit into
Open
Support source archives in rosdistro_additional_recipes.yaml#132diegoferigo-rai wants to merge 1 commit into
rosdistro_additional_recipes.yaml#132diegoferigo-rai wants to merge 1 commit into
Conversation
Previously an entry of rosdistro_additional_recipes.yaml was always assumed to be a git repository: its package.xml was read from the raw file endpoint of github.com or gitlab.com, and generate_source() emitted a git/rev source. Any other URL was rejected with "Cannot handle unknown repository hoster". A ROS package distributed as a plain source archive, for instance a vendor driver hosted on an Artifactory server, could therefore not be layered on a distro at all. Accept an entry whose url points at a source archive (.zip, .tar.gz and the other common suffixes) and carries a sha256 checksum instead of a rev or a tag. Its package.xml is read out of the downloaded archive, after dropping a single common top-level directory so that additional_folder means the same thing for this lookup and for the generated build script, and the source block becomes url/sha256. A missing checksum is a hard error, since a URL source without one would silently be fetched unverified. Archives can live behind authentication, so the downloads now go through requests, which is already a dependency. It resolves the ambient credentials, proxy and CA settings on its own, and it drops the Authorization header when a redirect crosses to another host, which is what an Artifactory server does when it hands out a presigned storage URL. Vinca therefore keeps no credential handling of its own beyond the existing GITHUB_TOKEN and GITLAB_TOKEN support. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
diegoferigo-rai
marked this pull request as ready for review
August 6, 2026 16:37
rosdistro_additional_recipes.yaml
Tobias-Fischer
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Today every entry of
rosdistro_additional_recipes.yamlhas to be a git repository. The manifest is fetched from the raw file endpoint ofgithub.comorgitlab.com, and anything else is refused at this line withCannot handle unknown repository hoster. On the generation side,generate_source()always emits agit/revsource.I have a vendor ROS driver that is not published in any rosdistro and does not live in a git repository at all: it is shipped as a plain
.zipon a server that requires authentication. There is no way to layer it on a distro at the moment, even though rattler-build handles aurl/sha256source natively.This PR accepts an entry whose
urlpoints at a source archive and carries asha256instead of arevor atag:The
package.xmlis read directly out of the downloaded archive, and the generated source block becomesurl/sha256. A missingsha256is a hard error, since a URL source without a checksum would silently be fetched unverified.The subtle part is
additional_folder. When rattler-build unpacks aurlarchive it strips a single common top-level directory, and the generated build script resolvesadditional_folderrelative to that stripped root. So the manifest lookup inside the archive strips the same single common root, otherwise one config key would mean two different things on the two sides. This is what_strip_common_root()and_resolve_member()do, and both zip and tar are handled, including tars whose members are prefixed with./.Such an archive usually sits behind authentication, so the two download helpers now go through
requests, which is already a dependency and already used invinca/utils.py. That way netrc, proxy and CA settings are resolved from the environment, and theAuthorizationheader is dropped when a redirect crosses to another host, which is what an artifact server does when it hands out a presigned storage URL. I deliberately did not add any credential handling to vinca itself: the existingGITHUB_TOKENandGITLAB_TOKENsupport from #128 is untouched, and everything else is left torequests..tar.zstis intentionally left out of the accepted suffixes, becausetarfileonly reads zstd from Python 3.14 on whilerequires-pythonis still>=3.9.The git path is unchanged: for a non-archive entry,
get_released_repo()and the generated source block produce exactly what they produced before.Tested
pyteston the repo: 113 passed, including 24 new tests covering the archive helpers, the root stripping for zip and tar, the missing member and the missing checksum cases, and the redirect behaviour that is relied upon.ruff checkandruff format --checkare clean.linux-64andlinux-aarch64. I also checked that the download fails without credentials, so the delegation torequestsis what makes it work.