X-Original-To: alpine-devel@lists.alpinelinux.org Received: from mail-qk0-f193.google.com (mail-qk0-f193.google.com [209.85.220.193]) by lists.alpinelinux.org (Postfix) with ESMTP id 280565C4FAA for ; Wed, 16 May 2018 04:08:46 +0000 (GMT) Received: by mail-qk0-f193.google.com with SMTP id d125-v6so2069980qkb.8 for ; Tue, 15 May 2018 21:08:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dereferenced-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=vap6gNVS7fmuoA9tV6aPq8idL9xquEAkN6nWwsidB0k=; b=cGPkZhu5NSwU1iBG5DOkHwcbJd6JXyyjWguOI2oH/ZF2V5kxbkZPIjS+fMxy6+MVGE KmP6DCvYlGLsEfFDuf6gxvzclTHP1DI53cGalcPBIUrGzKvkTd/ILFcgv8JVgs0FopAK v8BNSkal6HUn5PoTnt2eM+UfNhHLEJLrGX+CPOk1um52pkqH1AP1+K87R7RMIBL6+HQc ftzbUkrnn6kbmq8ypstsdJh0MwNkO7jRkTMAu3F9fsi3T+rXZPMrNLmBu87vL8Jl1+Ae IAG2iUXJFdfLcSnmQk93DCD0aTyAC24bh0fFC94rDZprx9x+ed9wiX8WHhS3bmltoD1Y CLbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=vap6gNVS7fmuoA9tV6aPq8idL9xquEAkN6nWwsidB0k=; b=pQZzueNfYXG3O7dbXHaOSzgKxyfjGOpocyW+ffR7TCpEEh/+LdyVtLyEMSJMSNxwDv z9UxiePpyuT9qJ8V/1b0syiR2GPl/XkNOMofUwxZF04/KvadYpFtyQuR6wiPWnwTHjne 3td7WYiytSnmzuqrZXVDZAFUgIs0Yn/AtFFHh/1XjRF0i/qdnfBH1lUFs4I2sfqxRcXR IzllKt3DwqVCOP3TJTLmAHngWryC/TBFa2L+LWL0LE+sEBz7m32is53S/WfCpNQUpYlF hWIQCWXTwoMWs5XiZUJraPdJ/F2wENuDHvNiv7WIhKp7lDHsCv8pLpyHLMxhqhNbVpwR 16Gg== X-Gm-Message-State: ALKqPwdmhAysvNOvxZgik1zHXs0mUgBBenAD2n9daFqyozGWz7SWc2SB 4Vm8DPylFd/4QYxpiq3biO+mddwTrkA0ThzyR+Ckbw== X-Google-Smtp-Source: AB8JxZpL6BUHLchK3YodKCwgagA5NhLWz6+WoAiPEsR1LLxi27zE9EXkdLRy2dZ0G16+iOHC1v7Zncwl1nx2cvE7sgg= X-Received: by 2002:a37:6343:: with SMTP id x64-v6mr15487180qkb.182.1526443725609; Tue, 15 May 2018 21:08:45 -0700 (PDT) X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Received: by 2002:ac8:1d12:0:0:0:0:0 with HTTP; Tue, 15 May 2018 21:08:45 -0700 (PDT) In-Reply-To: <5ad90a46-8c78-ebdd-e022-a94fe7937805@bitmessage.ch> References: <5ad90a46-8c78-ebdd-e022-a94fe7937805@bitmessage.ch> From: William Pitcock Date: Tue, 15 May 2018 23:08:45 -0500 Message-ID: Subject: Re: [alpine-devel] apk and libraries that optionally replace others To: Oliver Smith Cc: alpine-dev Content-Type: text/plain; charset="UTF-8" Hello, On Tue, May 15, 2018 at 3:57 PM, Oliver Smith wrote: > Hey folks, > > in Alpine based postmarketOS we have hit the following use case quite a > few times by now, and we're wondering how to solve it properly: > Packaging "testlib-b" as a _optional_ replacement for "testlib-a". > > Both "testlib-a" and "testlib-b" provide the same soname, which means > abuild will automatically make both binary packages provide > "so:libtestlib.so.1". By default this means that both packages will provide so:libtestlib.so.1 with provider_priority 0. When provider_priority is 0, it means to skip automatically resolving the provider. Provider selection is based on a combination of priority and overall "cost" of choosing that provider. apk will prefer the highest priority provider with the lowest cost (dependency chain length) that can yield a satiable solution. > Now there is a "testapp" package, which has "testlib-a" in makedepends > and links against "libtestlib.so.1". Therefore abuild puts > "so:libtestlib.so.1" in the depends of "testapp". What we would like to > achieve is, that whenever installing "testapp", it pulls in "testlib-a". > But when "testlib-b" is already installed, it uses "testlib-b" instead > of "testlib-a". testlib-b (libdrm) should have provider_priority 1, testlib-a (libdrm-grate) should have provider_priority greater than 1. The provides field itself should be left alone. The key is to set a priority on both providers, otherwise APK will treat it as a collision and behave as you describe. > I have tried various combinations with "provides" and > "provider_priority", and I couldn't get it working. The only way it > would work was if "testapp" explicitly depended on "testlib-a", but that > won't fulfill our use case: if the library in question is "libdrm", then > we would need to change a lot of Alpine's aports to explicitly depend on > libdrm instead of implicitly to make it work. > > If someone is interested, I can provide apk's output of what I've tried > so far. The aports I have used for testing are here [1]. > > To make this less abstract, one example where we would actually use > this, is "libdrm-grate", which adds out of tree tegra drivers to > "libdrm" [2]. > > Here are my questions: > * Am I missing something, or does this not work with apk? > * Would Alpine be interested in a patch that adds this functionality, > and if so, how would everyone like to have it integrated? > > Thanks for reading, > Oliver > > [1]: https://github.com/ollieparanoid/apk-conflicts-example > [2]: > https://github.com/postmarketOS/pmbootstrap/issues/1380#issuecomment-385183609 William --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---