GNU bug report logs - #32580
Setting variables %load-should-autocompile and GUILE_AUTO_COMPILE in ~/.guile doesn't prevent compiling

Previous Next

Package: guile;

Reported by: seamus phenetols <seamusphenetols <at> yandex.com>

Date: Wed, 29 Aug 2018 23:47:01 UTC

Severity: normal

Done: Taylan Kammer <taylan.kammer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 32580 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: seamus phenetols <seamusphenetols <at> yandex.com>
Cc: 32580 <at> debbugs.gnu.org
Subject: Re: bug#32580: Setting variables %load-should-autocompile and
 GUILE_AUTO_COMPILE in ~/.guile doesn't prevent compiling
Date: Sun, 14 Oct 2018 20:21:07 -0400
[Message part 1 (text/plain, inline)]
Hello Seamus,

seamus phenetols <seamusphenetols <at> yandex.com> writes:

> Setting GUILE_AUTO_COMPILE in ~/.profile and in ~/.bash_profile
> doesn't seem to have any effect.  I'm giving up on guile for now.
> Thank you very much for helping.

I'm sorry it hasn't worked for you! Let's see if we can find out why.

What exactly did you put in your ~/.profile or ~/.bash_profile? What
version of Guile are you using? When launching a new pseudo terminal
(i.e. xterm, gnome-terminal, etc.) and typing 'echo
$GUILE_AUTO_COMPILE', does it return the expected value defined in your
~/.profile or ~/.bash_profile?

Note that you would need to logout then login of your session for new
variable definition to take effect; otherwise you can test it in your
current shell by sourcing it:

--8<---------------cut here---------------start------------->8---
source ~/.bash_profile # or source ~/.profile
--8<---------------cut here---------------start------------->8---

I've put the following Scheme code in a file named
'test-auto-compile.scm' (attached for your convenience):

--8<---------------cut here---------------start------------->8---
#!/usr/bin/env guile
!#

(define (main)
  "Print whether auto-compilation is enabled or not and exit with an
exit status of 1 if it is enabled, 0 otherwise."
  (let ((guile-auto-compile-value (getenv "GUILE_AUTO_COMPILE")))
    (display (format #f "The value of GUILE_AUTO_COMPILE is ~s\n"
		     guile-auto-compile-value))
    (when (and guile-auto-compile-value
	       (string=? guile-auto-compile-value "0"))
	(display "Auto-compilation is disabled.\n")
	(exit 0))
    (display "Auto-compilation is enabled.\n")
    (exit 1)))

(main)
--8<---------------cut here---------------start------------->8---

Here's a small demonstration of what the above script gives on my system
(guile --version is 2.2.4, but this should work for any Guile version >=
2.0):

--8<---------------cut here---------------start------------->8---
echo $GUILE_AUTO_COMPILE

maxim <at> apteryx ~/Documents$ guile test-auto-compile.scm
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/maxim/Documents/test-auto-compile.scm
;;; compiled /home/maxim/.cache/guile/ccache/2.2-LE-8-3.A/home/maxim/Documents/test-auto-compile.scm.go
The value of GUILE_AUTO_COMPILE is #f
Auto-compilation is enabled.
maxim <at> apteryx ~/Documents$ 
maxim <at> apteryx ~/Documents$ rm /home/maxim/.cache/guile/ccache/2.2-LE-8-3.A/home/maxim/Documents/test-auto-compile.scm.go
maxim <at> apteryx ~/Documents$ export GUILE_AUTO_COMPILE=0
maxim <at> apteryx ~/Documents$ guile test-auto-compile.scm
The value of GUILE_AUTO_COMPILE is "0"
Auto-compilation is disabled.
--8<---------------cut here---------------end--------------->8---

I hope this helps,

Maxim

[test-auto-compile.scm (text/plain, attachment)]

This bug report was last modified 4 years and 7 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.