unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: seamus phenetols <seamusphenetols@yandex.com>
Cc: 32580@debbugs.gnu.org
Subject: 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	[thread overview]
Message-ID: <8736t89i18.fsf@gmail.com> (raw)
In-Reply-To: <2474841539446639@myt2-cd7fa496c4f7.qloud-c.yandex.net> (seamus phenetols's message of "Sat, 13 Oct 2018 12:03:59 -0400")

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

Hello Seamus,

seamus phenetols <seamusphenetols@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@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@apteryx ~/Documents$ 
maxim@apteryx ~/Documents$ rm /home/maxim/.cache/guile/ccache/2.2-LE-8-3.A/home/maxim/Documents/test-auto-compile.scm.go
maxim@apteryx ~/Documents$ export GUILE_AUTO_COMPILE=0
maxim@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


[-- Attachment #2: Short program demonstrating GUILE_AUTO_COMPILE --]
[-- Type: text/plain, Size: 539 bytes --]

#!/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)

  parent reply	other threads:[~2018-10-15  0:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-29 22:49 bug#32580: Setting variables %load-should-autocompile and GUILE_AUTO_COMPILE in ~/.guile doesn't prevent compiling seamus phenetols
2018-08-31  1:20 ` Maxim Cournoyer
2018-08-31 14:00   ` seamus phenetols
2018-09-01 18:59     ` Maxim Cournoyer
     [not found]       ` <2474841539446639@myt2-cd7fa496c4f7.qloud-c.yandex.net>
2018-10-15  0:21         ` Maxim Cournoyer [this message]
2018-09-02 19:22 ` Daniel Llorens
2021-05-18 16:30 ` Taylan Kammer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8736t89i18.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=32580@debbugs.gnu.org \
    --cc=seamusphenetols@yandex.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).