unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Building from a local source code checkout
@ 2017-12-19 11:34 Konrad Hinsen
  2017-12-19 17:15 ` Ludovic Courtès
  0 siblings, 1 reply; 13+ messages in thread
From: Konrad Hinsen @ 2017-12-19 11:34 UTC (permalink / raw)
  To: guix-devel

Hi everyone,

For debugging package definitions, it would be really nice to be able to 
build a package from a checkout of the original project source code, 
rather than having to make a tarball for each modification of that 
source code. Is this possible somehow? The manual suggests that a 
package source could be something else than an origin object, such as a 
local-file, but I cannot get even local-file to work.

Konrad

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

* Re: Building from a local source code checkout
  2017-12-19 11:34 Building from a local source code checkout Konrad Hinsen
@ 2017-12-19 17:15 ` Ludovic Courtès
  2017-12-20  8:52   ` Konrad Hinsen
  0 siblings, 1 reply; 13+ messages in thread
From: Ludovic Courtès @ 2017-12-19 17:15 UTC (permalink / raw)
  To: Konrad Hinsen; +Cc: guix-devel

Hello,

Konrad Hinsen <konrad.hinsen@fastmail.net> skribis:

> For debugging package definitions, it would be really nice to be able
> to build a package from a checkout of the original project source
> code, rather than having to make a tarball for each modification of
> that source code. Is this possible somehow?

You should be able to use “guix build foo --with-source=./foo” (note
that the directory name must match the package name).

  https://www.gnu.org/software/guix/manual/html_node/Package-Transformation-Options.html

> The manual suggests that a package source could be something else than
> an origin object, such as a local-file, but I cannot get even
> local-file to work.

It should work (you must import (guix gexp) to get ‘local-file’).

Can you share what errors you got?

HTH,
Ludo’.

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

* Re: Building from a local source code checkout
  2017-12-19 17:15 ` Ludovic Courtès
@ 2017-12-20  8:52   ` Konrad Hinsen
  2017-12-20 10:19     ` Konrad Hinsen
  0 siblings, 1 reply; 13+ messages in thread
From: Konrad Hinsen @ 2017-12-20  8:52 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Hi Ludo,

>> For debugging package definitions, it would be really nice to be able
>> to build a package from a checkout of the original project source
>> code, rather than having to make a tarball for each modification of
>> that source code. Is this possible somehow?
>
> You should be able to use “guix build foo --with-source=./foo” (note
> that the directory name must match the package name).
>
>   https://www.gnu.org/software/guix/manual/html_node/Package-Transformation-Options.html

The name matching condition is my problem with this approach, which is
why I was looking for a way to do specify a local source in the package
definition itself.

I am working in the Python universe where package names almost never
match the name of the checkout directory because of the python- prefix.
Moreover, I want to build both python- and python2- packages from my
checkout.

>> The manual suggests that a package source could be something else than
>> an origin object, such as a local-file, but I cannot get even
>> local-file to work.
>
> It should work (you must import (guix gexp) to get ‘local-file’).
>
> Can you share what errors you got?

None - once I import (guix gexp)  ;-)

Thanks,
  Konrad.

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

* Re: Building from a local source code checkout
  2017-12-20  8:52   ` Konrad Hinsen
@ 2017-12-20 10:19     ` Konrad Hinsen
  2017-12-20 12:41       ` Carlo Zancanaro
  0 siblings, 1 reply; 13+ messages in thread
From: Konrad Hinsen @ 2017-12-20 10:19 UTC (permalink / raw)
  To: guix-devel

On 20/12/2017 09:52, Konrad Hinsen wrote:

> The name matching condition is my problem with this approach, which is
> why I was looking for a way to do specify a local source in the package
> definition itself.

I just had the obvious idea of using symlinks to work around the name 
matching issues, but that idea turned out not to work:

 > guix build python-activepapers 
--with-source=~/Development/python-activepaper
guix build: error: lstat: No such file or directory: 
"~/Development/python-activepapers"

Let's try to be clever and add a slash:

 > guix build python-activepapers 
--with-source=~/Development/python-activepapers/
guix build: warning: transformation 'with-source' had no effect on 
python-activepapers-0.2.2

Maybe it wants a version number in the source specification? One more 
symlink, and another try:

 > guix build python-activepapers 
--with-source=~/Development/python-activepapers-0.2.3/
guix build: error: lstat: No such file or directory: 
"~/Development/python-activepapers-0.2.3/"

Is there a good reason for symlinks not working, or is it just "to be 
done"? In the latter case, I'd be happy to work on that.

Konrad.

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

* Re: Building from a local source code checkout
  2017-12-20 10:19     ` Konrad Hinsen
@ 2017-12-20 12:41       ` Carlo Zancanaro
  2017-12-21  6:38         ` Konrad Hinsen
  0 siblings, 1 reply; 13+ messages in thread
