unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] doc: Improve guile load path recommendation.
@ 2017-04-15 19:17 myglc2
  2017-04-15 23:20 ` Chris Marusich
  0 siblings, 1 reply; 6+ messages in thread
From: myglc2 @ 2017-04-15 19:17 UTC (permalink / raw)
  To: guix-devel

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


Using geiser-guile-load-path as currently recommended results in source
that was already compiled by the guix build being recompiled :-(

This patch avoids that. It also moves the configuration to
'~/.bash_profile' so it applies when guile is used directly.


[-- Attachment #2: 0001-doc-Improve-guile-load-path-recommendation.patch --]
[-- Type: text/x-patch, Size: 1820 bytes --]

From 4585499f99336dc3e626c3105f0539ef3b5ce33c Mon Sep 17 00:00:00 2001
From: George Clemmer <myglc2@gmail.com>
Date: Sat, 15 Apr 2017 14:21:09 -0400
Subject: [PATCH] doc: Improve guile load path recommendation.

* doc/contributing.texi (The Perfect Setup): Advise setting GUILE_LOAD_PATH and
GUILE_LOAD_COMPILED_PATH in .bash_profile rather than emacs init.
---
 doc/contributing.texi | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/doc/contributing.texi b/doc/contributing.texi
index bbc93424b..d23f55a6b 100644
--- a/doc/contributing.texi
+++ b/doc/contributing.texi
@@ -171,14 +171,17 @@ Emacs: code compilation and evaluation from within buffers, access to
 on-line documentation (docstrings), context-sensitive completion,
 @kbd{M-.} to jump to an object definition, a REPL to try out your code,
 and more (@pxref{Introduction,,, geiser, Geiser User Manual}).  For
-convenient Guix development, make sure to augment Guile’s load path so
-that it finds source files from your checkout:
-
-@lisp
-;; @r{Assuming the Guix checkout is in ~/src/guix.}
-(with-eval-after-load 'geiser-guile
-  (add-to-list 'geiser-guile-load-path "~/src/guix"))
-@end lisp
+convenient Guix development, make sure to augment Guile’s load paths so
+that it finds source and compiled files from your checkout. Assuming the
+Guix checkout is in @code{~/src/guix}, add the following lines to your
+‘~/.bash_profile’ (*note (bash)Bash Startup Files::):
+
+@verbatim
+export GUILE_LOAD_PATH=\
+"$HOME/src/guix${GUILE_LOAD_PATH:+:$GUILE_LOAD_PATH}"
+export GUILE_LOAD_COMPILED_PATH=\
+"$HOME/src/guix${GUILE_LOAD_COMPILED_PATH:+:$GUILE_LOAD_COMPILED_PATH}"
+@end verbatim
 
 To actually edit the code, Emacs already has a neat Scheme mode.  But in
 addition to that, you must not miss
-- 
2.12.2


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

* Re: [PATCH] doc: Improve guile load path recommendation.
  2017-04-15 19:17 [PATCH] doc: Improve guile load path recommendation myglc2
@ 2017-04-15 23:20 ` Chris Marusich
  2017-04-16  4:19   ` myglc2
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Marusich @ 2017-04-15 23:20 UTC (permalink / raw)
  To: myglc2; +Cc: guix-devel

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

myglc2 <myglc2@gmail.com> writes:

> Using geiser-guile-load-path as currently recommended results in source
> that was already compiled by the guix build being recompiled :-(
>
> This patch avoids that. It also moves the configuration to
> '~/.bash_profile' so it applies when guile is used directly.
>
> From 4585499f99336dc3e626c3105f0539ef3b5ce33c Mon Sep 17 00:00:00 2001
> From: George Clemmer <myglc2@gmail.com>
> Date: Sat, 15 Apr 2017 14:21:09 -0400
> Subject: [PATCH] doc: Improve guile load path recommendation.
>
> * doc/contributing.texi (The Perfect Setup): Advise setting GUILE_LOAD_PATH and
> GUILE_LOAD_COMPILED_PATH in .bash_profile rather than emacs init.
> ---
>  doc/contributing.texi | 19 +++++++++++--------
>  1 file changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/doc/contributing.texi b/doc/contributing.texi
> index bbc93424b..d23f55a6b 100644
> --- a/doc/contributing.texi
> +++ b/doc/contributing.texi
> @@ -171,14 +171,17 @@ Emacs: code compilation and evaluation from within buffers, access to
>  on-line documentation (docstrings), context-sensitive completion,
>  @kbd{M-.} to jump to an object definition, a REPL to try out your code,
>  and more (@pxref{Introduction,,, geiser, Geiser User Manual}).  For
> -convenient Guix development, make sure to augment Guile’s load path so
> -that it finds source files from your checkout:
> -
> -@lisp
> -;; @r{Assuming the Guix checkout is in ~/src/guix.}
> -(with-eval-after-load 'geiser-guile
> -  (add-to-list 'geiser-guile-load-path "~/src/guix"))
> -@end lisp
> +convenient Guix development, make sure to augment Guile’s load paths so
> +that it finds source and compiled files from your checkout. Assuming the
> +Guix checkout is in @code{~/src/guix}, add the following lines to your
> +‘~/.bash_profile’ (*note (bash)Bash Startup Files::):
> +
> +@verbatim
> +export GUILE_LOAD_PATH=\
> +"$HOME/src/guix${GUILE_LOAD_PATH:+:$GUILE_LOAD_PATH}"
> +export GUILE_LOAD_COMPILED_PATH=\
> +"$HOME/src/guix${GUILE_LOAD_COMPILED_PATH:+:$GUILE_LOAD_COMPILED_PATH}"
> +@end verbatim
>  
>  To actually edit the code, Emacs already has a neat Scheme mode.  But in
>  addition to that, you must not miss

How does this change avoid the recompilation you mentioned?  It looks to
me like before this change, Geiser would find Guix modules in
~/src/guix, and after this change, Geiser will still find Guix modules
in ~/src/guix.  So from that perspective, it seems like it won't change
the way Geiser behaves.

However, before this change, other Guile processes (e.g., launched via
"guix package -i foo") would not see the modules in ~/src/guix, and
after this change, it looks to me like they will see the modules in
~/src/guix.  If the intended goal is just to let Geiser know where the
Guix source lives, then this method might not be the best solution,
since it will affect programs outside of Geiser, too.

If I'm mistaken, please help me understand what I'm missing.

-- 
Chris

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

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

* Re: [PATCH] doc: Improve guile load path recommendation.
  2017-04-15 23:20 ` Chris Marusich
