[Nix-dev] nix-build -A builds everything

2015-11-19 Thread Dieter Vekeman
Hi

I’m trying to create a nix package (for the odoo suite 
https://github.com/odoo/odoo/tree/8.0).

I checked out nixpkgs
created a folder in pkgs/applications/networking/odoo

This is what I have so far
# cat ./pkgs/applications/networking/odoo/default.nix
{ stdenv, fetchurl, buildPythonPackage, pythonPackages }:

buildPythonPackage {
  name = "odoo-8.0.0";
  namePrefix = "";

  src = fetchurl {
url = "https://github.com/odoo/odoo/archive/8.0.0.zip;;
sha256 = "dee5ca67cd314c389fe3fb924c1fc6ba84a913b60956bd0308344e9c0e0cb751";
  };

  propagatedBuildInputs = [ ];

  # Testing fails.
  doCheck = false;

  meta = {
description = "Odoo ERP / CRM business suite";
homepage = https://www.odoo.com;
license = stdenv.lib.licenses.agpl3;
  };
}

When I run
nix-build -A odoo

It seems to start building everything from source, is that normal?

I don’t know what kind of info is required but here are a few things
# nix-channel --list
nixpkgs https://nixos.org/channels/nixpkgs-unstable
nixos https://nixos.org/channels/nixos-14.12

# echo $NIX_PATH
/nix/var/nix/profiles/per-user/root/channels/nixos:nixpkgs=/etc/nixos/nixpkgs:nixos-config=/etc/nixos/configuration.nix

/etc/nixos/nixpkgs points to /src/nixpkgs where I have my clone of nixpkgs

# nix-build -A odoo
these derivations will be built:
  /nix/store/4f93r775pgxccqiw2y999bhz84irqdi5-xz-5.2.2.drv
…
  /nix/store/rpa6hx6wi0l40w6q21ia6g8nd655h2hr-gcc-4.9.3.drv
  /nix/store/a1618x2806slj88gyxc944v0xhc84j6f-gcc-wrapper-4.9.3.drv
  /nix/store/i811yml1yxa6grhhx1glld79fs7j5vc2-stdenv-linux-boot.drv
… etc.

Thanks!

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] nix-build -A builds everything

2015-11-19 Thread Guillaume Maudoux (Layus)
Hi,

The problem is that you build odoo within the nixpkgs defined by the
master branch.
As the master branch defines derivations more recent than the ones
installed, it needs to instantiate them.
But these derivations are so new that even hydra did not build them yet,
so you have no binary support for these.

To get binary support, you should develop on a branch based on the same
commit as you current channel.
See
https://nixos.org/wiki/Create_and_debug_nix_packages#Tracking_upstream_changes_and_avoiding_extra_rebuilding
for extra details and  step-by-step commands.

Does it answer your question or did I miss the point ?

Le 17/11/15 00:03, Dieter Vekeman a écrit :
> Hi
>
> I’m trying to create a nix package (for the odoo suite 
> https://github.com/odoo/odoo/tree/8.0).
>
> I checked out nixpkgs
> created a folder in pkgs/applications/networking/odoo
>
> This is what I have so far
> # cat ./pkgs/applications/networking/odoo/default.nix
> { stdenv, fetchurl, buildPythonPackage, pythonPackages }:
>
> buildPythonPackage {
>   name = "odoo-8.0.0";
>   namePrefix = "";
>
>   src = fetchurl {
> url = "https://github.com/odoo/odoo/archive/8.0.0.zip;;
> sha256 = 
> "dee5ca67cd314c389fe3fb924c1fc6ba84a913b60956bd0308344e9c0e0cb751";
>   };
>
>   propagatedBuildInputs = [ ];
>
>   # Testing fails.
>   doCheck = false;
>
>   meta = {
> description = "Odoo ERP / CRM business suite";
> homepage = https://www.odoo.com;
> license = stdenv.lib.licenses.agpl3;
>   };
> }
>
> When I run
> nix-build -A odoo
>
> It seems to start building everything from source, is that normal?
>
> I don’t know what kind of info is required but here are a few things
> # nix-channel --list
> nixpkgs https://nixos.org/channels/nixpkgs-unstable
> nixos https://nixos.org/channels/nixos-14.12
>
> # echo $NIX_PATH
> /nix/var/nix/profiles/per-user/root/channels/nixos:nixpkgs=/etc/nixos/nixpkgs:nixos-config=/etc/nixos/configuration.nix
>
> /etc/nixos/nixpkgs points to /src/nixpkgs where I have my clone of nixpkgs
>
> # nix-build -A odoo
> these derivations will be built:
>   /nix/store/4f93r775pgxccqiw2y999bhz84irqdi5-xz-5.2.2.drv
> …
>   /nix/store/rpa6hx6wi0l40w6q21ia6g8nd655h2hr-gcc-4.9.3.drv
>   /nix/store/a1618x2806slj88gyxc944v0xhc84j6f-gcc-wrapper-4.9.3.drv
>   /nix/store/i811yml1yxa6grhhx1glld79fs7j5vc2-stdenv-linux-boot.drv
> … etc.
>
> Thanks!
>
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] nix-build -A builds everything

