guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deprecating legacy build phase style when cross-compiling vs. native


From: Ludovic Courtès
Subject: Re: Deprecating legacy build phase style when cross-compiling vs. native
Date: Fri, 01 Apr 2022 11:02:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hi Josselin,

Josselin Poiret <dev@jpoiret.xyz> skribis:

> Looking at guix/build-system/gnu.scm [2], we have gnu-build
> vs. gnu-cross-build, which are responsible for native vs. cross-builds.
> The former uses with-build-variables to set the legacy build variables
> such as %output and %outputs (see the def in guix/gexp.scm), whereas the
> latter does not, only doing so manually and so omitting %output.

‘%output’ (singular) had long been informally deprecated in favor of
‘%outputs’ (plural).

> This means that packages that were not updated to fit the new style
> should all fail to cross-compile.  This simple bug could be resolved by
> adding %output to gnu-cross-build, however as was argued on IRC this is
> now undocumented behaviour and we'd rather switch all packages to the
> new style instead.  While I 100% agree with this, I think we should have
> a uniform deprecation policy for this matter, and that there shouldn't
> be such a disparity between cross and native builds.

The easiest change is to replace:

  %output

with:

  (assoc-ref %outputs "out")

It’s a simple search-and-replace.

The next step would be to use gexps and #$output, but that can be done
incrementally over time IMO.

WDYT?

Thanks,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]