@ 2017-04-16  4:19   ` myglc2
  2017-04-16  8:06     ` Alex Kost
  0 siblings, 1 reply; 6+ messages in thread
From: myglc2 @ 2017-04-16  4:19 UTC (permalink / raw)
  To: Chris Marusich; +Cc: guix-devel

On 04/15/2017 at 16:20 Chris Marusich writes:

> myglc2 <myglc2@gmail.com> writes:
>
>> Using geiser-guile-load-path as currently recommended results in source
>> that was already compiled by the guix build being recompiled :-(
>>
>> This patch avoids that. It also moves the configuration to
>> '~/.bash_profile' so it applies when guile is used directly.
>>
>> From 4585499f99336dc3e626c3105f0539ef3b5ce33c Mon Sep 17 00:00:00 2001
>> From: George Clemmer <myglc2@gmail.com>
>> Date: Sat, 15 Apr 2017 14:21:09 -0400
>> Subject: [PATCH] doc: Improve guile load path recommendation.
>>
>> * doc/contributing.texi (The Perfect Setup): Advise setting GUILE_LOAD_PATH and
>> GUILE_LOAD_COMPILED_PATH in .bash_profile rather than emacs init.
>> ---
>>  doc/contributing.texi | 19 +++++++++++--------
>>  1 file changed, 11 insertions(+), 8 deletions(-)
>>
>> diff --git a/doc/contributing.texi b/doc/contributing.texi
>> index bbc93424b..d23f55a6b 100644
>> --- a/doc/contributing.texi
>> +++ b/doc/contributing.texi
>> @@ -171,14 +171,17 @@ Emacs: code compilation and evaluation from within buffers, access to
>>  on-line documentation (docstrings), context-sensitive completion,
>>  @kbd{M-.} to jump to an object definition, a REPL to try out your code,
>>  and more (@pxref{Introduction,,, geiser, Geiser User Manual}).  For
>> -convenient Guix development, make sure to augment Guile’s load path so
>> -that it finds source files from your checkout:
>> -
>> -@lisp
>> -;; @r{Assuming the Guix checkout is in ~/src/guix.}
>> -(with-eval-after-load 'geiser-guile
>> -  (add-to-list 'geiser-guile-load-path "~/src/guix"))
>> -@end lisp
>> +convenient Guix development, make sure to augment Guile’s load paths so
>> +that it finds source and compiled files from your checkout. Assuming the
>> +Guix checkout is in @code{~/src/guix}, add the following lines to your
>> +‘~/.bash_profile’ (*note (bash)Bash Startup Files::):
>> +
>> +@verbatim
>> +export GUILE_LOAD_PATH=\
>> +"$HOME/src/guix${GUILE_LOAD_PATH:+:$GUILE_LOAD_PATH}"
>> +export GUILE_LOAD_COMPILED_PATH=\
>> +"$HOME/src/guix${GUILE_LOAD_COMPILED_PATH:+:$GUILE_LOAD_COMPILED_PATH}"
>> +@end verbatim
>>  
>>  To actually edit the code, Emacs already has a neat Scheme mode.  But in
>>  addition to that, you must not miss
>
> How does this change avoid the recompilation you mentioned?  It looks to
> me like before this change, Geiser would find Guix modules in
> ~/src/guix, and after this change, Geiser will still find Guix modules
> in ~/src/guix.  So from that perspective, it seems like it won't change
> the way Geiser behaves.

Hi Chris, thank you for the comments ;-)

I can report that this has a big, positive effect on the geiser user
experience.  Before this change guile didn't find the compiled files in
the git checkout work tree and so it compiled everything it touched
(putting compiled files in '~/.cache/guile/ccache/'). This produced big
delays and it just felt broken.

> However, before this change, other Guile processes (e.g., launched via
> "guix package -i foo") would not see the modules in ~/src/guix, and
> after this change, it looks to me like they will see the modules in
> ~/src/guix.

I believe the guix commands find compiled files in the git work tree
because '~/.config/guix/latest' points there ...

  /home/g1/.config/guix/latest -> /home/g1/src/guix/

> If the intended goal is just to let Geiser know where the
> Guix source lives, then this method might not be the best solution,
> since it will affect programs outside of Geiser, too.
>
> If I'm mistaken, please help me understand what I'm missing.

The geiser doc says ...

       You can also specify a couple more initialisation parameters.  For
    Guile, 'geiser-guile-load-path' is a list of paths to add to its load
    path (and its compiled load path) when it's started, ...

... which implies that geiser sets the compiled load path to the
geiser-guile-load-path. But it does not seem to be doing that. I guess
that could be a bug.

Regarding our other guile apps ...

The guix makefile unsets GUILE_LOAD_COMPILED_PATH, so the guix build is
unaffected.

With the proposed change, a guile user exploring guix via the REPL has a
better experience than before.

Are there other guile apps you have in mind?

HTH, please let me know. - George

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

* Re: [PATCH] doc: Improve guile load path recommendation.
  2017-04-16  4:19   ` myglc2
@ 2017-04-16  8:06     ` Alex Kost
  2017-04-16 13:24       ` myglc2
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Kost @ 2017-04-16  8:06 UTC (permalink / raw)
  To: myglc2; +Cc: guix-devel

myglc2 (2017-04-16 00:19 -0400) wrote:

> On 04/15/2017 at 16:20 Chris Marusich writes:
[...]
> The geiser doc says ...
>
>        You can also specify a couple more initialisation parameters.  For
>     Guile, 'geiser-guile-load-path' is a list of paths to add to its load
>     path (and its compiled load path) when it's started, ...
>
> ... which implies that geiser sets the compiled load path to the
> geiser-guile-load-path. But it does not seem to be doing that. I guess
> that could be a bug.

Previously I also thought that setting ‘geiser-guile-load-path’ is not
enough as it would only set the %load-path, because Geiser starts Guile
like this (<some-dir> comes from ‘geiser-guile-load-path’):

  guile ... -L <some-dir>

while it should be:

  guile ... -L <some-dir> -C <some-dir>

to set the %load-compiled-path as well.  However, I've just found that
geiser sets %load-compiled-path internally in its Scheme code, so the
current recommendation in the manual should probably work (I didn't
check it, as I prefer to set environment variables).

BTW, according to the commit message at
<https://github.com/jaor/geiser/commit/393305d2fcf612f4e5f99383f680f819b458c326>,
it looks like Ludovic was the person who proposed this change ;-)

-- 
Alex

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

* Re: [PATCH] doc: Improve guile load path recommendation.
  2017-04-16  8:06     ` Alex Kost
@ 2017-04-16 13:24       ` myglc2
  2017-04-17  1:57         ` Chris Marusich
  0 siblings, 1 reply; 6+ messages in thread
From: myglc2 @ 2017-04-16 13:24 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

On 04/16/2017 at 11:06 Alex Kost writes:

> myglc2 (2017-04-16 00:19 -0400) wrote:
>
>> On 04/15/2017 at 16:20 Chris Marusich writes:
> [...]
>> The geiser doc says ...
>>
>>        You can also specify a couple more initialisation parameters.  For
>>     Guile, 'geiser-guile-load-path' is a list of paths to add to its load
>>     path (and its compiled load path) when it's started, ...
>>
>> ... which implies that geiser sets the compiled load path to the
>> geiser-guile-load-path. But it does not seem to be doing that. I guess
>> that could be a bug.
>
> Previously I also thought that setting ‘geiser-guile-load-path’ is not
> enough as it would only set the %load-path, because Geiser starts Guile
> like this (<some-dir> comes from ‘geiser-guile-load-path’):
>
>   guile ... -L <some-dir>
>
> while it should be:
>
>   guile ... -L <some-dir> -C <some-dir>
>
> to set the %load-compiled-path as well.  However, I've just found that
> geiser sets %load-compiled-path internally in its Scheme code, so the
> current recommendation in the manual should probably work (I didn't
> check it, as I prefer to set environment variables).
>
> BTW, according to the commit message at
> <https://github.com/jaor/geiser/commit/393305d2fcf612f4e5f99383f680f819b458c326>,
> it looks like Ludovic was the person who proposed this change ;-)

Thanks for the comments. I now see that I was confusing the effects of
installing guile 2.2, which causes recompilation of everything, with the
effects of this change, which I made at about the same time.

So please forget about the patch. SORRY for the run around!

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

* Re: [PATCH] doc: Improve guile load path recommendation.
  2017-04-16 13:24       ` myglc2
@ 2017-04-17  1:57         ` Chris Marusich
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Marusich @ 2017-04-17  1:57 UTC (permalink / raw)
  To: myglc2; +Cc: guix-devel, Alex Kost

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

myglc2 <myglc2@gmail.com> writes:

> Thanks for the comments. I now see that I was confusing the effects of
> installing guile 2.2, which causes recompilation of everything, with the
> effects of this change, which I made at about the same time.
>
> So please forget about the patch. SORRY for the run around!

OK - I'm glad we figured things out!  I was a little confused, because
the current recommendation (to use with-eval-after-load) works fine for
me in GuixSD.

Things should be better, and less confusing, once Guix is compiled using
Guile 2.2.

-- 
Chris

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

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

end of thread, other threads:[~2017-04-17  1:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-15 19:17 [PATCH] doc: Improve guile load path recommendation myglc2
2017-04-15 23:20 ` Chris Marusich
2017-04-16  4:19   ` myglc2
2017-04-16  8:06     ` Alex Kost
2017-04-16 13:24       ` myglc2
2017-04-17  1:57         ` Chris Marusich

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