From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Olivier Dion Newsgroups: gmane.lisp.guile.user Subject: Re: Quiet compilation for scripting Date: Fri, 15 Mar 2024 13:31:43 -0400 Message-ID: <87bk7f9zb4.fsf@laura> References: <4f8f12d4-92f9-4183-b094-3b04f52c9f95@app.fastmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10257"; mail-complaints-to="usenet@ciao.gmane.io" To: ksoft@sent.com, guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri Mar 15 18:32:17 2024 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rlBPl-0002Q7-Cb for guile-user@m.gmane-mx.org; Fri, 15 Mar 2024 18:32:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rlBPT-0001KY-CM; Fri, 15 Mar 2024 13:31:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rlBPQ-0001KK-Ut for guile-user@gnu.org; Fri, 15 Mar 2024 13:31:57 -0400 Original-Received: from smtp.polymtl.ca ([132.207.4.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rlBPP-0007OC-9X for guile-user@gnu.org; Fri, 15 Mar 2024 13:31:56 -0400 Original-Received: from localhost ([209.209.33.179]) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 42FHViAw014192; Fri, 15 Mar 2024 13:31:48 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 42FHViAw014192 In-Reply-To: <4f8f12d4-92f9-4183-b094-3b04f52c9f95@app.fastmail.com> X-Poly-FromMTA: ([209.209.33.179]) at Fri, 15 Mar 2024 17:31:44 +0000 Received-SPF: pass client-ip=132.207.4.11; envelope-from=olivier.dion@polymtl.ca; helo=smtp.polymtl.ca X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19472 Archived-At: On Fri, 15 Mar 2024, ksoft@sent.com wrote: > I am in the process of rewriting in Guile a script that I use > regularly. Running Guile 3.0.9, when I execute a file containing > > #!/usr/local/bin/guile -s > !# > (display "Hello, mailing list!") > (newline) > > the following is printed to standard error: > > ;;; note: source file /Users/me/./test.scm > ;;; newer than compiled /Users/me/.cache/guile/ccache/3.0-LE-8-4.6/Users/me/test.scm.go > ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 > ;;; or pass the --no-auto-compile argument to disable. > ;;; compiling /Users/me/./test.scm > ;;; compiled > /Users/me/.cache/guile/ccache/3.0-LE-8-4.6/Users/me/test.scm.go Like the warning says, you ought to either use the GUILE_AUTO_COMPILE environment variable or use the `--no-auto-compile' switch. Unfortunately, there is no `--quiet' or `--warning=/dev/null' option. What I typically do is to compile modules and not compile scripts (program entrypoints). So in the end, I have the following prologue for portable Guile script: --8<---------------cut here---------------start------------->8--- #!/bin/sh #-*-Scheme-*- GUILE="$(command -v guile || command -v guile3.0)" if [ -z "$GUILE" ]; then echo "Missing guile executable." exit 1 fi exec $GUILE --no-auto-compile -e main -s "$0" "$@" !# --8<---------------cut here---------------end--------------->8--- Note the usage of `--no-auto-compile' which will prevent Guile from auto-compiling file, while still loading already compiled modules. [...] -- Olivier Dion oldiob.ca