all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Most used and least used build-system in Guix packages
@ 2023-04-12 23:04 Rodrigo Morales
  2023-04-13  1:55 ` Maxim Cournoyer
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rodrigo Morales @ 2023-04-12 23:04 UTC (permalink / raw)
  To: help-guix

Table of Contents
_________________

1. TL; DR
2. My findings
3. The question


1 TL; DR
========

  Today, I was wondering what the most used build system and the least
  one are. The most used build system is `gnu-build-system'. The least
  used build system is `dub-build-system'. Here's how I found that out.


2 My findings
=============

  ,----
  | (car %load-path)
  `----

  ,----
  |
/gnu/store/zc7dzsd10dd3pw60hircphz4vh1wlki0-guix-module-union/share/guile/site/3.0
  `----

  ,----
  |
dir="/gnu/store/zc7dzsd10dd3pw60hircphz4vh1wlki0-guix-module-union/share/guile/site/3.0"
  | path="$dir/gnu/packages"
  | grep -hREo '[a-zo-]+-build-system' $path | sort | uniq -c | sort -nr
  `----

  ,----
  | 3893 gnu-build-system
  | 2717 python-build-system
  | 2359 r-build-system
  | 2188 cargo-build-system
  | 1328 emacs-build-system
  | 1176 cmake-build-system
  |  841 perl-build-system
  |  783 asdf-build-system
  |  776 haskell-build-system
  |  568 ruby-build-system
  |  536 go-build-system
  |  488 meson-build-system
  |  361 ant-build-system
  |  313 qt-build-system
  |  299 julia-build-system
  |  198 glib-or-gtk-build-system
  |  198 dune-build-system
  |  192 trivial-build-system
  |  158 pyproject-build-system
  |  154 copy-build-system
  |   81 font-build-system
  |   78 guile-build-system
  |   75 texlive-build-system
  |   52 ocaml-build-system
  |   49 node-build-system
  |   29 elm-build-system
  |   21 rebar-build-system
  |   21 rakudo-build-system
  |   21 minetest-mod-build-system
  |   20 waf-build-system
  |   19 linux-module-build-system
  |   15 minify-build-system
  |   14 clojure-build-system
  |   13 scons-build-system
  |   12 android-ndk-build-system
  |    9 patch-build-system
  |    9 chicken-build-system
  |    3 fix-build-system
  |    3 channel-build-system
  |    2 maven-build-system
  |    1 tree-sitter-build-system
  |    1 renpy-build-system
  |    1 package-build-system
  |    1 dub-build-system
  `----


3 The question
==============

  Does anyone know if there's a more accurate way of finding out this
  information? I'm asking because my method also counts build systems
  that are mentioned in comments. For example, if a file contains
  comments that mention build systems, they are also counted.

  ,----
  | (... more sentences that mention dub-build-system...)
  | ;; One sentence that mentions dub-build-system
  | ;; Another sentence that mentions dub-build-system
  | (... more sentences that mention dub-build-system...)
  `----

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

* Re: Most used and least used build-system in Guix packages
  2023-04-12 23:04 Most used and least used build-system in Guix packages Rodrigo Morales
@ 2023-04-13  1:55 ` Maxim Cournoyer
  2023-04-13  9:40 ` Simon Tournier
  2023-04-13 17:12 ` Martin Castillo
  2 siblings, 0 replies; 4+ messages in thread
From: Maxim Cournoyer @ 2023-04-13  1:55 UTC (permalink / raw)
  To: Rodrigo Morales; +Cc: help-guix

Hello,

Rodrigo Morales <moralesrodrigo1100@gmail.com> writes:

> Table of Contents
> _________________
>
> 1. TL; DR
> 2. My findings
> 3. The question
>
>
> 1 TL; DR
> ========
>
>   Today, I was wondering what the most used build system and the least
>   one are. The most used build system is `gnu-build-system'. The least
>   used build system is `dub-build-system'. Here's how I found that out.
>
>
> 2 My findings
> =============
>
>   ,----
>   | (car %load-path)
>   `----
>
>   ,----
>   |
> /gnu/store/zc7dzsd10dd3pw60hircphz4vh1wlki0-guix-module-union/share/guile/site/3.0
>   `----
>
>   ,----
>   |
> dir="/gnu/store/zc7dzsd10dd3pw60hircphz4vh1wlki0-guix-module-union/share/guile/site/3.0"
>   | path="$dir/gnu/packages"
>   | grep -hREo '[a-zo-]+-build-system' $path | sort | uniq -c | sort -nr
>   `----
>
>   ,----
>   | 3893 gnu-build-system
>   | 2717 python-build-system

[...]


