unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: Hartmut Goebel <h.goebel@crazy-compilers.com>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: change to the wrap-program procedure (was: core-updates, let’s go!)
Date: Tue, 02 Jan 2018 20:01:53 +0100	[thread overview]
Message-ID: <877et05bku.fsf@elephly.net> (raw)
In-Reply-To: <138af4ac-f1de-168f-c3a8-284769a32396@crazy-compilers.com>


Hi Hartmut,

> Am 31.12.2017 um 18:27 schrieb Ricardo Wurmus:
>> There’s also a change to the wrap-program procedure that does without
>> the shell wrappers and instead prepends a short Guile program, which is
>> read as a comment in the target language.  It’s better to play with this
>> in the next core-updates cycle.
>
> I assume, this is what we discussed in
> <https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00041.html>.
>
> I just wonder whether this will keep the encoding-lines in place, like
> these:
>
> #!/usr/bin/python
> # -*- coding: latin-1 -*-
> from __future__ import print_function

In the current implementation that I have here it would not.

According to the documentation[1], the regular expression
“coding[=:]\s*([-\w.]+)” must match for a comment on the second line of
a script, so I’d think that the following would still be valid:

--8<---------------cut here---------------start------------->8---
#!/gnu/store/…/bin/guile --no-auto-compile
#!#; -*- coding: latin-1 -*-
#\-(setenv …)
#\-(apply execl …)
#!/gnu/store/…/bin/python3
# -*- coding: latin-1 -*-
…
--8<---------------cut here---------------end--------------->8---

All we need to do is read the second line of the script and see if it is
a coding comment; in that case we’d place the content on the second
line.  I’ll add a special case for this and a test case.  Thanks for
bringing it up!

[1]: https://docs.python.org/3/reference/lexical_analysis.html#encoding-declarations

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

  reply	other threads:[~2018-01-02 19:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-31 10:27 core-updates, let’s go! Ludovic Courtès
2017-12-31 10:32 ` Efraim Flashner
2017-12-31 11:14   ` Danny Milosavljevic
2017-12-31 12:20     ` Danny Milosavljevic
2017-12-31 15:07     ` Marius Bakke
2017-12-31 17:27       ` Ricardo Wurmus
2018-01-02 18:12         ` change to the wrap-program procedure (was: core-updates, let’s go!) Hartmut Goebel
2018-01-02 19:01           ` Ricardo Wurmus [this message]
2018-01-02 19:19             ` change to the wrap-program procedure Hartmut Goebel
2018-01-02 20:47               ` Ricardo Wurmus
2017-12-31 14:44 ` core-updates, let’s go! Marius Bakke
2018-01-01 17:12   ` Ludovic Courtès
2018-01-01 19:08     ` Efraim Flashner
2018-01-03 18:35     ` Leo Famulari
2018-01-03 20:06       ` Leo Famulari
2018-01-03 19:34     ` Leo Famulari
2018-01-18  3:50     ` Leo Famulari
2018-01-20  0:51       ` core-updates: SELinux Leo Famulari
2018-01-28 12:32         ` Ricardo Wurmus
2018-01-20 20:57       ` core-updates, let’s go! Kei Kebreau

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://guix.gnu.org/

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

  git send-email \
    --in-reply-to=877et05bku.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=guix-devel@gnu.org \
    --cc=h.goebel@crazy-compilers.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.
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).