spack: Clingo concretization picks wrong iconv provider

Hello Spack team,

I am facing an odd concretization behavior with the new concretizer. When I try to install netcdf-c ~mpi Spack is picking libc as the iconv provider. But the default variant for libc is ~iconv so it does not provide the iconv libraries. As a result, the build for netcdf-c~mpi and a host of other packages fail.

In my packages.yaml, I have ONLY libiconv as the iconv provider:

# packages.yaml ....
      golang: [gcc]
      iconv: [libiconv]
      ...

But if I ask: spack providers iconv, I get:

iconv:
libc  libiconv

Oddly, the new concretizer picks libiconv as the provider when installing netcdf-c+mpi, but picks libc~iconv as the provider when installing netcdf-c~mpi.

Expected Behavior: Clingo picks libiconv as the iconv provider in both cases.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 24 (24 by maintainers)

Most upvoted comments

openssl@centos8 does seem to concretize. Thanks for the workaround! I’ll check if it actually installs. There is no checksum for openssl@centos8 in the package.py, so spack install may just error out.

Maybe in future we can have a config flag like ignore_deprecated_versions which would suppress this behavior by the concretizer?

I think I’ll just edit openssl/package.py to remove the deprecated tag for that version in my packages for now.

Big thanks to @alalazo for being so prompt and responsive! 😃

The glx provider issues still persists. I still get mesa18 when concretizing libepoxy

I just took care of the issue in the description so far. Will try to have a look at https://github.com/spack/spack/issues/24205#issuecomment-859158603 today.

@alalazo i tested again on the latest develop branch … this seems to solve the openssl issue.

The glx provider issues still persists. I still get mesa18 when concretizing libepoxy.

For what is worth, I’m looking into a subtle bug here. This diff seems to resolve this issue:

diff --git a/lib/spack/spack/solver/concretize.lp b/lib/spack/spack/solver/concretize.lp
index c7d4c1ae44..ca828862a5 100644
--- a/lib/spack/spack/solver/concretize.lp
+++ b/lib/spack/spack/solver/concretize.lp
@@ -145,7 +145,7 @@ path(Parent, Descendant) :- path(Parent, A), depends_on(A, Descendant).
 % provider for that virtual then it depends on the provider
 depends_on(Package, Provider, Type)
   :- dependency_holds(Package, Virtual, Type),
-     provides_virtual(Provider, Virtual),
+     provider(Provider, Virtual),
      not external(Package).
 
 % dependencies on virtuals also imply that the virtual is a virtual node
@@ -154,13 +154,12 @@ virtual_node(Virtual)
      virtual(Virtual), not external(Package).
 
 % if there's a virtual node, we must select one provider
-1 { provides_virtual(Package, Virtual) : possible_provider(Package, Virtual) } 1
+1 { provider(Package, Virtual) : possible_provider(Package, Virtual) } 1
  :- virtual_node(Virtual).
 
 % virtual roots imply virtual nodes, and that one provider is a root
 virtual_node(Virtual) :- virtual_root(Virtual).
-1 { root(Package) : provides_virtual(Package, Virtual) } 1
-  :- virtual_root(Virtual).
+root(Package) :- virtual_root(Virtual), provider(Package, Virtual).
 
 % The provider provides the virtual if some provider condition holds.
 provides_virtual(Provider, Virtual) :-
@@ -168,12 +167,10 @@ provides_virtual(Provider, Virtual) :-
    condition_holds(ID),
    virtual(Virtual).
 
-% a node that provides a virtual is a provider
-provider(Package, Virtual)
-  :- node(Package), provides_virtual(Package, Virtual).
+:- provider(Package, Virtual), not provides_virtual(Package, Virtual).
 
-% for any virtual, there can be at most one provider in the DAG
-0 { node(Package) : provides_virtual(Package, Virtual) } 1 :- virtual(Virtual).
+:- provides_virtual(Package, V1), provides_virtual(Package, V2), V1 != V2,
+   provider(Package, V1), not provider(Package, V2), virtual_node(V1), virtual_node(V2).
 
 #defined possible_provider/2.

but unit tests are still failing on an edge case. Will continue working on it tomorrow.

@amaji I’ll try to have a look at these two issues going to Monday.

Hi @alalazo,

I need your advice with another issue. I am trying to install qt+gtk+opengl ^python@3.9.5, but somehow this is choosing mesa18 as the glx provider (instead of mesa). Since mesa18 is old, it does not build with python@3.9.5.

I am wondering why is the ASP solver choosing mesa18 ahead of mesa. This does not change even if I remove mesa18 as a glx provider in my packages.yaml.

  1. Are provider preferences in packages.yaml ignored by the ASP solver? I am noticing many instances where editing packages.yaml has no impact on providers.
  2. How can I force the solver to use mesa as my glx provider? I am looking for a more elegant solution than explicitly specifying ^mesa.
  3. Is there a way for specifying “don’t use this as a provider”?