unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* wrap-program –> wrap-script
@ 2019-12-11 15:57 Ricardo Wurmus
  2019-12-13 15:07 ` Maxim Cournoyer
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ricardo Wurmus @ 2019-12-11 15:57 UTC (permalink / raw)
  To: guix-devel

Hi Guix,

I’ve just pushed a change to use wrap-script in one package.  The
purpose of wrap-script is to wrap an executable without having to create
a separate wrapper shell script.  It does this by prepending a Guile
script to the top of the file, which sets the environment variables and
then re-executes itself with the target interpreter (e.g. Python).

I noticed two things:

1) wrap-script does not automatically pull in Guile as a dependency, so
if Guile isn’t among the inputs it will create a bad shebang.  This
should be fixed on core-updates.

2) we aren’t using wrap-script anywhere.  I think a good use case would
be the Python build system’s “wrap” phase where we currently use
wrap-program.  Most of the time we’d be dealing with Python scripts, so
using wrap-script would be more appropriate here.

What do you think?

--
Ricardo

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

* Re: wrap-program –> wrap-script
  2019-12-11 15:57 wrap-program –> wrap-script Ricardo Wurmus
@ 2019-12-13 15:07 ` Maxim Cournoyer
  2019-12-17 10:57 ` Efraim Flashner
  2019-12-19 16:19 ` Ludovic Courtès
  2 siblings, 0 replies; 5+ messages in thread
From: Maxim Cournoyer @ 2019-12-13 15:07 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Hello Ricardo,

Ricardo Wurmus <rekado@elephly.net> writes:

> Hi Guix,
>
> I’ve just pushed a change to use wrap-script in one package.  The
> purpose of wrap-script is to wrap an executable without having to create
> a separate wrapper shell script.  It does this by prepending a Guile
> script to the top of the file, which sets the environment variables and
> then re-executes itself with the target interpreter (e.g. Python).

That's smart!

> I noticed two things:
>
> 1) wrap-script does not automatically pull in Guile as a dependency, so
> if Guile isn’t among the inputs it will create a bad shebang.  This
> should be fixed on core-

Since as you mention below, the wrap-script isn't much used at all, I
guess the reason to make the change to core-updates rather than master
is because the host module of wrap-script (guix build utils) is used as
a whole when computing the hash of derivations?

> 2) we aren’t using wrap-script anywhere.  I think a good use case would
> be the Python build system’s “wrap” phase where we currently use
> wrap-program.  Most of the time we’d be dealing with Python scripts, so
> using wrap-script would be more appropriate here.
>
> What do you think?

Are you considering "testing" for the type of file (e.g., script?
binary?) before wrapping it?  Something else?

I like the idea in general.  IIUC this would remove the need to have
those ugly .real-script-name lying around.

Maxim

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

* Re: wrap-program –> wrap-script
  2019-12-11 15:57 wrap-program –> wrap-script Ricardo Wurmus
  2019-12-13 15:07 ` Maxim Cournoyer
@ 2019-12-17 10:57 ` Efraim Flashner
  2019-12-17 12:10   ` Ricardo Wurmus
  2019-12-19 16:19 ` Ludovic Courtès
  2 siblings, 1 reply; 5+ messages in thread
From: Efraim Flashner @ 2019-12-17 10:57 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

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

On Wed, Dec 11, 2019 at 04:57:41PM +0100, Ricardo Wurmus wrote:
> Hi Guix,
> 
> I’ve just pushed a change to use wrap-script in one package.  The
> purpose of wrap-script is to wrap an executable without having to create
> a separate wrapper shell script.  It does this by prepending a Guile
> script to the top of the file, which sets the environment variables and
> then re-executes itself with the target interpreter (e.g. Python).
> 
> I noticed two things:
> 
> 1) wrap-script does not automatically pull in Guile as a dependency, so
> if Guile isn’t among the inputs it will create a bad shebang.  This
> should be fixed on core-updates.

I thought the build systems had an implicit guile in them. Looks like I
had that exactly backwards.

> 
> 2) we aren’t using wrap-script anywhere.  I think a good use case would
> be the Python build system’s “wrap” phase where we currently use
> wrap-program.  Most of the time we’d be dealing with Python scripts, so
> using wrap-script would be more appropriate here.

It turns out we are using it in vpnc-scripts.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

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

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

* Re: wrap-program –> wrap-script
  2019-12-17 10:57 ` Efraim Flashner
@ 2019-12-17 12:10   ` Ricardo Wurmus
  0 siblings, 0 replies; 5+ messages in thread
From: Ricardo Wurmus @ 2019-12-17 12:10 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel


Efraim Flashner <efraim@flashner.co.il> writes:

> On Wed, Dec 11, 2019 at 04:57:41PM +0100, Ricardo Wurmus wrote:
[…]
>> I’ve just pushed a change to use wrap-script in one package. […]
>> 
>> 2) we aren’t using wrap-script anywhere.  I think a good use case would
>> be the Python build system’s “wrap” phase where we currently use
>> wrap-program.  Most of the time we’d be dealing with Python scripts, so
>> using wrap-script would be more appropriate here.
>
> It turns out we are using it in vpnc-scripts.

Yes, that’s where I added it right before writing my email.

-- 
Ricardo

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

* Re: wrap-program –> wrap-script
  2019-12-11 15:57 wrap-program –> wrap-script Ricardo Wurmus
  2019-12-13 15:07 ` Maxim Cournoyer
  2019-12-17 10:57 ` Efraim Flashner
@ 2019-12-19 16:19 ` Ludovic Courtès
  2 siblings, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2019-12-19 16:19 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Hello!

Ricardo Wurmus <rekado@elephly.net> skribis:

> I’ve just pushed a change to use wrap-script in one package.  The
> purpose of wrap-script is to wrap an executable without having to create
> a separate wrapper shell script.  It does this by prepending a Guile
> script to the top of the file, which sets the environment variables and
> then re-executes itself with the target interpreter (e.g. Python).

Neat!

> I noticed two things:
>
> 1) wrap-script does not automatically pull in Guile as a dependency, so
> if Guile isn’t among the inputs it will create a bad shebang.  This
> should be fixed on core-updates.

Or we could say that it’s not different from other shebangs: it’s up to
the packager to provide all the necessary dependencies.

> 2) we aren’t using wrap-script anywhere.  I think a good use case would
> be the Python build system’s “wrap” phase where we currently use
> wrap-program.  Most of the time we’d be dealing with Python scripts, so
> using wrap-script would be more appropriate here.

The would immediately reach hundreds of packages, so it’s a good idea!

Thanks,
Ludo’.

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

end of thread, other threads:[~2019-12-19 16:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-11 15:57 wrap-program –> wrap-script Ricardo Wurmus
2019-12-13 15:07 ` Maxim Cournoyer
2019-12-17 10:57 ` Efraim Flashner
2019-12-17 12:10   ` Ricardo Wurmus
2019-12-19 16:19 ` Ludovic Courtès

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