> 3 The question
> ==============
>
>   Does anyone know if there's a more accurate way of finding out this
>   information? I'm asking because my method also counts build systems
>   that are mentioned in comments. For example, if a file contains
>   comments that mention build systems, they are also counted.

Guix provides an API, so you could use it from the comfort of the 'guix
repl' REPL to query it, using fold-packages.

The following repo will surely provide some clues as to how to do that;
the following is an example querying all the packages that make use of
the emacs-build-system [0]

[0]  https://notabug.org/apteryx/guix-api-examples/src/master/emacs-packages-manifest.scm

Have fun!

-- 
Thanks,
Maxim


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

* Re: Most used and least used build-system in Guix packages
  2023-04-12 23:04 Most used and least used build-system in Guix packages Rodrigo Morales
  2023-04-13  1:55 ` Maxim Cournoyer
@ 2023-04-13  9:40 ` Simon Tournier
  2023-04-13 17:12 ` Martin Castillo
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Tournier @ 2023-04-13  9:40 UTC (permalink / raw)
  To: Rodrigo Morales, help-guix

Hi,

On Wed, 12 Apr 2023 at 23:04, Rodrigo Morales <moralesrodrigo1100@gmail.com> wrote:

>   Today, I was wondering what the most used build system and the least
>   one are. The most used build system is `gnu-build-system'. The least
>   used build system is `dub-build-system'. Here's how I found that out.

Please give a look at:

    https://issues.guix.gnu.org/msgid/Y0ZgY7ifJg0vkZxB@bluewin.ch

(Argh I am so late for completing the review of this!)

It comes from:
<https://10years.guix.gnu.org/video/guix-repl-to-infinity-and-beyond/>
where some examples traverse all the packages and collect build system
by build system if the modify the field ’arguments’.


Well, here an example to list the most used methods in ’origin’ field.

--8<---------------cut here---------------start------------->8---
$ cat sources.scm
(use-modules (guix)
             (guix git-download)
             (guix hg-download)
             (guix svn-download)
             (guix cvs-download)
             (guix bzr-download)
             (gnu)
             (ice-9 match)
             (srfi srfi-1)
             (srfi srfi-26))

(define packages-with-source
  (fold-packages (lambda (package result)
                   (if (origin? (package-source package))
                     (cons package result)
                     result))
                 '()))

(map (lambda (package)
       (let* ((origin (package-source package))
              (method (origin-method origin))
              (str (cond ((or (eq? method url-fetch)
                              (eq? method url-fetch/tarbomb)
                              (eq? method url-fetch/zipbomb)) "url-fetch")
                         ((eq? method git-fetch) "git-fetch")
                         ((eq? method hg-fetch) "hg-fetch")
                         ((or (eq? method svn-fetch)
                              (eq? method svn-multi-fetch)) "svn-fetch")
                         ((eq? method cvs-fetch) "cvs-fetch")
                         ((eq? method bzr-fetch) "bzr-fetch")
                         (else "other"))))
         (format #t (string-append str "~%"))))
     packages-with-source)

$ guix repl -- sources.scm | sort | uniq -c | sort -rn
  13600 url-fetch
   8047 git-fetch
    458 svn-fetch
     38 other
     32 hg-fetch
      5 bzr-fetch
      2 cvs-fetch
--8<---------------cut here---------------end--------------->8---


Hope that helps.

Cheers,
simon


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

* Re: Most used and least used build-system in Guix packages
  2023-04-12 23:04 Most used and least used build-system in Guix packages Rodrigo Morales
  2023-04-13  1:55 ` Maxim Cournoyer
  2023-04-13  9:40 ` Simon Tournier
@ 2023-04-13 17:12 ` Martin Castillo
  2 siblings, 0 replies; 4+ messages in thread
From: Martin Castillo @ 2023-04-13 17:12 UTC (permalink / raw)
  To: help-guix


> ==============
> 
>    Does anyone know if there's a more accurate way of finding out this
>    information? I'm asking because my method also counts build systems
>    that are mentioned in comments. For example, if a file contains
>    comments that mention build systems, they are also counted.
> 
>    ,----
>    | (... more sentences that mention dub-build-system...)
>    | ;; One sentence that mentions dub-build-system
>    | ;; Another sentence that mentions dub-build-system
>    | (... more sentences that mention dub-build-system...)
>    `----

maybe filter out comment lines ?

grep -hREo '^[^;]+[a-zo-]+-build-system' $path | sort | uniq -c | sort -nr


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

end of thread, other threads:[~2023-04-13 17:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-12 23:04 Most used and least used build-system in Guix packages Rodrigo Morales
2023-04-13  1:55 ` Maxim Cournoyer
2023-04-13  9:40 ` Simon Tournier
2023-04-13 17:12 ` Martin Castillo

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.