Hi Olivier, On mer., 17 août 2022 at 16:59, Olivier Dion via <help-guix@gnu.org> wrote:
> (define* (bundle-package package . rest) > > (define manifest (packages->manifest (list package))) > (define profile (profile (content manifest))) –^ –^ Well, I do not think the compiler likes that. From “guix repl”, it raises the message: ;;; <unknown-location>: warning: possibly unbound variable `content' and then ’bundle-package’ fails with: ice-9/boot-9.scm:1685:16: In procedure raise-exception: error: content: unbound variable > > (run-with-store (open-connection) > (mlet %store-monad ((drv (apply self-contained-tarbar –^ typo It is ’self-contained-tarball’ from (guix scripts pack), I guess. Otherwise, it does the same thing as “guix pack foo”. --8<---------------cut here---------------start------------->8--- scheme@(guix-user)> ,use(gnu packages base) scheme@(guix-user)> (bundle-package hello) $1 = "/gnu/store/riyxydg95yyczl6w4dv9j1rd9m1jbq1h-hello.tar.gz" scheme@(guix-user)> ,q $ guix pack hello /gnu/store/0s6z9w6giwjh80ks4f3hwbhb1g9nhh8c-hello-tarball-pack.tar.gz $ shasum \ /gnu/store/riyxydg95yyczl6w4dv9j1rd9m1jbq1h-hello.tar.gz \ /gnu/store/0s6z9w6giwjh80ks4f3hwbhb1g9nhh8c-hello-tarball-pack.tar.gz d326ee555dde564e357e3aa4d66a4497306fc12e /gnu/store/riyxydg95yyczl6w4dv9j1rd9m1jbq1h-hello.tar.gz d326ee555dde564e357e3aa4d66a4497306fc12e /gnu/store/0s6z9w6giwjh80ks4f3hwbhb1g9nhh8c-hello-tarball-pack.tar.gz --8<---------------cut here---------------end--------------->8--- And “guix package foo” can be done from the REPL using ’guix-pack’ from (guix scripts pack): --8<---------------cut here---------------start------------->8--- scheme@(guix-user)> ,use(guix scripts pack) scheme@(guix-user)> (guix-pack "hello") /gnu/store/0s6z9w6giwjh80ks4f3hwbhb1g9nhh8c-hello-tarball-pack.tar.gz $1 = #t --8<---------------cut here---------------end--------------->8--- Somehow, bundle-package is a simplified version without all the “options“. But hey, it is always cool to unwrap things and have a better control. :-) That’s why Guix is so cool! ;-) Cheers, simon