Open allanlei opened 8 years ago
I'm seeing the same thing.
@ncopa is this an upstream bug?
In general using the edge/testing
repo should require using edge/main
. edge/testing
is similar to Debian's "experimental" repo, which implies that you're running "unstable"... same idea basically.
With that said, it might be a problem in the dependency resolver. It is most certainly an apk-tools bug at any rate, as using --virtual
shouldn't cause such a radical change in dependency resolution.
Still the same with Alpine 3.6
apk add --no-cache --virtual foo gosu@testing=1.9-r0
ERROR: unsatisfiable constraints:
gosu-1.9-r0:
masked in: @testing
foo-0:
masked in: cache
satisfies: world[foo]
No problem w/o --virtual foo
I will look into it in apk-tools as time permits.
any update on this?
The problem is that gosu@testing=1.9-r0
is an invalid dependency (because dependencies aren't allowed to be masked, only "world dependencies").
In other words, the problem is that apk does not properly explain that a child dependency cannot be tagged.
Improving apk diagnostics is something I am actively working on at this moment.
I added a diagnostic for this, but pinned child dependencies are explicitly not allowed by the solver for a multitude of reasons.
When you use --virtual
what you're doing is creating a package on the fly and then attaching the dependencies to it. If a pinned repo becomes unavailable, or the pinning itself changes later, then the dependency tree will have orphaned nodes and become unsolvable.
This will be in the apk-tools 2.10 release.
Final thoughts:
There was an apk-tools bug -- it was attempting to modify the dependency graph with something that was impossible, but the dependency resolution behaviour was working as expected upon closer examination.
If you're using masking in a docker container, don't use --virtual
. If you need --virtual
with a masked package, you're probably thinking about the problem wrongly: consider using version constraints instead.
If you are using packages from the testing repo, your base image really needs to be on Alpine edge anyway, so there's not much point in masking. If you mix packages from different Alpine releases, welp, you get to keep both pieces if it breaks.
I've been using --virtual
for my build deps, but version pinning an edge package. Then, trying to apk del
the virtual was throwing this unsatisfiable constraints error.
@kaniini Your advice to use alpine:edge
as my base image solved my issue, thanks!
When using virtual packages in-conjunction with version pinning results in the package not found. I am trying to install
gdal-dev
which is not inv3.4
but is inedge/testing
. If I remove the virtual package, it installs.Is this possible or bug?
/etc/apk/repositories:
Commands:
Without virtual packages