unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Output all dependencies recursively for package
@ 2021-01-31 12:59 Phil
  2021-01-31 15:03 ` Joshua Branson
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Phil @ 2021-01-31 12:59 UTC (permalink / raw)
  To: help-guix

Hi all,

I'm looking for a command similar to 'guix show' which will give a packages explicit
dependencies, recursively.

Basically something like python's 'pip freeze' for a specific package.

I know 'guix graph' can do this but the output is much more elaborate
than I need, also 'guix export' could probably give a very verbose
output.

I'm looking for a recursive list of all bar@version given package
foo?

Something like:
guix show --recursive-dependencies foo

Giving:
dependencies: bar@version, some-dependency-of-bar@version

'guix show' would not list 'some-dependency-of-bar@version' in its
current form.


Any ideas?

Thanks,
Phil.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Output all dependencies recursively for package
  2021-01-31 12:59 Output all dependencies recursively for package Phil
@ 2021-01-31 15:03 ` Joshua Branson
  2021-02-01  1:32   ` Tobias Geerinckx-Rice
  2021-01-31 15:30 ` Efraim Flashner
  2021-01-31 19:09 ` zimoun
  2 siblings, 1 reply; 8+ messages in thread
From: Joshua Branson @ 2021-01-31 15:03 UTC (permalink / raw)
  To: Phil; +Cc: help-guix

Phil <phil@beadling.co.uk> writes:

> Hi all,
>
> I'm looking for a command similar to 'guix show' which will give a packages explicit
> dependencies, recursively.
>
> Basically something like python's 'pip freeze' for a specific package.
>

Does guix-refresh --recursive do that? 

#+BEGIN_SRC sh
$ guix refresh --recursive guile

gnu/packages/multiprecision.scm:41:12: gmp would be upgraded from 6.2.0 to 6.2.1
guix/build-system/gnu.scm:143:8: tar would be upgraded from 1.32 to 1.33
guix/build-system/gnu.scm:143:8: findutils would be upgraded from 4.7.0 to 4.8.0
guix/build-system/gnu.scm:143:8: gawk would be upgraded from 5.0.1 to 5.1.0
gnu/packages/commencement.scm:3741:4: grep would be upgraded from 3.4 to 3.6
guix/build-system/gnu.scm:143:8: gmp would be upgraded from 6.2.0 to 6.2.1
guix/build-system/gnu.scm:143:8: guile would be upgraded from 3.0.2 to 3.0.5
gnu/packages/commencement.scm:3501:2: binutils would be upgraded from 2.34 to 2.36
gnu/packages/commencement.scm:3561:2: gcc would be upgraded from 7.5.0 to 10.2.0
gnu/packages/commencement.scm:3456:2: glibc would be upgraded from 2.31 to 2.32
#+END_SRC

I'm sure you can use an awk script and uniq from coreutils to turn that
into what you want.


     Note that for core packages this can yield huge graphs.  If all you
     want is to know the number of packages that depend on a given
     package, use ‘guix refresh --list-dependent’ (*note
     ‘--list-dependent’: Invoking guix refresh.).

> Any ideas?
>
> Thanks,
> Phil.
>

--
Joshua Branson (joshuaBPMan in #guix)
Sent from Emacs and Gnus
  https://gnucode.me
  https://video.hardlimit.com/accounts/joshua_branson/video-channels
  https://propernaming.org
  "You can have whatever you want, as long as you help
enough other people get what they want." - Zig Ziglar


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Output all dependencies recursively for package
  2021-01-31 12:59 Output all dependencies recursively for package Phil
  2021-01-31 15:03 ` Joshua Branson
@ 2021-01-31 15:30 ` Efraim Flashner
  2021-01-31 19:09 ` zimoun
  2 siblings, 0 replies; 8+ messages in thread
From: Efraim Flashner @ 2021-01-31 15:30 UTC (permalink / raw)
  To: Phil; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 2169 bytes --]

On Sun, Jan 31, 2021 at 12:59:40PM +0000, Phil wrote:
> Hi all,
> 
> I'm looking for a command similar to 'guix show' which will give a packages explicit
> dependencies, recursively.
> 
> Basically something like python's 'pip freeze' for a specific package.
> 
> I know 'guix graph' can do this but the output is much more elaborate
> than I need, also 'guix export' could probably give a very verbose
> output.
> 
> I'm looking for a recursive list of all bar@version given package
> foo?
> 
> Something like:
> guix show --recursive-dependencies foo
> 
> Giving:
> dependencies: bar@version, some-dependency-of-bar@version
> 
> 'guix show' would not list 'some-dependency-of-bar@version' in its
> current form.
> 
> 
> Any ideas?
> 

