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

extern: set external_modules with new modules attribute #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ lib.fix (packs: with packs; {
, patches ? []
, depends ? {}
, extern ? null
, modules ? null
, provides ? {}
, tests ? false
, fixedDeps ? false
Expand All @@ -182,7 +183,7 @@ lib.fix (packs: with packs; {
, verbose ? false # only used by builder
} @ prefs:
prefs // {
inherit version variants patches depends extern tests provides fixedDeps target paths;
inherit version variants patches depends extern modules tests provides fixedDeps target paths;
resolver = deptype: name: let r = lib.applyOptional (lib.applyOptional resolver deptype) name; in
if builtins.isFunction r then r
else (lib.coalesce r packs).getResolver name;
Expand Down Expand Up @@ -311,7 +312,7 @@ lib.fix (packs: with packs; {
prefs = fillPrefs pprefs;
spec = {
inherit (desc) name namespace provides;
inherit (prefs) extern tests;
inherit (prefs) extern modules tests;
target = spackTarget prefs.target;
paths = desc.paths // prefs.paths;
version = if prefs.extern != null && lib.versionIsConcrete prefs.version
Expand Down
4 changes: 3 additions & 1 deletion packs/lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ rec {
patches = scalar;
depends = mergeWith prefsUpdate;
extern = scalar;
modules = scalar;
tests = scalar;
fixedDeps = scalar;
resolver = scalar;
Expand All @@ -231,6 +232,7 @@ rec {
patches = a: b: a ++ b;
depends = mergeWith prefsIntersect;
extern = scalar;
modules = scalar;
tests = scalar;
fixedDeps = scalar;
resolver = scalar;
Expand All @@ -255,7 +257,7 @@ rec {
/* traverse all dependencies of given package(s) that satisfy pred recursively and return them as a list (in bredth-first order) */
findDeps = pred:
let
adddeps = s: pkgs: add s
adddeps = s: pkgs: add s
(foldl' (deps: p:
(deps ++ filter (d: d != null && ! (elem d s) && ! (elem d deps) && pred d)
(attrValues p.spec.depends)))
Expand Down
1 change: 1 addition & 0 deletions spack/nixpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def __init__(self, nixspec, prefix: str, top: bool):
self._set_architecture(target=nixspec.get('target', basetarget), platform=platform, os=archos)
self.prefix = prefix
self.external_path = nixspec['extern']
self.external_modules = nixspec.get('modules',None)
if self.external_path:
assert self.external_path == prefix, f"{self.name} extern {nixspec['extern']} doesn't match prefix {prefix}"
else:
Expand Down