[pacman-dev] makepkg - separate build nodeps and runtime nodeps
Good day, all TL;DR: Is there a parameter for makepkg that ignores runtime dependencies but does not ignore build-time dependencies? Long version: I prefer using a custom cower/makepkg script (as a user) followed by pacman (as root) over using yaourt. I regularly come across the situation where a package has several runtime dependencies that I'm also about to build and install. The result used to be the following before I realised I could use --nodeps: build a (error, rundeps b >= old and d >= old) build b (error, rundeps d >= old build d (error, rundeps c >= old) build c install c build d install d build c install c build a install a <success> So of course I now bypass all of this by using makepkg --nodeps: build a build b build c build d install a b c d <success> Sometimes however that will result in errors due to build time dependencies being ignored. Instead, I would like to specify "--noruntimedeps" - or some similar flag, so I see potential build time dependencies immediately but also ignore run time dependencies that are going to be installed anyway. One obscure use I see for this is that it could make it simpler to build pkg files that are intended to be installed on a separate system. -- __________ Brendan Hide http://swiftspirit.co.za/ http://www.webafrica.co.za/?AFF1E97
On 10/21/2016 12:31 PM, Brendan Hide wrote:
Good day, all
TL;DR: Is there a parameter for makepkg that ignores runtime dependencies but does not ignore build-time dependencies?
Long version: I prefer using a custom cower/makepkg script (as a user) followed by pacman (as root) over using yaourt. I regularly come across the situation where a package has several runtime dependencies that I'm also about to build and install. The result used to be the following before I realised I could use --nodeps:
build a (error, rundeps b >= old and d >= old) build b (error, rundeps d >= old build d (error, rundeps c >= old) build c install c build d install d build c install c build a install a <success>
So of course I now bypass all of this by using makepkg --nodeps:
build a build b build c build d install a b c d <success>
Sometimes however that will result in errors due to build time dependencies being ignored.
Instead, I would like to specify "--noruntimedeps" - or some similar flag, so I see potential build time dependencies immediately but also ignore run time dependencies that are going to be installed anyway.
One obscure use I see for this is that it could make it simpler to build pkg files that are intended to be installed on a separate system.
... Or maybe you should just implement dependency resolution in your script? You can retrieve the needed information trivially from .SRCINFO.
On 10/21/16 13:25, Alad Wenter wrote:
On 10/21/2016 12:31 PM, Brendan Hide wrote:
Good day, all
TL;DR: Is there a parameter for makepkg that ignores runtime dependencies but does not ignore build-time dependencies?
[snip]
... Or maybe you should just implement dependency resolution in your script? You can retrieve the needed information trivially from .SRCINFO.
Thanks! That is useful! :) -- __________ Brendan Hide http://swiftspirit.co.za/ http://www.webafrica.co.za/?AFF1E97
On 21/10, Brendan Hide wrote:
Instead, I would like to specify "--noruntimedeps" - or some similar flag, so I see potential build time dependencies immediately but also ignore run time dependencies that are going to be installed anyway.
Build-time dependencies are only listed in makedepends if they're not needed at run-time, otherwise they're only listed in the depends array, so this wouldn't really be possible. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/
On 10/21/16 13:48, Johannes Löthberg wrote:
On 21/10, Brendan Hide wrote:
Instead, I would like to specify "--noruntimedeps" - or some similar flag, so I see potential build time dependencies immediately but also ignore run time dependencies that are going to be installed anyway.
Build-time dependencies are only listed in makedepends if they're not needed at run-time, otherwise they're only listed in the depends array, so this wouldn't really be possible.
In that case, how do the Arch repo maintainers get around it? -- __________ Brendan Hide http://swiftspirit.co.za/ http://www.webafrica.co.za/?AFF1E97
On 21 October 2016 at 13:56, Brendan Hide <brendan@swiftspirit.co.za> wrote:
Build-time dependencies are only listed in makedepends if they're not needed at run-time, otherwise they're only listed in the depends array, so this wouldn't really be possible.
In that case, how do the Arch repo maintainers get around it?
We don't get around it. I think you are misunderstanding how the dependencies work: build time dependencies = makedepends + depends runtime dependencies = depends In other words, the depends are implicitly makedepends, too. You need to build packages in correct order. You approach of ignoring dependencies will fail miserably when one of your "runtime dependecies" will have soname bump. Eg. your package b provides libb.so.1. You rebuild a and it will link agains libb.so.1. Then you rebuild package b and the library changes to libb.so.2. Now the package a is broken, because it is linked against library that is no longer existing. TLDR: you original approach was correct, the current one with bypassing dependencies is wrong.
On 10/21/2016 10:16 AM, Lukas Jirkovsky wrote:
build time dependencies = makedepends + depends runtime dependencies = depends
In other words, the depends are implicitly makedepends, too. You need to build packages in correct order. You approach of ignoring dependencies will fail miserably when one of your "runtime dependecies" will have soname bump. Eg. your package b provides libb.so.1. You rebuild a and it will link agains libb.so.1. Then you rebuild package b and the library changes to libb.so.2. Now the package a is broken, because it is linked against library that is no longer existing.
TLDR: you original approach was correct, the current one with bypassing dependencies is wrong.
Just wanted to add, that if a dependency is needed for runtime but not for building, then it can be listed in the depends inside the actual package() function. In that case, makepkg *still* does the right thing, because it doesn't install a non-build-time dependency... (This is usually relevant in split packages, in which case the makedepends includes all the individual package() depends -- but it could be used to separate runtime-only depends. If it actually was important to pander to this very limited and not-well-justified use-case.) -- Eli Schwartz
On 22/10/16 00:46, Eli Schwartz wrote:
On 10/21/2016 10:16 AM, Lukas Jirkovsky wrote:
build time dependencies = makedepends + depends runtime dependencies = depends
In other words, the depends are implicitly makedepends, too. You need to build packages in correct order. You approach of ignoring dependencies will fail miserably when one of your "runtime dependecies" will have soname bump. Eg. your package b provides libb.so.1. You rebuild a and it will link agains libb.so.1. Then you rebuild package b and the library changes to libb.so.2. Now the package a is broken, because it is linked against library that is no longer existing.
TLDR: you original approach was correct, the current one with bypassing dependencies is wrong.
Just wanted to add, that if a dependency is needed for runtime but not for building, then it can be listed in the depends inside the actual package() function.
In that case, makepkg *still* does the right thing, because it doesn't install a non-build-time dependency...
(This is usually relevant in split packages, in which case the makedepends includes all the individual package() depends -- but it could be used to separate runtime-only depends. If it actually was important to pander to this very limited and not-well-justified use-case.)
Correct. I'm sure there was a bug report asking for rundepends=() to be added to the PKGBUILD spec. I can't seem to find it, so I guess that was rejected! A
On Sat, 22 Oct 2016 14:24:59 +1000 Allan McRae <allan@archlinux.org> wrote:
I'm sure there was a bug report asking for rundepends=() to be added to the PKGBUILD spec. I can't seem to find it, so I guess that was rejected!
A
participants (7)
-
Alad Wenter
-
Allan McRae
-
Brendan Hide
-
Doug Newgard
-
Eli Schwartz
-
Johannes Löthberg
-
Lukas Jirkovsky