sounds like one of the options from 'guix refresh' is what you're
looking for:

(ins)efraim@3900XT ~/workspace/guix$ guix refresh --list-transitive python-pip
python-pip@20.2.4 depends on the following 69 packages: gdbm@1.18.1 sqlite@3.31.1 libxrender@0.9.10 libxft@2.3.3 gperf@3.1 gzip@1.10 bzip2@1.0.8 unzip@6.0 font-dejavu@2.37 libpng@1.6.37 freetype@2.10.1 tar@1.32 net-base@5.3 util-linux@2.35.1 fontconfig@2.13.1 tcl@8.6.10 xtrans@1.4.0 xcb-proto@1.14 libunistring@0.9.10 gettext-minimal@0.20.1 libgpg-error@1.37 libgcrypt@1.8.5 libxml2@2.9.10 readline@8.0.4 ncurses@6.2 bash@5.0.16 tzdata@2019c expat@2.2.9 libffi@3.3 perl@5.30.2 openssl@1.1.1f python-minimal@3.8.2 python-minimal-wrapper@3.8.2 zlib@1.2.11 xz@5.2.4 libxslt@1.1.34 libpthread-stubs@0.4 libxau@1.0.9 libbsd@0.10.0 libxdmcp@1.1.3 libxcb@1.14 libx11@1.6.9 pkg-config@0.29.2 util-macros@1.19.2 xorgproto@2019.2 libxext@1.3.4 tk@8.6.10 python@3.8.2 python-wrapper@3.8.2 tar@1.32 gzip@1.10 bzip2@1.0.8 xz@5.2.4 file@5.38 diffutils@3.7 patch@2.7.6 findutils@4.7.0 gawk@5.0.1 sed@4.8 grep@3.4 coreutils@8.32 make@4.3 guile@3.0.2 bash-minimal@5.0.16 ld-wrapper@0 binutils@2.34 gcc@7.5.0 glibc@2.31 glibc-utf8-locales@2.31

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Output all dependencies recursively for package
  2021-01-31 12:59 Output all dependencies recursively for package Phil
  2021-01-31 15:03 ` Joshua Branson
  2021-01-31 15:30 ` Efraim Flashner
@ 2021-01-31 19:09 ` zimoun
  2 siblings, 0 replies; 8+ messages in thread
From: zimoun @ 2021-01-31 19:09 UTC (permalink / raw)
  To: Phil, help-guix

Hi Phil,

On Sun, 31 Jan 2021 at 12:59, Phil <phil@beadling.co.uk> wrote:

> I'm looking for a recursive list of all bar@version given package
> foo?
>
> Something like:
> guix show --recursive-dependencies foo
>
> Giving:
> dependencies: bar@version, some-dependency-of-bar@version

I proposed something like that:

  <http://issues.guix.gnu.org/issue/43477>

adding a «backend» to “guix graph”.  In my mind, it was exactly the use
case you are describing with the option to select the “type” of the
graph.  It has been “rejected” (not the word, but too lazy to find the
adequate one), mainly because I just wanted to list all the nodes
(topologically sorted or not) and Ludo and Ricardo raised that it is not
about “graph”.  Anyway.

Maybe it could go to “guix show”.  However, the current implementation
of “guix show” uses “guix package --show=”, literally.  And adding more
things in “guix package” does not seem a good idea, IHMO.

In other words, instead of use (guix scripts package) in (guix scripts
show), do the contrary.  I have a patch that do that but never
submitted because I have never felt the need or time to.  Anyway.

With the current tools, “guix refresh --list-transitive” maybe is enough
for your needs.  Note that the returned packages are not necessary the
ones you can access at the CLI level, for instance ’gcc’.


Hope that helps,
simon



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Output all dependencies recursively for package
  2021-01-31 15:03 ` Joshua Branson
@ 2021-02-01  1:32   ` Tobias Geerinckx-Rice
  2021-02-01  6:26     ` zimoun
  0 siblings, 1 reply; 8+ messages in thread
From: Tobias Geerinckx-Rice @ 2021-02-01  1:32 UTC (permalink / raw)
  To: Phil; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

