unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#54820: build-systems: inconsistent use of standard-packages
@ 2022-04-09 16:24 Hartmut Goebel
  2022-04-09 17:52 ` Maxime Devos
  0 siblings, 1 reply; 2+ messages in thread
From: Hartmut Goebel @ 2022-04-09 16:24 UTC (permalink / raw)
  To: 54820

Build-systems are adding „@(standard-packages)“ inconsistently to 
„host-packages“ or „build-packages”. For one developing a new 
build-system it is not clear which is the correct form.

Some (e.g. texlive, ruby, python) add it to „host-inputs“)

          (host-inputs `(,@(if source
                               `(("source" ,source))
                               '())
                         ,@inputs
                          ;; Keep the standard inputs of 'gnu-build-system'.
                          ,@(standard-packages)))

Some add it to „build-inputs (e.g. gnu, cmake, qt):

     (build-inputs `(,@(if source
                           `(("source" ,source))
                           '())
                     ,@`(("cmake" ,cmake))
                     ,@native-inputs
                     ,@(if target
                           ;; Use the standard cross inputs of
                           ;; 'gnu-build-system'.
                           (standard-cross-packages target 'host)
                           '())
                     ;; Keep the standard inputs of 'gnu-build-system'.
                     ,@(standard-packages)))


Expected:

Either

a) review and align the code of all build-systems, or

b) add a comment to every build-system briefly explaining why in host 
resp. build-packages here,

c) document how and why to use which form.

Since as far as I've seen there is no detailed „How to write a 
build-system“, developers (well, me :-) tend to develop new 
build-systems based on existing ones. Thus (a) or (b) seem the easier 
and quicker solution.


Reproduce:

grep -A5 -B5 standard-packages guix/build-system/*.scm

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |





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

* bug#54820: build-systems: inconsistent use of standard-packages
  2022-04-09 16:24 bug#54820: build-systems: inconsistent use of standard-packages Hartmut Goebel
@ 2022-04-09 17:52 ` Maxime Devos
  0 siblings, 0 replies; 2+ messages in thread
From: Maxime Devos @ 2022-04-09 17:52 UTC (permalink / raw)
  To: Hartmut Goebel, 54820

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

Hartmut Goebel schreef op za 09-04-2022 om 18:24 [+0200]:
> Build-systems are adding „@(standard-packages)“ inconsistently to 
> „host-packages“ or „build-packages”. For one developing a new 
> build-system it is not clear which is the correct form.
> 
> Some (e.g. texlive, ruby, python) add it to „host-inputs“)

FWIW, the latest version of <https://issues.guix.gnu.org/54471>
corrects it for font-build-system.

> [...]
> Some add it to „build-inputs (e.g. gnu, cmake, qt):
> [...]

The reason in cross-compilation support:

  * host-inputs ≈ inputs  
  * build-inputs ≈ native-inputs 

There's also this comment from (guix build-system)

  ;; Here we use build/host/target in the sense of the GNU tool chain (info
  ;; "(autoconf) Specifying Target Triplets").
  (build-inputs  bag-build-inputs        ;list of packages
                 (default '()))
  (host-inputs   bag-host-inputs         ;list of packages
                 (default '()))

And (autoconf)Specifying Target Triplets:

'--build=BUILD-TYPE'
     the type of system on which the package is being configured and
     compiled.  It defaults to the result of running 'config.guess'.
     Specifying a BUILD-TYPE that differs from HOST-TYPE enables
     cross-compilation mode.

'--host=HOST-TYPE'
     the type of system on which the package runs.  By default it is the
     same as the build machine.  Specifying a HOST-TYPE that differs
     from BUILD-TYPE, when BUILD-TYPE was also explicitly specified,
     enables cross-compilation mode.

(standard-packages) contains a tar, gzip, awk ... which are typically only
needed as native-inputs, so they go in 'build-inputs'.

There's also the complication that the cross-compilation system of glibc
is apparently different from other packages:

    ;; The cross-libc is really a target package, but for bootstrapping
    ;; reasons, we can't put it in 'host-inputs'.  Namely, 'cross-gcc' is a
    ;; native package, so it would end up using a "native" variant of
    ;; 'cross-libc' (built with 'gnu-build'), whereas all the other packages
    ;; would use a target variant (built with 'gnu-cross-build'.)
    (target-inputs (if (and target implicit-cross-inputs?)
                       (standard-cross-packages target 'target)
                       '()))

Also, (standard-packages) only contains a non-cross-compiling gcc, so
(standard-cross-packages) (used when cross-compiling) adds a cross-compiling
gcc.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

end of thread, other threads:[~2022-04-09 17:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-09 16:24 bug#54820: build-systems: inconsistent use of standard-packages Hartmut Goebel
2022-04-09 17:52 ` Maxime Devos

Code repositories for project(s) associated with this public inbox

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

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).