From: Carlo Zancanaro @ 2017-12-20 12:41 UTC (permalink / raw)
  To: Konrad Hinsen; +Cc: guix-devel



On 20 December 2017 9:19:00 pm AEDT, Konrad Hinsen <konrad.hinsen@fastmail.net> wrote:
> > guix build python-activepapers 
>--with-source=~/Development/python-activepaper
>guix build: error: lstat: No such file or directory: 
>"~/Development/python-activepapers"

I found earlier today that the tilde wasn't expanded in guix package --manifest. Maybe it's the same for --with-source. Try putting your home directory in as an absolute path.

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

* Re: Building from a local source code checkout
  2017-12-20 12:41       ` Carlo Zancanaro
@ 2017-12-21  6:38         ` Konrad Hinsen
  2017-12-21 10:38           ` Pjotr Prins
  2017-12-21 11:20           ` Martin Castillo
  0 siblings, 2 replies; 13+ messages in thread
From: Konrad Hinsen @ 2017-12-21  6:38 UTC (permalink / raw)
  To: Carlo Zancanaro; +Cc: guix-devel

Hi Carlo,

> On 20 December 2017 9:19:00 pm AEDT, Konrad Hinsen <konrad.hinsen@fastmail.net> wrote:
>> > guix build python-activepapers 
>>--with-source=~/Development/python-activepaper
>>guix build: error: lstat: No such file or directory: 
>>"~/Development/python-activepapers"
>
> I found earlier today that the tilde wasn't expanded in guix package
> --manifest. Maybe it's the same for --with-source. Try putting your
> home directory in as an absolute path.

Oops, you are right! So

   guix build python-activepapers --with-source=$HOME/Development/python-activepapers/

actually works, but

   guix build python-activepapers --with-source=$HOME/Development/python-activepapers

(without the terminating slash) doesn't:

  guix build: error: guix/scripts/build.scm:155:6: package
  `python-activepapers-0.2.2' has an invalid input: ("source"
  "/gnu/store/bbi86dn5nq6f79lhvs7ghzisjahjaq5p-python-activepapers")

Perhaps I should stop trying to understand computers ;-)

Thanks,
  Konrad.

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

* Re: Building from a local source code checkout
  2017-12-21  6:38         ` Konrad Hinsen
@ 2017-12-21 10:38           ` Pjotr Prins
  2017-12-21 11:20           ` Martin Castillo
  1 sibling, 0 replies; 13+ messages in thread
From: Pjotr Prins @ 2017-12-21 10:38 UTC (permalink / raw)
  To: Konrad Hinsen; +Cc: guix-devel

On Thu, Dec 21, 2017 at 07:38:53AM +0100, Konrad Hinsen wrote:
> Perhaps I should stop trying to understand computers ;-)

We are waiting for AI to start programming ;)

Pj.
-- 

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

* Re: Building from a local source code checkout
  2017-12-21  6:38         ` Konrad Hinsen
  2017-12-21 10:38           ` Pjotr Prins
@ 2017-12-21 11:20           ` Martin Castillo
  2017-12-21 14:38             ` Ludovic Courtès
  1 sibling, 1 reply; 13+ messages in thread
From: Martin Castillo @ 2017-12-21 11:20 UTC (permalink / raw)
  To: Konrad Hinsen; +Cc: guix-devel

Hi,


> Oops, you are right! So
> 
>    guix build python-activepapers --with-source=$HOME/Development/python-activepapers/
> 
> actually works, but
> 
>    guix build python-activepapers --with-source=$HOME/Development/python-activepapers
> 
As one error message earlier in the thread stated, guix uses lstat to
get info about the stated file. lstat doesn't follow symlinks. You force
the dereference by appending the slash.

Martin
-- 
GPG: 7FDE 7190 2F73 2C50 236E  403D CC13 48F1 E644 08EC

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

* Re: Building from a local source code checkout
  2017-12-21 11:20           ` Martin Castillo
@ 2017-12-21 14:38             ` Ludovic Courtès
  2017-12-21 16:53               ` Martin Castillo
  2017-12-21 17:02               ` Konrad Hinsen
  0 siblings, 2 replies; 13+ messages in thread
From: Ludovic Courtès @ 2017-12-21 14:38 UTC (permalink / raw)
  To: Martin Castillo; +Cc: guix-devel

Hi,

Martin Castillo <castilma@uni-bremen.de> skribis:

>> Oops, you are right! So
>> 
>>    guix build python-activepapers --with-source=$HOME/Development/python-activepapers/
>> 
>> actually works, but
>> 
>>    guix build python-activepapers --with-source=$HOME/Development/python-activepapers
>> 
> As one error message earlier in the thread stated, guix uses lstat to
> get info about the stated file. lstat doesn't follow symlinks. You force
> the dereference by appending the slash.

Indeed.

I agree the matching-name constraint can be annoying.  The alternative
would be allow the user to (optionally?) specify the name of the package
whose source is being changed, as in:

  guix build python-activepapers \
    --with-source=python-activepapers=$HOME/Dev/AP

WDYT?

A bit heavyweight syntactically but maybe we have to live with it.

Ludo’.

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

* Re: Building from a local source code checkout
  2017-12-21 14:38             ` Ludovic Courtès
@ 2017-12-21 16:53               ` Martin Castillo
  2017-12-22  9:29                 ` Ludovic Courtès
  2017-12-21 17:02               ` Konrad Hinsen
  1 sibling, 1 reply; 13+ messages in thread
From: Martin Castillo @ 2017-12-21 16:53 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

> I agree the matching-name constraint can be annoying.  The alternative
> would be allow the user to (optionally?) specify the name of the package
> whose source is being changed, as in:
> 
>   guix build python-activepapers \
>     --with-source=python-activepapers=$HOME/Dev/AP
> 
> WDYT?
> 
> A bit heavyweight syntactically but maybe we have to live with it.
> 
> Ludo’.
> 

Why can't guix use the argument package name argument?
                 v-- this one
guix build python-activepapers --with-source=$HOME/Dev/AP

Martin
-- 
GPG: 7FDE 7190 2F73 2C50 236E  403D CC13 48F1 E644 08EC

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

* Re: Building from a local source code checkout
  2017-12-21 14:38             ` Ludovic Courtès
  2017-12-21 16:53               ` Martin Castillo
@ 2017-12-21 17:02               ` Konrad Hinsen
  2017-12-22 23:07                 ` Ludovic Courtès
  1 sibling, 1 reply; 13+ messages in thread
From: Konrad Hinsen @ 2017-12-21 17:02 UTC (permalink / raw)
  To: Ludovic Courtès, Martin Castillo; +Cc: guix-devel

ludo@gnu.org (Ludovic Courtès) writes:

> I agree the matching-name constraint can be annoying.  The alternative
> would be allow the user to (optionally?) specify the name of the package
> whose source is being changed, as in:
>
>   guix build python-activepapers \
>     --with-source=python-activepapers=$HOME/Dev/AP
>
> WDYT?

Looks much clearer to me. But, as you say, this could well be optional
if we can live with an ambiguity in the rare case of filenames containg
an equal sign.

Konrad.

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

* Re: Building from a local source code checkout
  2017-12-21 16:53               ` Martin Castillo
@ 2017-12-22  9:29                 ` Ludovic Courtès
  0 siblings, 0 replies; 13+ messages in thread
From: Ludovic Courtès @ 2017-12-22  9:29 UTC (permalink / raw)
  To: Martin Castillo; +Cc: guix-devel

Martin Castillo <castilma@uni-bremen.de> skribis:

> Why can't guix use the argument package name argument?
>                  v-- this one
> guix build python-activepapers --with-source=$HOME/Dev/AP

Because there can be several packages passes as arguments to ‘guix
build’.

Now it would make sense to DTRT when there’s just one package on the
command line.

Ludo’.

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

* Re: Building from a local source code checkout
  2017-12-21 17:02               ` Konrad Hinsen
@ 2017-12-22 23:07                 ` Ludovic Courtès
  0 siblings, 0 replies; 13+ messages in thread
From: Ludovic Courtès @ 2017-12-22 23:07 UTC (permalink / raw)
  To: Konrad Hinsen; +Cc: guix-devel

Konrad Hinsen <konrad.hinsen@fastmail.net> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>> I agree the matching-name constraint can be annoying.  The alternative
>> would be allow the user to (optionally?) specify the name of the package
>> whose source is being changed, as in:
>>
>>   guix build python-activepapers \
>>     --with-source=python-activepapers=$HOME/Dev/AP
>>
>> WDYT?
>
> Looks much clearer to me. But, as you say, this could well be optional
> if we can live with an ambiguity in the rare case of filenames containg
> an equal sign.

I’ve implemented it here:

  https://git.savannah.gnu.org/cgit/guix.git/commit/?id=3e30cdf1c35ebeb52630ec19b3b43b9e6d5ffb81

You no longer need to rename your source directory.  :-)

Ludo’.

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

end of thread, other threads:[~2017-12-22 23:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-19 11:34 Building from a local source code checkout Konrad Hinsen
2017-12-19 17:15 ` Ludovic Courtès
2017-12-20  8:52   ` Konrad Hinsen
2017-12-20 10:19     ` Konrad Hinsen
2017-12-20 12:41       ` Carlo Zancanaro
2017-12-21  6:38         ` Konrad Hinsen
2017-12-21 10:38           ` Pjotr Prins
2017-12-21 11:20           ` Martin Castillo
2017-12-21 14:38             ` Ludovic Courtès
2017-12-21 16:53               ` Martin Castillo
2017-12-22  9:29                 ` Ludovic Courtès
2017-12-21 17:02               ` Konrad Hinsen
2017-12-22 23:07                 ` Ludovic Courtès

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