Phil,

Phil <phil@beadling.co.uk> writes:
> I'm looking for a command similar to 'guix show' which will give 
> a packages explicit
> dependencies, recursively.

Best ditch the d-word; it's too ambiguous to be useful, as 
illustrated by this thread.

If by ‘explicit dependencies’ you mean all explicitly listed 
inputs then none of the suggested commands so far actually do what 
you're asking for, which is to show nothing for, e.g., the ‘hello’ 
package.

I don't think there's a CLI command to do so, but it's quite easy 
to recurse over all (package-{,native-,propagated-}inputs pkg) 
using ‘guix repl’ if you know some Scheme.  What's your use case 
here?

Perhaps it's good enough to warrant ‘guix refresh 
--list-transitive-inputs’ (to avoid philosophical discussions 
about what constitutes a graph :-).

Kind regards,

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Output all dependencies recursively for package
  2021-02-01  1:32   ` Tobias Geerinckx-Rice
@ 2021-02-01  6:26     ` zimoun
  2021-02-01 16:21       ` me--- via
  2021-02-01 19:36       ` Phil
  0 siblings, 2 replies; 8+ messages in thread
From: zimoun @ 2021-02-01  6:26 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: help-guix

Hi Tobias,

On Mon, 1 Feb 2021 at 02:33, Tobias Geerinckx-Rice <me@tobias.gr> wrote:

> Perhaps it's good enough to warrant ‘guix refresh
> --list-transitive-inputs’ (to avoid philosophical discussions
> about what constitutes a graph :-).

There would be the same philosophical discussion about what
constitutes a "refresh". ;-)

Joke aside, this "hello@2.10 depends on the following 20 packages:" is
annoying because you have to pipe " | cut -d':' -f2" to get what you
are really interested in.  And you have to pipe more if you want to
grep in.  Anyway, I would not redo the philosophical discussion. ;-)

Cheers,
simon


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Output all dependencies recursively for package
  2021-02-01  6:26     ` zimoun
@ 2021-02-01 16:21       ` me--- via
  2021-02-01 19:36       ` Phil
  1 sibling, 0 replies; 8+ messages in thread
From: me--- via @ 2021-02-01 16:21 UTC (permalink / raw)
  To: zimoun; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 372 bytes --]

zimoun 写道:
> There would be the same philosophical discussion about what
> constitutes a "refresh". ;-)
>
> Joke aside, this "hello@2.10 depends on the following 20 
> packages:" is
> annoying because you have to pipe " | cut -d':' -f2" to get what 
> you
> are really interested in.

Oh, I agree with you on both points, Simon!

Kind regards,

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Output all dependencies recursively for package
  2021-02-01  6:26     ` zimoun
  2021-02-01 16:21       ` me--- via
@ 2021-02-01 19:36       ` Phil
  1 sibling, 0 replies; 8+ messages in thread
From: Phil @ 2021-02-01 19:36 UTC (permalink / raw)
  To: help-guix

Thanks for all the responses on this.

In short - yes this does the job.  I should really write it in Guile:
guix refresh –list-transitive my-pkg | cut -d':' -f2 | tr ' ' '\n' | grep python | sort

I have a guix package that had originally been deployed with a python
requirements file to create a venv.

I was curious to see that, if I matched the versions in the requirements
file, in my guix package what the full set of dependent python packages
would be (i.e. those returned by pip freeze).

Obviously there are some mismatched because pip often only gives
requirements as a lower bound, where any given version of guix will
typically only contain a single current version of a package.

The specific weirdness I was looking at was my guix setup seemed to have
installed both tornado5 and tornado6 python packages packages - a situation that can't
happen in pip!

I was toying with writing a pkg2reqs.scm which would produce a python
requirements file from a Guix package.  I found it particularly useful to
create this manually when trying to decide if my move to Guix had issues
due to a slight version mismatch between PyPi and Guix,  or something
else.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-02-01 19:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-31 12:59 Output all dependencies recursively for package Phil
2021-01-31 15:03 ` Joshua Branson
2021-02-01  1:32   ` Tobias Geerinckx-Rice
2021-02-01  6:26     ` zimoun
2021-02-01 16:21       ` me--- via
2021-02-01 19:36       ` Phil
2021-01-31 15:30 ` Efraim Flashner
2021-01-31 19:09 ` zimoun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).