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

Downstream tests download to wrong subdir (breaks boa+libsolv>=0.7.23) #4750

Closed
mbargull opened this issue Jan 24, 2023 · 7 comments · Fixed by #4763 or #4832
Closed

Downstream tests download to wrong subdir (breaks boa+libsolv>=0.7.23) #4750

mbargull opened this issue Jan 24, 2023 · 7 comments · Fixed by #4763 or #4832
Assignees
Labels
in-progress issue is actively being worked on locked [bot] locked due to inactivity severity::3 major; broken functionality with a workaround source::contributor created by a frequent contributor type::bug describes erroneous operation, use severity::* to classify the type
Milestone

Comments

@mbargull
Copy link
Member

mbargull commented Jan 24, 2023

What happened?

See conda/conda-index#89 and linked issues.

This comes from openSUSE/libsolv@cc2da2e#diff-2f0af950e6d2249e0340147b80f5b8194de5362f23026ff65cdb65dfa57696aaR314-R320 , i.e., a newly added strict check in libsolv=0.7.23 update.
That check is probably reasonable/good -- but conda-build is not so strict and dumps the to-be-downstream-tested packages in the current subdir.

In conda-forge/conda-feedstock#197 (comment) the noarch package conda-smithy gets downloaded to conda-build/linux-64 which is then indexed and thus results in a repodata.json for linux-64 with a noarch package.


I didn't dig deep enough, but I guess somewhere around
https://github.com/conda/conda-build/blob/3.23.3/conda_build/build.py#L3144
-> https://github.com/conda/conda-build/blob/3.23.3/conda_build/render.py#L311
is the culprit.

@mbargull mbargull added type::bug describes erroneous operation, use severity::* to classify the type source::contributor created by a frequent contributor labels Jan 24, 2023
mbargull added a commit to conda-forge-admin/boa-feedstock that referenced this issue Jan 24, 2023
@mbargull
Copy link
Member Author

Until this bug is fixed, conda-forge/boa-feedstock#61 should act as a workaround.

@jezdez jezdez added the severity::3 major; broken functionality with a workaround label Jan 24, 2023
@jezdez jezdez added this to the 3.24.0 milestone Jan 24, 2023
@kenodegard kenodegard self-assigned this Jan 30, 2023
@dholth
Copy link
Contributor

dholth commented Jan 31, 2023

conda-build intentionally combines noarch and native arch packages in an index here

# replace noarch with native subdir - this ends up building an index with both the
# native content and the noarch content.

@kenodegard
Copy link
Contributor

It looks like this is unrelated to libsolv but is rather some other change in mamba that started to check whether the package's subdir matches that of the repodata.json's subdir (I haven't pinpointed the exact change).

Conda-build rearchives/copies the downstream test's package from the package chache into the $CONDA_PREFIX/conda-bld index and uses the host subdir. I believe it happens in this hack (see line 220):

def find_pkg_dir_or_file_in_pkgs_dirs(pkg_dist, m, files_only=False):
_pkgs_dirs = pkgs_dirs + list(m.config.bldpkgs_dirs)
pkg_loc = None
for pkgs_dir in _pkgs_dirs:
pkg_dir = os.path.join(pkgs_dir, pkg_dist)
pkg_file = os.path.join(pkgs_dir, pkg_dist + CONDA_PACKAGE_EXTENSION_V1)
if not files_only and os.path.isdir(pkg_dir):
pkg_loc = pkg_dir
break
elif os.path.isfile(pkg_file):
pkg_loc = pkg_file
break
elif files_only and os.path.isdir(pkg_dir):
pkg_loc = pkg_file
# create the tarball on demand. This is so that testing on archives works.
with tarfile.open(pkg_file, 'w:bz2') as archive:
for entry in os.listdir(pkg_dir):
archive.add(os.path.join(pkg_dir, entry), arcname=entry)
pkg_subdir = os.path.join(m.config.croot, m.config.host_subdir)
pkg_loc = os.path.join(pkg_subdir, os.path.basename(pkg_file))
shutil.move(pkg_file, pkg_loc)
return pkg_loc

See #4763 for a potential fix

@kenodegard kenodegard added the in-progress issue is actively being worked on label Jan 31, 2023
@kenodegard kenodegard moved this to Review in Progress in 🧭 Planning Jan 31, 2023
@kenodegard
Copy link
Contributor

I now understand that the subdir checks on repodata.json was added to libsolv (not mamba). Either way, the investigations done above and the potential fix is valid.

@jezdez
Copy link
Member

jezdez commented Mar 8, 2023

@kenodegard Should we close this here, or move the ticket to the conda/conda repo?

@jezdez
Copy link
Member

jezdez commented Mar 13, 2023

Closing as I think this was fixed in #4763

@jezdez jezdez closed this as completed Mar 13, 2023
@github-project-automation github-project-automation bot moved this from 👀 In Review to 🏁 Done in 🧭 Planning Mar 13, 2023
@kenodegard kenodegard mentioned this issue Mar 13, 2023
3 tasks
@kenodegard
Copy link
Contributor

Looks like we missed a second spot where the subdir is incorrectly set, this causes downstream tests to fail:

if package_data['subdir'] != 'noarch':
config.host_subdir = package_data['subdir']

@kenodegard kenodegard reopened this Mar 28, 2023
@github-project-automation github-project-automation bot moved this from 🏁 Done to 🏗️ In Progress in 🧭 Planning Mar 28, 2023
jezdez added a commit to kenodegard/conda-feedstock that referenced this issue Mar 28, 2023
Should be removed once conda/conda-build#4750 is fixed for good.
@kenodegard kenodegard moved this from 🏗️ In Progress to 👀 In Review in 🧭 Planning Mar 28, 2023
@kenodegard kenodegard modified the milestones: 3.24.0, 3.25.0 Mar 28, 2023
kenodegard added a commit to conda-forge/conda-feedstock that referenced this issue Mar 28, 2023
* updated v23.3.0

* Add missing dependencies

* Add version constraints.

* Add a patch

* Work around another libsolv issue shortly

Should be removed once conda/conda-build#4750 is fixed for good.

---------

Co-authored-by: regro-cf-autotick-bot <[email protected]>
Co-authored-by: Jannis Leidel <[email protected]>
Co-authored-by: jaimergp <[email protected]>
Co-authored-by: conda-forge-webservices[bot] <91080706+conda-forge-webservices[bot]@users.noreply.github.com>
@github-project-automation github-project-automation bot moved this from 👀 In Review to 🏁 Done in 🧭 Planning May 4, 2023
@github-actions github-actions bot added the locked [bot] locked due to inactivity label May 4, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
in-progress issue is actively being worked on locked [bot] locked due to inactivity severity::3 major; broken functionality with a workaround source::contributor created by a frequent contributor type::bug describes erroneous operation, use severity::* to classify the type
Projects
Archived in project
4 participants