2015-11-19 Thread Guillaume Maudoux (Layus)
Hi,

Neat trick.

Am I right however to say that this does not work if your own channel is
not up to date.
Nothing forces branch channels/nixos-unstable on
github.com/NixOS/nixpkgs-channels to point at the same revision as the
one in /nix/var/nix/profiles/per-user/root/channels/nixos/svn-revision.

As for me, I update my tag on the current channel revision after each
update, and branch/rebase on top of it.

I will update the wiki to reference the manual.

Le 19/11/15 15:50, Eelco Dolstra a écrit :
> Hi,
>
> On 19/11/15 11:46, Guillaume Maudoux (Layus) wrote:
>
>> To get binary support, you should develop on a branch based on the same
>> commit as you current channel.
>> See
>> https://nixos.org/wiki/Create_and_debug_nix_packages#Tracking_upstream_changes_and_avoiding_extra_rebuilding
>> for extra details and  step-by-step commands.
> There is an easier way than described on the wiki, namely by using the
> nixpkgs-channels repository, which contains branches corresponding to the
> current channel contents.
>
> For instance, to create a branch named "local" based on the latest
> nixos-unstable channel:
>
> $ git remote add channels git://github.com/NixOS/nixpkgs-channels.git
> $ git remote update channels
> $ git checkout -b local channels/nixos-unstable
>
> and to update it:
>
> $ git remote update channels
> $ git merge channels/nixos-unstable # or "git rebase"
>
> See http://nixos.org/nixos/manual/index.html#sec-getting-sources for more 
> info.
>

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] nix-build -A builds everything

2015-11-19 Thread Eelco Dolstra
Hi,

On 19/11/15 16:10, Guillaume Maudoux (Layus) wrote:

> Neat trick.
> 
> Am I right however to say that this does not work if your own channel is
> not up to date.

It does work (in that you always get binaries from the cache), but it might
download more stuff than if you match your current NixOS version (since in that
case you can expect some stuff to already be present in your Nix store).

-- 
Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] nix-build -A builds everything

2015-11-19 Thread Eelco Dolstra
Hi,

On 19/11/15 11:46, Guillaume Maudoux (Layus) wrote:

> To get binary support, you should develop on a branch based on the same
> commit as you current channel.
> See
> https://nixos.org/wiki/Create_and_debug_nix_packages#Tracking_upstream_changes_and_avoiding_extra_rebuilding
> for extra details and  step-by-step commands.

There is an easier way than described on the wiki, namely by using the
nixpkgs-channels repository, which contains branches corresponding to the
current channel contents.

For instance, to create a branch named "local" based on the latest
nixos-unstable channel:

$ git remote add channels git://github.com/NixOS/nixpkgs-channels.git
$ git remote update channels
$ git checkout -b local channels/nixos-unstable

and to update it:

$ git remote update channels
$ git merge channels/nixos-unstable # or "git rebase"

See http://nixos.org/nixos/manual/index.html#sec-getting-sources for more info.

-- 
Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev