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

Conda package with an incorrect subdir makes repo unreadable. #529

Closed
calebzulawski opened this issue Apr 28, 2023 · 7 comments
Closed

Conda package with an incorrect subdir makes repo unreadable. #529

calebzulawski opened this issue Apr 28, 2023 · 7 comments

Comments

@calebzulawski
Copy link

I think this is the line in question:

libsolv/ext/repo_conda.c

Lines 314 to 319 in 5dc4f81

/* if we have a global subdir make sure that it matches */
if (subdir && pd->subdir && strcmp(subdir, pd->subdir) != 0)
{
pd->error = "subdir mismatch";
return JP_ERROR;
}

In my situation, I have a custom subdir linux-64-foo, but one broken package has the subdir listed as linux-64. This package makes the entire repo unreadable. I think instead of a hard error, this should be a warning so the repo can still be used.

Also see mamba-org/mamba#2363

@mlschroe
Copy link
Member

Yes, we certainly should not return an error here. I think conda just ignores the package subdir in this case. Is that correct?

@wolfv
Copy link
Contributor

wolfv commented May 22, 2023

I think the other way around, it would ignore the global subdir and use the package subdir.

@mlschroe
Copy link
Member

Yeah, that would make more sense. However the code in subdir_data.py contains

meta_in_common = {  # just need to make this once, then apply with .update()
            'arch': repodata.get('info', {}).get('arch'),
            'channel': self.channel,
            'platform': repodata.get('info', {}).get('platform'),
            'schannel': schannel,
            'subdir': subdir,
        }

...

info.update(meta_in_common)

I think that this means it overwrites the subdir from the package.

@mlschroe
Copy link
Member

Oh, see issue #502

@calebzulawski
Copy link
Author

Just curious, what happens if they're (accidentally) not equal and the package subdir overrides the global subdir? In my situation, and others I believe, the package is actually in the wrong subdirectory, so it won't be possible to download it from the subdir indicated in the package either.

@jpedrick
Copy link

jpedrick commented Jun 8, 2023

It would be great if one way or another this would either skip the package and print an error, or overwrite the subdir for the package. Returning an error here ruins a lot of people's days until the remote repo can be fixed.

The conda classic solver works, so it would make sense to replicate whatever they do even if it's wrong by some POV.

Personally, I would expect and want a warning and the mismatched packages skipped as that would force the mismatch to be noticed/fixed, but wouldn't disrupt users who are uninterested in the broken package.

mlschroe added a commit that referenced this issue Jul 21, 2023
…e is a conflict

This is what classic conda does, so we also need to do it.
Fixes issue #529
@mlschroe
Copy link
Member

I changed the code so that it overwrites the package subdir with the info subdir.

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

No branches or pull requests

4 participants