Subject: Re: bug#36511: extraneous recompiles of scm files while editing gnu/packages/

From: Robert Vollmert <[email-masked]>
Date: Mon, 8 Jul 2019 13:46:11 +0200

> On 8. Jul 2019, at 12:03, Ludovic Courtès <[email-masked]> wrote:
> 
> Robert Vollmert <[email-masked]> skribis:
> 
>>> On 5. Jul 2019, at 22:40, Ludovic Courtès <[email-masked]> wrote:
>>> 
>>> Hi,
>>> 
>>> Robert Vollmert <[email-masked]> skribis:
>>> 
>>>> rob@garp ~/guix$ nano gnu/packages/haskell.scm 
>>>> rob@garp ~/guix$ ./pre-inst-env guix build ghc-ansi-wl-pprint
>>> 
>>> I’d suggest running “make” once you’ve edited a file.
>>> 
>>> It’s not strictly necessary (Guile then simply evaluates code instead of
>>> running compiled code), but it will allow you to get rid of these
>>> warnings, the compiler might warn you ahead of time of possible
>>> mistakes, and the whole thing will be slightly faster.
>>> 
>>> Does that make sense?
>> 
>> It does make sense. However once again my complaint is a bit more about the
>> developer experience than how to work around the current state. I feel that
>> a situation where the obvious thing works but is painful (guile debug spam,
>> slowness) and you need to learn to do things differently (always run make first,
>> which frequently causes work you don’t even care about, such as a guix-daemon
>> recompile or po-file work) could be improved upon.
> 
> Yes I agree.  Things to have to be compiled at one point though.  We
> could let Guile auto-compile code, but unfortunately that comes with its
> own warts: the equivalent of “make clean-go”, for instance when an ABI
> incompatibility pops up, is “rm -rf ~/.cache/guile/ccache”, and that too
> is something a developer has too learn, and one could argue that it’s
> less familiar than “make” or “make clean.”
> 
> So, I’m not satisfied with the ./pre-inst-env and ‘make’ workflow, but
> we have yet to come up with a concrete proposal for a better workflow.
> 
>> Concretely, this bug report is in response to
>> https://lists.gnu.org/archive/html/guix-devel/2019-07/msg00009.html
>> 
>> In that spirit, “you should run make first” is not answer I’m completely
>> happy with. :)
> 
> I was trying to address the “I see recompilation messages” issue that
> you raised in the current framework.  I didn’t initially interpret the
> bug report as a call for a new workflow.

It’s not meant to be a call for a new workflow, either. The original
suggestion from the “beyond 1.0” thread was a request for a focus on
the developer experience by working on the quality of error messages and
command output. One of the instances where that applies is with respect
to guile recompile scam, as I remarked there.

This bug report specifically is in response to this part of the exchange:

>> — currently it’s very easy to miss the
>> actual cause of an error between a lot of noise, e.g. all those “recompiling
>> scheme module” messages

> When do you see “recompiling” messages?
>
> It looks like a bug we could address soonish, not a long-term task.  :-)

As a concrete proposal, I’d be perfectly happy if, instead of printing
a screen full of guile recompile notifications, I’d get a clear warning
that I should run make instead.

Here’s another example, while working on a local checkout of a channel.
Calling `guild compile` just makes things worse.

