unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#31956: guix environment: add option to download and unpack source
@ 2018-06-24 19:06 Vagrant Cascadian
  2018-06-24 19:20 ` Björn Höfling
  2018-06-24 19:27 ` Danny Milosavljevic
  0 siblings, 2 replies; 4+ messages in thread
From: Vagrant Cascadian @ 2018-06-24 19:06 UTC (permalink / raw)
  To: 31956

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

I've a minor feature request.

When working on new package definitions, it's often useful to debug
build failures with guix environment.

The current implementation, as I understand it, requires manually
downloading the source, and merely drops you into whatever working
directory you happen to be it.

It would be great if there were an option you could pass that downloads
and unpacks the source somewhere and drops you into the newly unpacked
source directory.

Not sure what to call it exactly, but something like:

  guix environment --with-source hello

Should drop you into an unpacked source directory with the inputs and
such for building "hello".


live well,
  vagrant

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

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

* bug#31956: guix environment: add option to download and unpack source
  2018-06-24 19:06 bug#31956: guix environment: add option to download and unpack source Vagrant Cascadian
@ 2018-06-24 19:20 ` Björn Höfling
  2018-06-24 19:27 ` Danny Milosavljevic
  1 sibling, 0 replies; 4+ messages in thread
From: Björn Höfling @ 2018-06-24 19:20 UTC (permalink / raw)
  To: Vagrant Cascadian; +Cc: 31956

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

On Sun, 24 Jun 2018 12:06:17 -0700
Vagrant Cascadian <vagrant@debian.org> wrote:

> I've a minor feature request.
> 
> When working on new package definitions, it's often useful to debug
> build failures with guix environment.
> 
> The current implementation, as I understand it, requires manually
> downloading the source, and merely drops you into whatever working
> directory you happen to be it.
> 
> It would be great if there were an option you could pass that
> downloads and unpacks the source somewhere and drops you into the
> newly unpacked source directory.
> 
> Not sure what to call it exactly, but something like:
> 
>   guix environment --with-source hello
> 
> Should drop you into an unpacked source directory with the inputs and
> such for building "hello".

Hi Vagrant,

if you need this in the case of build failures, use the "-K" option:

https://www.gnu.org/software/guix/manual/guix.html#Common-Build-Options

--keep-failed
-K

    Keep the build tree of failed builds. Thus, if a build fails, its
build tree is kept under /tmp, in a directory whose name is shown at
the end of the build log. This is useful when debugging build issues.
See Debugging Build Failures, for tips and tricks on how to debug build
issues.


See also

https://www.gnu.org/software/guix/manual/guix.html#Debugging-Build-Failures

For the case that the built went through OK, there is no such option.
You could raise an exception at the end of your package
definition/build phases.

Also there is the -S option to build:

guix build -S <package-name>

builds the source of your package. This will download the package,
verifies the checkum applies patches and applies snippets (i.e. rules
to remove for example binaries or other non-free-licensed parts).

Björn


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

* bug#31956: guix environment: add option to download and unpack source
  2018-06-24 19:06 bug#31956: guix environment: add option to download and unpack source Vagrant Cascadian
  2018-06-24 19:20 ` Björn Höfling
@ 2018-06-24 19:27 ` Danny Milosavljevic
  2018-06-24 20:50   ` Jan Nieuwenhuizen
  1 sibling, 1 reply; 4+ messages in thread
From: Danny Milosavljevic @ 2018-06-24 19:27 UTC (permalink / raw)
  To: Vagrant Cascadian; +Cc: 31956

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

Hi Vagrant,

On Sun, 24 Jun 2018 12:06:17 -0700
Vagrant Cascadian <vagrant@debian.org> wrote:

> It would be great if there were an option you could pass that downloads
> and unpacks the source somewhere and drops you into the newly unpacked
> source directory.
> 
> Not sure what to call it exactly, but something like:
> 
>   guix environment --with-source hello

+1

Right now, my silly workaround is to add a phase which fails

  (add-after 'unpack 'fail
    (lambda _
      (error "stop it")))

and then do

  guix build --keep-failed hello

and then do

  guix environment --pure hello
  cd /tmp/guix-build-hello*

That's... very manual.

Also, if the directory in /tmp is not .drv-0, the environment is technically not the same as it was inside the guix-daemon build container.

In that case there'd be an extra step

  rm -rf /tmp/guix-build-hello-*.drv-0
  ln -s /tmp/guix-build-hello-* /tmp/guix-build-hello-<...>.drv-0
  cd /tmp/guix-build-hello-<...>.drv-0

All in all that's not simple.

Also, guix-daemon is taken from Nix and thus not exactly the same as
guix environment in some cases.

That's why in some cases I have to (edit the package definition and
invoke guix build) over and over again in order to find a problem.

In the long term we'll replace guix-daemon by guix environment.
Much easier to reproduce situations then.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* bug#31956: guix environment: add option to download and unpack source
  2018-06-24 19:27 ` Danny Milosavljevic
@ 2018-06-24 20:50   ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Nieuwenhuizen @ 2018-06-24 20:50 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: Vagrant Cascadian, 31956

Danny Milosavljevic writes:

>> Not sure what to call it exactly, but something like:
>> 
>>   guix environment --with-source hello
>
> +1
>
> Right now, my silly workaround is to add a phase which fails
>
>   (add-after 'unpack 'fail
>     (lambda _
>       (error "stop it")))
>
> and then do
>
>   guix build --keep-failed hello
>
> and then do
>
>   guix environment --pure hello
>   cd /tmp/guix-build-hello*
>
> That's... very manual.

A very nice recipe...interesting we had a discussion about this today on
#guix.  What I would really like, is for the --with-source directory
be a git archive, so that edits can be made and tested until it works.

Attempt a rebuild with new patches/new git commit and repeat.

Making repeated patches until a build succeeds is something I find
pretty cumbersome.

It could be an ad-hoc, new git archive.  It would also be nice if Guix
could somehow record upstream sources as (shallow?, tarred?) git
archives.

janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

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

end of thread, other threads:[~2018-06-24 20:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-24 19:06 bug#31956: guix environment: add option to download and unpack source Vagrant Cascadian
2018-06-24 19:20 ` Björn Höfling
2018-06-24 19:27 ` Danny Milosavljevic
2018-06-24 20:50   ` Jan Nieuwenhuizen

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