mbox series

[bug#50960,v2,00/11] 'guix shell' strikes again

Message ID 20211011213809.17482-1-ludo@gnu.org
Headers show
Series 'guix shell' strikes again | expand

Message

Ludovic Courtès Oct. 11, 2021, 9:37 p.m. UTC
Hello Guix!

Here’s a v2 with the following changes:

  • ‘guix.scm’ and ‘manifest.scm’ only loaded in interactive mode,
    as suggested by Konrad.

  • Auto-loading happens if and only if the containing directory
    is listed in ~/.config/guix/shell-authorized-directories, as
    suggested by Florian.  When a file is found but not authorized,
    a hint is displayed explaining what to do.

  • ‘-q’ inhibits auto-loading.

  • Auto-detection of ‘guix.scm’ and ‘manifest.scm’ uses lexical
    “..” resolution and does not cross device boundaries.

  • Long version of ‘-f’ is now ‘--file’, like for ‘guix build’.

  • Caching also works with files explicitly specified with ‘-m’
    or ‘-f’.  That way, ‘guix shell -f guix.scm -- make’ benefits
    from it.

  • Cache key does not include file name, to avoid cache misses
    given that the file name is not canonicalized (see discussion
    with Maxime).

  • Documentation, including a tentative EOL date for ‘guix
    environment’ (“supported until at least May 1st, 2023”).  The
    intention is to give an incentive to switch while reassuring
    that it won’t disappear overnight.

How does that sound?  :-)

Ludo’.

Ludovic Courtès (11):
  packages: Add 'package-development-inputs'.
  profiles: Add 'package->development-manifest'.
  Add 'guix shell'.
  DRAFT shell: By default load the local 'guix.scm' or 'manifest.scm'
    file.
  DRAFT shell: Honor in ~/.config/guix/shell-authorized-directories.
  environment: Add tests for '--profile'.
  environment: Skip derivation computation when '--profile' is used.
  environment: Do not connect to the daemon when '--profile' is used.
  environment: Autoload some modules.
  cache: Gracefully handle non-existent cache.
  shell: Maintain a profile cache.

 Makefile.am                         |   2 +
 doc/contributing.texi               |   8 +-
 doc/guix.texi                       | 443 ++++++++++++++++++++++++++--
 guix/cache.scm                      |  10 +-
 guix/packages.scm                   |  10 +
 guix/profiles.scm                   |  19 ++
 guix/scripts/environment.scm        | 260 ++++++++--------
 guix/scripts/shell.scm              | 355 ++++++++++++++++++++++
 po/guix/POTFILES.in                 |   1 +
 tests/guix-environment-container.sh |   8 +
 tests/guix-environment.sh           |   7 +
 tests/guix-shell.sh                 | 100 +++++++
 tests/packages.scm                  |  14 +
 tests/profiles.scm                  |   7 +
 14 files changed, 1098 insertions(+), 146 deletions(-)
 create mode 100644 guix/scripts/shell.scm
 create mode 100644 tests/guix-shell.sh

Comments

pelzflorian (Florian Pelz) Oct. 12, 2021, 8:53 a.m. UTC | #1
On Mon, Oct 11, 2021 at 11:37:58PM +0200, Ludovic Courtès wrote:
> Hello Guix!
> 
> Here’s a v2 with the following changes:

Nice!

>   • Auto-loading happens if and only if the containing directory
>     is listed in ~/.config/guix/shell-authorized-directories, as
>     suggested by Florian.

Liliana Marie Prikler suggested it
<https://lists.gnu.org/r/guix-patches/2021-10/msg00380.html>.

>   […]
> How does that sound?  :-)

Much better, thank you!

Regards,
Florian
pelzflorian (Florian Pelz) Oct. 12, 2021, 8:57 a.m. UTC | #2
On Tue, Oct 12, 2021 at 10:53:55AM +0200, pelzflorian (Florian Pelz) wrote:
> On Mon, Oct 11, 2021 at 11:37:58PM +0200, Ludovic Courtès wrote:
> >   • Auto-loading happens if and only if the containing directory
> >     is listed in ~/.config/guix/shell-authorized-directories, as
> >     suggested by Florian.
> 
> Liliana Marie Prikler suggested it
> <https://lists.gnu.org/r/guix-patches/2021-10/msg00380.html>.

Or was it Nicoló Balzarotti?

https://lists.gnu.org/r/guix-patches/2021-10/msg00196.html

Enough confusion.

Regards,
Florian
Ludovic Courtès Oct. 12, 2021, 9:55 a.m. UTC | #3
"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

> On Tue, Oct 12, 2021 at 10:53:55AM +0200, pelzflorian (Florian Pelz) wrote:
>> On Mon, Oct 11, 2021 at 11:37:58PM +0200, Ludovic Courtès wrote:
>> >   • Auto-loading happens if and only if the containing directory
>> >     is listed in ~/.config/guix/shell-authorized-directories, as
>> >     suggested by Florian.
>> 
>> Liliana Marie Prikler suggested it
>> <https://lists.gnu.org/r/guix-patches/2021-10/msg00380.html>.
>
> Or was it Nicoló Balzarotti?
>
> https://lists.gnu.org/r/guix-patches/2021-10/msg00196.html

My bad, sorry for misattributing it.

Anyhow: big thanks to all of you for providing feedback!  :-)

Ludo’.
Ludovic Courtès Oct. 18, 2021, 7:52 p.m. UTC | #4
Hi!

This is v3 of the ‘guix shell’ patch set.  Changes since v2:

  • Merged as a single commit the one that adds support for implicit
    ‘guix.scm’/‘manifest.scm’ and then one that adds authorization
    checks;

  • Fixed ‘package-development-inputs’ bug/typo reported by zimoun;

  • Fixed doc typos reported by Florian.

If there are no objections, I’ll go ahead with this patch series
in a few days.  I’ll also add a news entry, and I guess a blog post
introducing it would be welcome.

WDYT?

Ludo’.

Ludovic Courtès (10):
  packages: Add 'package-development-inputs'.
  profiles: Add 'package->development-manifest'.
  Add 'guix shell'.
  shell: By default load the local 'guix.scm' or 'manifest.scm' file.
  environment: Add tests for '--profile'.
  environment: Skip derivation computation when '--profile' is used.
  environment: Do not connect to the daemon when '--profile' is used.
  environment: Autoload some modules.
  cache: Gracefully handle non-existent cache.
  shell: Maintain a profile cache.

 Makefile.am                         |   2 +
 doc/contributing.texi               |   8 +-
 doc/guix.texi                       | 443 ++++++++++++++++++++++++++--
 guix/cache.scm                      |  10 +-
 guix/packages.scm                   |  10 +
 guix/profiles.scm                   |  19 ++
 guix/scripts/environment.scm        | 260 ++++++++--------
 guix/scripts/shell.scm              | 355 ++++++++++++++++++++++
 po/guix/POTFILES.in                 |   1 +
 tests/guix-environment-container.sh |   8 +
 tests/guix-environment.sh           |   7 +
 tests/guix-shell.sh                 | 100 +++++++
 tests/packages.scm                  |  14 +
 tests/profiles.scm                  |   7 +
 14 files changed, 1098 insertions(+), 146 deletions(-)
 create mode 100644 guix/scripts/shell.scm
 create mode 100644 tests/guix-shell.sh


base-commit: 9cda21cf20a5c9bdf97e3a6d6c8f901fc3e4307d