* bug#71495: Add command line flag to add to load path without evaluation
@ 2024-06-11 21:19 Richard Sent
2024-07-04 3:20 ` Richard Sent
0 siblings, 1 reply; 2+ messages in thread
From: Richard Sent @ 2024-06-11 21:19 UTC (permalink / raw)
To: 71495
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.
--8<---------------cut here---------------start------------->8---
# 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
--8<---------------cut here---------------end--------------->8---
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#71495: Add command line flag to add to load path without evaluation
2024-06-11 21:19 bug#71495: Add command line flag to add to load path without evaluation Richard Sent
@ 2024-07-04 3:20 ` Richard Sent
0 siblings, 0 replies; 2+ messages in thread
From: Richard Sent @ 2024-07-04 3:20 UTC (permalink / raw)
To: 71495
Richard Sent <richard@freakingpenguin.com> writes:
> 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-04 3:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-11 21:19 bug#71495: Add command line flag to add to load path without evaluation Richard Sent
2024-07-04 3:20 ` Richard Sent
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).