Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flake support #8

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

dguibert
Copy link
Contributor

This introduces flake support to nixpack:
It exposes lib.packs and the spack packages behind pkgs attribute (bootstrapped with the default gcc compiler from nixpkgs).

nix build .#pkgs.mpileaks --impure --option sandbox false -L

As SPACK need to be patched, it is imported from flatironinstitute fork.
As nixpkgs need also to be patched [1], it is imported from my fork.

[1] NixOS/nixpkgs#144747

@dylex dylex mentioned this pull request Jan 10, 2022
@Qubasa
Copy link

Qubasa commented Jan 13, 2022

@dguibert Fails to build with nix build .#pkgs.mpileaks --impure --option sandbox false -L

$ nix-info
system: "x86_64-linux", multi-user?: yes, version: nix-env (Nix) 2.4, channels(mjnam): "", channels(harshanavkis): "home-manager-21.05", channels(root): "nix-ld, nixos-21.05.4448.4a8751d694b", nixpkgs: /nix/store/8hd2049cr4dz9myjcjjh6cjjapz1p107-source
Compiling Perl properties
Creating Perl synonyms
Writing tables
Making pod file
Making test script
Updating 'mktables.lst'
Traceback (most recent call last):
  File "/nix/store/vrr9dqpjss3mj1s8v8dkcpzv4111365j-builder.py", line 72, in <module>
    spack.installer.build_process(pkg, opts)
  File "/nix/store/k9lidw4pckdqls2yky5yrhnrah7klymq-source/lib/spack/spack/installer.py", line 1952, in build_process
    return installer.run()
  File "/nix/store/k9lidw4pckdqls2yky5yrhnrah7klymq-source/lib/spack/spack/installer.py", line 1809, in run
    self._real_install()
  File "/nix/store/k9lidw4pckdqls2yky5yrhnrah7klymq-source/lib/spack/spack/installer.py", line 1916, in _real_install
    phase(pkg.spec, pkg.prefix)
  File "/nix/store/vrr9dqpjss3mj1s8v8dkcpzv4111365j-builder.py", line 63, in wrapPhase
    return f(*args)
  File "/nix/store/k9lidw4pckdqls2yky5yrhnrah7klymq-source/lib/spack/spack/package.py", line 135, in phase_wrapper
    phase(spec, prefix)
  File "/nix/store/k9lidw4pckdqls2yky5yrhnrah7klymq-source/var/spack/repos/builtin/packages/perl/package.py", line 236, in build
    
  File "/nix/store/k9lidw4pckdqls2yky5yrhnrah7klymq-source/lib/spack/spack/build_environment.py", line 147, in __call__
    return super(MakeExecutable, self).__call__(*args, **kwargs)
  File "/nix/store/k9lidw4pckdqls2yky5yrhnrah7klymq-source/lib/spack/spack/util/executable.py", line 231, in __call__
    raise self.error
spack.util.executable.ProcessError: Command exited with status 2:
    'make' '-j16'

@dylex dylex mentioned this pull request Jan 13, 2022
@dguibert
Copy link
Contributor Author

@dguibert Fails to build with nix build .#pkgs.mpileaks --impure --option sandbox false -L

See commented Line 26 and Line 27 of flake.nix, PATH should contains some build tools as SPACK package.py are not as pure as NIX derivation.
Check the log of the failed derivation (nix log /nix/store/$derivation.drv)

As Dylan explained, the PATH variable can be populated with all the native tools of your OS, on NixOS I set

        PATH=/*"/run/current-system/sw/bin:"+*/
            inputs.nixpkgs.lib.concatStringsSep ":"
            (builtins.map (x: "${x}/bin")
            [
              pkgs.bash
              pkgs.coreutils
              pkgs.gnumake
              pkgs.gnutar
              pkgs.gzip
              pkgs.bzip2
              pkgs.xz
              pkgs.gawk
              pkgs.gnused
              pkgs.gnugrep
              pkgs.glib
              pkgs.binutils.bintools # glib: locale
              pkgs.patch
              pkgs.texinfo
            ]);

But perl does not build, I think the Perl package from SPACK hits this: Perl/perl5#18752

@Qubasa
Copy link

Qubasa commented Jan 16, 2022

Ahh okay I see! I would suggest having a bit of documentation in the readme :-)

dylex added a commit that referenced this pull request Jan 16, 2022
based in part on #8 and addressing part of #10
@dguibert
Copy link
Contributor Author

Hi @luis-hebendanz, I've just updated this PR
I can confirm that nix build .#pkgs.mpileaks --impure --option sandbox false -L works.

…ckSrc

This will allow to pass these arguments from the flake inputs.
impure and sandbox options should be passed as:

$ nix build .#pkgs.zlib -L --impure --option sandbox false
Flake lock file changes:

• Added input 'nixpkgs':
    'github:NixOS/nixpkgs/dd956a5acab3b6ae370facb3066cf400d575ff44' (2022-04-29)
• Added input 'spack':
    'github:spack/spack/8a6b73bb2cb285904398224e743e405cea87dcce' (2022-04-29)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants