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
Recursive registry vendoring doesn't work #456
Comments
Hi @ondt thanks for the report! I unfortunately do not have access to multiple registries that I can test with so I may need to rely on you to help me debug this The vendoring process has two steps:
As long as the As for 2. i wonder if mixing source replacements with registries (and source vendoring) is running into a precedence issue or something else. My first advice is to try running |
Hello @ipetkov, sorry for the delayed response.
You can test it with just one registry. All that is needed is the following setup:
In this setup the build of Now we've got two distinct URLs for the same registry, let's call them
After changing the URL the situation is as follows:
Now, even if we configure both
I believe this issue is caused in step 1 as you described it. As for step 2 and source replacements, I suggest not to focus on it right now, it's possible that it would fix itself if we manage to fix step 1. If not, then we should open a separate issue for it. My initial description of the issue was very condensed and kind of all over the place, sorry about that! By the way, the example with port This issue also applies to scenarios with two actually separate registries, but that is not our case. (However, in this case it can't be mitigated by just by publishing all the crates again with fixed URLs, projects like these can't be built at all using Crane.) |
@ondt thanks for the detailed write up! Is it possible to condense those instructions into a flake that I could check out and repro directly? Alexandrie is an open registry I've used for testing before, but it can be any registry that works! |
My crate
foo
has a dependency on cratebar
from custom registryregistry1
, andbar
is itself dependent on cratebaz
fromregistry2
.registry1
andregistry2
are in fact two different URLs for the same registry, one of them issparse+http://
and the other one isgit://
(but this doesn't matter in the general case).Even if I configure Crane with both registries, it only vendors crates from
registry1
. Then it tries to accessregistry2
duringcargo check
in another derivation, which of course fails due to network access issues.How hard do you think it would be to implement proper recursive vendoring?
Is it possible to temporarily work around this issue without modifying the crates in the custom registry?
I tried to put the following config into
.cargo/config.toml
:It fixed the issue of trying to access
registry2
(git://example.com/index
) from sandbox, but it was causing errors like this:and looking at the output of
cargo check
we see that it was indeed working with two identical copies ofbaz
(from both sources, most likely because:foo -> bar(registry1) -> baz(registry2)
,foo -> baz(registry1)
,foo
also depends onbaz
):Note that it works fine when running
cargo check
with the modified.cargo/config.toml
outside of Crane:The text was updated successfully, but these errors were encountered: