Exempt "compilers" and "runtimes" from default requirements
This commit is contained in:
parent
a316f23d79
commit
7edcc4da88
@ -2732,7 +2732,7 @@ def visit(node):
|
|||||||
arg = ast_sym(ast_sym(term.atom).arguments[0])
|
arg = ast_sym(ast_sym(term.atom).arguments[0])
|
||||||
symbol = AspFunction(name)(arg.string)
|
symbol = AspFunction(name)(arg.string)
|
||||||
self.assumptions.append((parse_term(str(symbol)), True))
|
self.assumptions.append((parse_term(str(symbol)), True))
|
||||||
self.gen.asp_problem.append(f"{symbol}.\n")
|
self.gen.asp_problem.append(f"{{ {symbol} }}.\n")
|
||||||
|
|
||||||
path = os.path.join(parent_dir, "concretize.lp")
|
path = os.path.join(parent_dir, "concretize.lp")
|
||||||
parse_files([path], visit)
|
parse_files([path], visit)
|
||||||
|
@ -315,18 +315,21 @@ possible_version_weight(node(ID, Package), Weight)
|
|||||||
|
|
||||||
% If there is at least a version that satisfy the constraint, impose a lower
|
% If there is at least a version that satisfy the constraint, impose a lower
|
||||||
% bound on the choice rule to avoid false positives with the error below
|
% bound on the choice rule to avoid false positives with the error below
|
||||||
1 { attr("version", node(ID, Package), Version) : pkg_fact(Package, version_satisfies(Constraint, Version)) }
|
{ attr("version", node(ID, Package), Version) : pkg_fact(Package, version_satisfies(Constraint, Version)) }
|
||||||
:- attr("node_version_satisfies", node(ID, Package), Constraint),
|
:- attr("node_version_satisfies", node(ID, Package), Constraint),
|
||||||
pkg_fact(Package, version_satisfies(Constraint, _)),
|
pkg_fact(Package, version_satisfies(Constraint, _)).
|
||||||
internal_error("must choose a single version to satisfy version constraints").
|
|
||||||
|
|
||||||
% More specific error message if the version cannot satisfy some constraint
|
% More specific error message if the version cannot satisfy some constraint
|
||||||
% Otherwise covered by `no_version_error` and `versions_conflict_error`.
|
% Otherwise covered by `no_version_error` and `versions_conflict_error`.
|
||||||
error(10, "Cannot satisfy '{0}@{1}'", Package, Constraint)
|
error(1, "Cannot satisfy '{0}@{1}'", Package, Constraint)
|
||||||
:- attr("node_version_satisfies", node(ID, Package), Constraint),
|
:- attr("node_version_satisfies", node(ID, Package), Constraint),
|
||||||
attr("version", node(ID, Package), Version),
|
attr("version", node(ID, Package), Version),
|
||||||
not pkg_fact(Package, version_satisfies(Constraint, Version)).
|
not pkg_fact(Package, version_satisfies(Constraint, Version)).
|
||||||
|
|
||||||
|
error(10, "Cannot satisfy '{0}@{1}'", Package, Constraint)
|
||||||
|
:- attr("node_version_satisfies", node(ID, Package), Constraint),
|
||||||
|
not attr("version", node(ID, Package), _).
|
||||||
|
|
||||||
attr("node_version_satisfies", node(ID, Package), Constraint)
|
attr("node_version_satisfies", node(ID, Package), Constraint)
|
||||||
:- attr("version", node(ID, Package), Version),
|
:- attr("version", node(ID, Package), Version),
|
||||||
pkg_fact(Package, version_satisfies(Constraint, Version)).
|
pkg_fact(Package, version_satisfies(Constraint, Version)).
|
||||||
@ -1234,7 +1237,7 @@ propagated_flag(node(PackageID, Package), node_flag(FlagType, Flag, FlagGroup, S
|
|||||||
attr("node_flag", PackageNode, NodeFlag) :- propagated_flag(PackageNode, NodeFlag, _).
|
attr("node_flag", PackageNode, NodeFlag) :- propagated_flag(PackageNode, NodeFlag, _).
|
||||||
|
|
||||||
% Cannot propagate the same flag from two distinct sources
|
% Cannot propagate the same flag from two distinct sources
|
||||||
error(100, "{0} and {1} cannot both propagate compiler flags '{2}' to {3}", Source1, Source2, Package, FlagType) :-
|
error(100, "{0} and {1} cannot both propagate compiler flags '{2}' to {3}", Source1, Source2, FlagType, Package) :-
|
||||||
propagated_flag(node(ID, Package), node_flag(FlagType, _, _, _), node(_, Source1)),
|
propagated_flag(node(ID, Package), node_flag(FlagType, _, _, _), node(_, Source1)),
|
||||||
propagated_flag(node(ID, Package), node_flag(FlagType, _, _, _), node(_, Source2)),
|
propagated_flag(node(ID, Package), node_flag(FlagType, _, _, _), node(_, Source2)),
|
||||||
Source1 < Source2.
|
Source1 < Source2.
|
||||||
@ -1267,7 +1270,7 @@ has_built_packages() :- build(X), not external(X).
|
|||||||
|
|
||||||
% FIXME (compiler as nodes): is this version constraint always required and better than the callback?
|
% FIXME (compiler as nodes): is this version constraint always required and better than the callback?
|
||||||
% "gcc-runtime" and the "gcc" it depends on must be at the same version
|
% "gcc-runtime" and the "gcc" it depends on must be at the same version
|
||||||
% attr("version", node(X, "gcc"), Version) :-
|
% attr("version", node(Y, "gcc"), Version) :-
|
||||||
% attr("version", node(X, "gcc-runtime"), Version),
|
% attr("version", node(X, "gcc-runtime"), Version),
|
||||||
% attr("depends_on", node(X, "gcc-runtime"), node(Y, "gcc"), "build").
|
% attr("depends_on", node(X, "gcc-runtime"), node(Y, "gcc"), "build").
|
||||||
|
|
||||||
|
@ -12,9 +12,10 @@ class Gcc(CompilerPackage, Package):
|
|||||||
homepage = "http://www.example.com"
|
homepage = "http://www.example.com"
|
||||||
url = "http://www.example.com/gcc-1.0.tar.gz"
|
url = "http://www.example.com/gcc-1.0.tar.gz"
|
||||||
|
|
||||||
version("1.0", md5="0123456789abcdef0123456789abcdef")
|
version("14.0", md5="abcdef0123456789abcdef0123456789")
|
||||||
version("2.0", md5="abcdef0123456789abcdef0123456789")
|
|
||||||
version("3.0", md5="def0123456789abcdef0123456789abc")
|
version("3.0", md5="def0123456789abcdef0123456789abc")
|
||||||
|
version("2.0", md5="abcdef0123456789abcdef0123456789")
|
||||||
|
version("1.0", md5="0123456789abcdef0123456789abcdef")
|
||||||
|
|
||||||
variant(
|
variant(
|
||||||
"languages",
|
"languages",
|
||||||
@ -28,6 +29,8 @@ class Gcc(CompilerPackage, Package):
|
|||||||
provides("cxx", when="languages=c++")
|
provides("cxx", when="languages=c++")
|
||||||
provides("fortran", when="languages=fortran")
|
provides("fortran", when="languages=fortran")
|
||||||
|
|
||||||
|
depends_on("c", type="build")
|
||||||
|
|
||||||
c_names = ["gcc"]
|
c_names = ["gcc"]
|
||||||
cxx_names = ["g++"]
|
cxx_names = ["g++"]
|
||||||
fortran_names = ["gfortran"]
|
fortran_names = ["gfortran"]
|
||||||
|
Loading…
Reference in New Issue
Block a user