$ rm -rf ~/.cache/guile
$ guix build -L . -L ../guix-postgrest puzzledb-frontend
;;; note: source file ../guix-postgrest/bytestring.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/bytestring.go
;;; note: source file ../guix-postgrest/check.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/check.go
;;; note: source file ../guix-postgrest/control.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/control.go
;;; note: source file ../guix-postgrest/text.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/text.go
;;; note: source file ../guix-postgrest/data.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/data.go
;;; note: source file ../guix-postgrest/more-data.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/more-data.go
;;; note: source file ../guix-postgrest/containers.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/containers.go
;;; note: source file ../guix-postgrest/core.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/core.go
;;; note: source file ../guix-postgrest/postgrest-deps.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/postgrest-deps.go
;;; note: source file ../guix-postgrest/postgrest.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/postgrest.go
;;; note: source file ../guix-postgrest/sql.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/sql.go
;;; note: source file ../guix-postgrest/template.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/template.go
;;; note: source file ../guix-postgrest/wai.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/wai.go
;;; note: source file ../guix-postgrest/service.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/service.go
;;; note: source file ./elm.scm
;;;       newer than compiled /gnu/store/amjb2461gsrcqiw4faifrf3vpyw46r36-elm/lib/guile/2.2/site-ccache/elm.go
;;; note: source file ./elm2nix.scm
;;;       newer than compiled /gnu/store/amjb2461gsrcqiw4faifrf3vpyw46r36-elm/lib/guile/2.2/site-ccache/elm2nix.go
;;; note: source file ./versions.scm
;;;       newer than compiled /gnu/store/amjb2461gsrcqiw4faifrf3vpyw46r36-elm/lib/guile/2.2/site-ccache/versions.go
/gnu/store/xa65v4m6afmsimb0gg5rdr9v63i9qmd3-puzzledb-frontend-20190625-git
$ rob@garp ~/guix-elm$ guild compile -L . -L ../guix-postgrest *.scm
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /run/current-system/profile/bin/guild
;;; compiled /home/rob/.cache/guile/ccache/2.2-LE-8-3.A/gnu/store/9alic3caqhay3h8mx4iihpmyj6ymqpcx-guile-2.2.4/bin/guild.go
wrote `/home/rob/.cache/guile/ccache/2.2-LE-8-3.A/home/rob/guix-elm/versions.scm.go'
wrote `/home/rob/.cache/guile/ccache/2.2-LE-8-3.A/home/rob/guix-elm/elm.scm.go'
wrote `/home/rob/.cache/guile/ccache/2.2-LE-8-3.A/home/rob/guix-elm/elm2nix.scm.go’
$ rob@garp ~/guix-elm$ guix build -L . -L ../guix-postgrest puzzledb-frontend
;;; note: source file ../guix-postgrest/bytestring.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/bytestring.go
;;; note: source file ../guix-postgrest/check.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/check.go
;;; note: source file ../guix-postgrest/control.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/control.go
;;; note: source file ../guix-postgrest/text.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/text.go
;;; note: source file ../guix-postgrest/data.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/data.go
;;; note: source file ../guix-postgrest/more-data.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/more-data.go
;;; note: source file ../guix-postgrest/containers.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/containers.go
;;; note: source file ../guix-postgrest/core.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/core.go
;;; note: source file ../guix-postgrest/postgrest-deps.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/postgrest-deps.go
;;; note: source file ../guix-postgrest/postgrest.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/postgrest.go
;;; note: source file ../guix-postgrest/sql.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/sql.go
;;; note: source file ../guix-postgrest/template.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/template.go
;;; note: source file ../guix-postgrest/wai.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/wai.go
;;; note: source file ../guix-postgrest/service.scm
;;;       newer than compiled /gnu/store/sk1j6fkh855cm6ypp6799pgf8wvnlk76-postgrest/lib/guile/2.2/site-ccache/service.go
;;; note: source file ./elm.scm
;;;       newer than compiled /gnu/store/amjb2461gsrcqiw4faifrf3vpyw46r36-elm/lib/guile/2.2/site-ccache/elm.go
;;; found fresh local cache at /home/rob/.cache/guile/ccache/2.2-LE-8-3.A/home/rob/guix-elm/elm.scm.go
;;; note: source file ./elm2nix.scm
;;;       newer than compiled /gnu/store/amjb2461gsrcqiw4faifrf3vpyw46r36-elm/lib/guile/2.2/site-ccache/elm2nix.go
;;; found fresh local cache at /home/rob/.cache/guile/ccache/2.2-LE-8-3.A/home/rob/guix-elm/elm2nix.scm.go
;;; note: source file ./versions.scm
;;;       newer than compiled /gnu/store/amjb2461gsrcqiw4faifrf3vpyw46r36-elm/lib/guile/2.2/site-ccache/versions.go
;;; found fresh local cache at /home/rob/.cache/guile/ccache/2.2-LE-8-3.A/home/rob/guix-elm/versions.scm.go
/gnu/store/xa65v4m6afmsimb0gg5rdr9v63i9qmd3-puzzledb-frontend-20190625-git