Add command line flag to add to load path without evaluation

  • Open
  • quality assurance status badge
Details
One participant
  • Richard Sent
Owner
unassigned
Submitted by
Richard Sent
Severity
normal
R
R
Richard Sent wrote on 11 Jun 23:19 +0200
(address . bug-guix@gnu.org)
87a5jrxjmt.fsf@freakingpenguin.com
Hi Guix!

In Guile, -L is a equivalent shorthand for adding to the %load-path
variable. No actual files are evaluated. In Guix, -L actually evaluates
files (at least in some capacity) to look for package definitions,
allowing for uses like $ guix -L . <some_local_package>.

This has a performance impact as channels grow, so it would be nice if
there was an alternative command line flag that matched Guile's
behavior.

To showcase the issue, here's three examples of "building" an
already-built home environment. I would use $ guix repl instead, but -L
in guix repl seems to match Guile's behavior, not Guix's.

Toggle snippet (25 lines)
# Baseline, no load path additions
gibraltar :) rsent$ bash -c 'time guix home build rsent/home/minimal.scm'
/gnu/store/5m062lg4f32j9hlirfkcp5141px6sgkv-home

real 0m9.776s
user 0m22.981s
sys 0m0.233s

# GUILE_LOAD_PATH, within margin of error of baseline
gibraltar :) rsent$ GUILE_LOAD_PATH=. bash -c 'time guix home build rsent/home/minimal.scm'
/gnu/store/5m062lg4f32j9hlirfkcp5141px6sgkv-home

real 0m10.016s
user 0m23.064s
sys 0m0.186s

# -L ., consistently ~25% longer to complete
gibraltar :) rsent$ bash -c 'time guix home build -L . rsent/home/minimal.scm'
/gnu/store/5m062lg4f32j9hlirfkcp5141px6sgkv-home

real 0m12.791s
user 0m29.569s
sys 0m0.247s

At present one can set GUILE_LOAD_PATH manually to work around this
issue. In my opinion this isn't very discoverable. Furthermore, it can't
_cleanly_ handle cases when GUILE_LOAD_PATH is already set or needs
multiple entries. It also makes certain commands with bash builtins
(like time...) awkward since you have to enter a subshell.

--
Take it easy,
Richard Sent
Making my computer weirder one commit at a time.
R
R
Richard Sent wrote on 4 Jul 05:20 +0200
(address . 71495@debbugs.gnu.org)
87tth5hmgx.fsf@freakingpenguin.com
Richard Sent <richard@freakingpenguin.com> writes:

Toggle quote (6 lines)
> At present one can set GUILE_LOAD_PATH manually to work around this
> issue. In my opinion this isn't very discoverable. Furthermore, it can't
> _cleanly_ handle cases when GUILE_LOAD_PATH is already set or needs
> multiple entries. It also makes certain commands with bash builtins
> (like time...) awkward since you have to enter a subshell.

I noticed that when using ./pre-inst-env, augmenting GUILE_LOAD_PATH
manually isn't trivial. I'm not quite sure how to describe the failures,
but they seem manifold.

--
Take it easy,
Richard Sent
Making my computer weirder one commit at a time.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 71495@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 71495
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch