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

BUG: pin_subpackage does not populate hash correctly in run_constrained #5572

Open
2 tasks done
h-vetinari opened this issue Dec 19, 2024 · 0 comments
Open
2 tasks done
Labels
type::bug describes erroneous operation, use severity::* to classify the type

Comments

@h-vetinari
Copy link
Contributor

h-vetinari commented Dec 19, 2024

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

In the blas-feedstock, as of h-vetinari/blas-feedstock@54921a9, I was running into a weird resolver error:

Could not solve for environment specs
The following packages are incompatible
├─ libblas 3.9.0.* 27_hf28d09d_openblas is installable and it requires
│  ├─ libcblas 3.9.0 27_h1234567_openblas, which can be installed;
│  └─ liblapack 3.9.0 27_h1234567_openblas, which can be installed;
├─ libcblas 3.9.0.* 27_h0286465_openblas is not installable because it requires
│  └─ libblas 3.9.0 27_hf28d09d_openblas, which can be installed (as previously explained);
└─ liblapack 3.9.0.* 27_h0286465_openblas is not installable because it conflicts with any installable versions previously reported.

That is, until I noticed the h1234567. The recipe at this point contains

outputs:
  - name: libblas
    [...] 
    requirements:
      [...]
      run_constrained:
        - {{ pin_subpackage("libcblas", exact=True) }}
        - {{ pin_subpackage("liblapack", exact=True) }}    # [blas_impl != 'blis']
        - {{ pin_subpackage("liblapacke", exact=True) }}   # [blas_impl != 'blis']
        - blas * {{ blas_impl }}

and

  - name: libcblas
    [...]
    requirements:
      [...]
      host:
        - {{ pin_subpackage("libblas", exact=True) }}
      run:
        - {{ pin_subpackage("libblas", exact=True) }}

Obviously these refer to the exact same output in both places (run: and run_constrained), so the hash divergence is definitely spurious.

I presume that this is a bit tricky because the hashes of later packages will only be known once the various dependencies have themselves been resolved (i.e. the hash of libcblas depends on knowing the hash of libblas in its host environment, making it necessary to populate the metadata for libblas first), but that means that either:

  1. there needs to be an iterative process, where pin_subpackage under run_constrained gets populated/corrected after all the outputs are known
  2. conda-build needs to raise an error if pin_subpackage is used under run_constrained

I obviously lean towards the first point, though I don't know the complexity that would be necessary. However, I note that something along those lines must already be happening. I wanted to compare to the fully(?!) rendered recipe as shown in the log, and I noticed that all package hashes there are still only the h1234567 placeholders. For example:

    name: liblapack
    requirements:
      host:
        - libblas 3.9.0 27_h1234567_openblas
      run:
        - libblas 3.9.0 27_h1234567_openblas
      run_constrained:
        - libcblas 3.9.0 27_h1234567_openblas
        - liblapacke 3.9.0 27_h1234567_openblas

That's despite the fact that the run-requirements definitely get populated correctly, and this is also evident from the list of outputs that actually get built:

BUILD START: ['libblas-3.9.0-27_hf28d09d_openblas.conda', 'libcblas-3.9.0-27_h0286465_openblas.conda', 'liblapack-3.9.0-27_h0286465_openblas.conda', 'liblapacke-3.9.0-27_h0286465_openblas.conda', 'blas-devel-3.9.0-27_h1ea3ea9_openblas.conda', 'blas-2.127-openblas.conda']

Conda Info

++ conda info

     active environment : base
    active env location : /opt/conda
            shell level : 1
       user config file : /home/conda/.condarc
 populated config files : /opt/conda/.condarc
                          /home/conda/.condarc
          conda version : 24.9.2
    conda-build version : 24.9.0
         python version : 3.12.7.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=broadwell
                          __conda=24.9.2=0
                          __glibc=2.17=0
                          __linux=6.5.0=0
                          __unix=0=0
       base environment : /opt/conda  (writable)
      conda av data dir : /opt/conda/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /home/conda/feedstock_root/build_artifacts/pkg_cache
                          /opt/conda/pkgs
       envs directories : /opt/conda/envs
                          /home/conda/.conda/envs
               platform : linux-64
             user-agent : conda/24.9.2 requests/2.32.3 CPython/3.12.7 Linux/6.5.0-1025-azure centos/7.9.2009 glibc/2.17 solver/libmamba conda-libmamba-solver/24.9.0 libmambapy/1.5.10
                UID:GID : 1001:1001
             netrc file : None
           offline mode : False

Conda Config

++ conda config --env --show-sources
==> /opt/conda/.condarc <==
add_pip_as_python_dependency: False
auto_update_conda: False
aggressive_update_packages:
  - ca-certificates
  - certifi
channel_priority: strict
channels:
  - conda-forge
show_channel_urls: True
conda_build:
  pkg_format: 2
  zstd_compression_level: 19

==> /home/conda/.condarc <==
pkgs_dirs:
  - /home/conda/feedstock_root/build_artifacts/pkg_cache
  - /opt/conda/pkgs
solver: libmamba
conda-build:
  root-dir: /home/conda/feedstock_root/build_artifacts

==> envvars <==
allow_softlinks: False
bld_path: /home/conda/feedstock_root/build_artifacts

Conda list

++ conda list --show-channel-urls
# packages in environment at /opt/conda:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
anaconda-client           1.12.3             pyhd8ed1ab_1    conda-forge
archspec                  0.2.3              pyhd8ed1ab_0    conda-forge
attrs                     24.2.0             pyh71513ae_0    conda-forge
beautifulsoup4            4.12.3             pyha770c72_0    conda-forge
boltons                   24.0.0             pyhd8ed1ab_0    conda-forge
brotli-python             1.1.0           py312h2ec8cdc_2    conda-forge
bzip2                     1.0.8                h4bc722e_7    conda-forge
c-ares                    1.32.3               h4bc722e_0    conda-forge
ca-certificates           2024.8.30            hbcca054_0    conda-forge
certifi                   2024.8.30          pyhd8ed1ab_0    conda-forge
cffi                      1.17.1          py312h06ac9bb_0    conda-forge
chardet                   5.2.0           py312h7900ff3_2    conda-forge
charset-normalizer        3.4.0              pyhd8ed1ab_0    conda-forge
click                     8.1.7           unix_pyh707e725_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
conda                     24.9.2          py312h7900ff3_0    conda-forge
conda-build               24.9.0          py312h7900ff3_0    conda-forge
conda-env                 2.6.0                         1    conda-forge
conda-forge-ci-setup      4.14.0          py312hb3d6910_100    conda-forge
conda-forge-metadata      0.11.0             pyhd8ed1ab_0    conda-forge
conda-index               0.5.0              pyhd8ed1ab_0    conda-forge
conda-libmamba-solver     24.9.0             pyhd8ed1ab_0    conda-forge
conda-oci-mirror          0.2.1              pyhd8ed1ab_0    conda-forge
conda-package-handling    2.4.0              pyh7900ff3_0    conda-forge
conda-package-streaming   0.11.0             pyhd8ed1ab_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
deprecated                1.2.15             pyhd8ed1ab_1    conda-forge
distro                    1.9.0              pyhd8ed1ab_0    conda-forge
filelock                  3.16.1             pyhd8ed1ab_0    conda-forge
fmt                       11.0.2               h434a139_0    conda-forge
frozendict                2.4.6           py312h66e93f0_0    conda-forge
git                       2.47.0          pl5321h59d505e_0    conda-forge
h2                        4.1.0              pyhd8ed1ab_0    conda-forge
hpack                     4.0.0              pyh9f0ad1d_0    conda-forge
hyperframe                6.0.1              pyhd8ed1ab_0    conda-forge
icu                       75.1                 he02047a_0    conda-forge
idna                      3.10               pyhd8ed1ab_0    conda-forge
importlib_resources       6.4.5              pyhd8ed1ab_0    conda-forge
jinja2                    3.1.4              pyhd8ed1ab_0    conda-forge
joblib                    1.4.2              pyhd8ed1ab_1    conda-forge
jq                        1.7.1                hd590300_0    conda-forge
jsonpatch                 1.33               pyhd8ed1ab_0    conda-forge
jsonpointer               3.0.0           py312h7900ff3_1    conda-forge
jsonschema                4.23.0             pyhd8ed1ab_0    conda-forge
jsonschema-specifications 2024.10.1          pyhd8ed1ab_0    conda-forge
jupyter_core              5.7.2              pyh31011fe_1    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
krb5                      1.21.3               h659f571_0    conda-forge
ld_impl_linux-64          2.43                 h712a8e2_2    conda-forge
libarchive                3.7.4                hfca40fe_0    conda-forge
libcurl                   8.10.1               hbbe4b11_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 hd590300_2    conda-forge
libexpat                  2.6.4                h5888daf_0    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc                    14.2.0               h77fa898_1    conda-forge
libgcc-ng                 14.2.0               h69a702a_1    conda-forge
libgomp                   14.2.0               h77fa898_1    conda-forge
libiconv                  1.17                 hd590300_2    conda-forge
liblief                   0.14.1               h5888daf_2    conda-forge
libmamba                  1.5.10               hf72d635_1    conda-forge
libmambapy                1.5.10          py312hf3f0a4e_1    conda-forge
libnghttp2                1.64.0               h161d5f1_0    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libsolv                   0.7.30               h3509ff9_0    conda-forge
libsqlite                 3.47.0               hadc24fc_1    conda-forge
libssh2                   1.11.0               h0841786_0    conda-forge
libstdcxx                 14.2.0               hc0a3c3a_1    conda-forge
libstdcxx-ng              14.2.0               h4852527_1    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libxml2                   2.13.5               hb346dea_0    conda-forge
libzlib                   1.3.1                hb9d3cd8_2    conda-forge
lz4-c                     1.9.4                hcb278e6_0    conda-forge
lzo                       2.10              hd590300_1001    conda-forge
mamba                     1.5.10          py312h9460a1c_1    conda-forge
markupsafe                3.0.2           py312h178313f_0    conda-forge
menuinst                  2.2.0           py312h7900ff3_0    conda-forge
more-itertools            10.5.0             pyhd8ed1ab_0    conda-forge
nbformat                  5.10.4             pyhd8ed1ab_0    conda-forge
ncurses                   6.5                  he02047a_1    conda-forge
oniguruma                 6.9.9                hd590300_0    conda-forge
openssl                   3.4.0                hb9d3cd8_0    conda-forge
oras-py                   0.1.14             pyhd8ed1ab_0    conda-forge
packaging                 24.2               pyhff2d567_1    conda-forge
patch                     2.7.6             h7f98852_1002    conda-forge
patchelf                  0.17.2               h58526e2_0    conda-forge
pcre2                     10.44                hba22ea6_2    conda-forge
perl                      5.32.1          7_hd590300_perl5    conda-forge
pip                       24.3.1             pyh8b19718_0    conda-forge
pkginfo                   1.11.2             pyhd8ed1ab_0    conda-forge
pkgutil-resolve-name      1.3.10             pyhd8ed1ab_1    conda-forge
platformdirs              4.3.6              pyhd8ed1ab_0    conda-forge
pluggy                    1.5.0              pyhd8ed1ab_0    conda-forge
psutil                    6.1.0           py312h66e93f0_0    conda-forge
py-lief                   0.14.1          py312h2ec8cdc_2    conda-forge
pybind11-abi              4                    hd8ed1ab_3    conda-forge
pycosat                   0.6.6           py312h98912ed_0    conda-forge
pycparser                 2.22               pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.12.7          hc5c86c4_0_cpython    conda-forge
python-dateutil           2.9.0              pyhd8ed1ab_0    conda-forge
python-fastjsonschema     2.20.0             pyhd8ed1ab_0    conda-forge
python-libarchive-c       5.1             py312h7900ff3_1    conda-forge
python_abi                3.12                    5_cp312    conda-forge
pytz                      2024.2             pyhd8ed1ab_0    conda-forge
pyyaml                    6.0.2           py312h66e93f0_1    conda-forge
rattler-build             0.32.1               h51b9b6e_0    conda-forge
rattler-build-conda-compat 1.2.2              pyhd8ed1ab_0    conda-forge
readline                  8.2                  h8228510_1    conda-forge
referencing               0.35.1             pyhd8ed1ab_0    conda-forge
reproc                    14.2.4.post0         hd590300_1    conda-forge
reproc-cpp                14.2.4.post0         h59595ed_1    conda-forge
requests                  2.32.3             pyhd8ed1ab_0    conda-forge
requests-toolbelt         1.0.0              pyhd8ed1ab_0    conda-forge
ripgrep                   14.1.1               h8fae777_0    conda-forge
rpds-py                   0.21.0          py312h12e396e_0    conda-forge
ruamel.yaml               0.18.6          py312h66e93f0_1    conda-forge
ruamel.yaml.clib          0.2.8           py312h66e93f0_1    conda-forge
setuptools                75.5.0             pyhff2d567_0    conda-forge
shyaml                    0.6.2              pyhd3deb0d_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
soupsieve                 2.5                pyhd8ed1ab_1    conda-forge
su-exec                   0.2               h166bdaf_1003    conda-forge
tini                      0.19.0               h166bdaf_1    conda-forge
tk                        8.6.13          noxft_h4845f30_101    conda-forge
tomli                     2.2.1              pyhd8ed1ab_1    conda-forge
tqdm                      4.67.0             pyhd8ed1ab_0    conda-forge
traitlets                 5.14.3             pyhd8ed1ab_0    conda-forge
truststore                0.10.0             pyhd8ed1ab_0    conda-forge
typing-extensions         4.12.2               hd8ed1ab_1    conda-forge
typing_extensions         4.12.2             pyha770c72_1    conda-forge
tzdata                    2024b                hc8b5060_0    conda-forge
urllib3                   2.2.3              pyhd8ed1ab_0    conda-forge
wheel                     0.45.0             pyhd8ed1ab_0    conda-forge
wrapt                     1.17.0          py312h66e93f0_0    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
yaml                      0.2.5                h7f98852_2    conda-forge
yaml-cpp                  0.8.0                h59595ed_0    conda-forge
zipp                      3.21.0             pyhd8ed1ab_0    conda-forge
zstandard                 0.23.0          py312hef9b889_1    conda-forge
zstd                      1.5.6                ha6fb4c9_0    conda-forge
@h-vetinari h-vetinari added the type::bug describes erroneous operation, use severity::* to classify the type label Dec 19, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in 🧭 Planning Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::bug describes erroneous operation, use severity::* to classify the type
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant