Skip to content

Conversation

scopatz
Copy link
Contributor

@scopatz scopatz commented Oct 21, 2019

Similar to #9349, implements #9348, and addresses some of the issues in conda-forge/staged-recipes#9902.

CC @mingwandroid @jakirkham @msarahan @jjhelmus @isuruf

@scopatz scopatz requested a review from a team as a code owner October 21, 2019 19:44
@cla-bot cla-bot bot added the cla-signed [bot] added once the contributor has signed the CLA label Oct 21, 2019
scopatz and others added 2 commits October 21, 2019 16:19
Co-Authored-By: Isuru Fernando <isuruf@gmail.com>
Co-Authored-By: Isuru Fernando <isuruf@gmail.com>
@@ -54,6 +54,16 @@ def test_supplement_index_with_system():
assert cuda_pkg.package_type == PackageType.VIRTUAL_SYSTEM


def test_supplement_index_with_system_glibc():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test will fail on non-glibc systems

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scopatz, the tests fail because context.libc_family_version is not overriden by the env variable CONDA_OVERRIDE_GLIBC

@@ -157,6 +158,11 @@ def _supplement_index_with_system(index):
rec = _make_virtual_package('__cuda', cuda_version)
index[rec] = rec

libc_family, libc_version = context.libc_family_version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering a bit on how this will behave on systems where we have musl + glibc-wrapper, e.g. the miniconda3:4.7.10-alpine docker image.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at https://github.com/conda/conda/blob/4.7.12/conda/common/_os/linux.py#L20-L48 , I would assume it gets the glibc configuration (under the premise that you run the Anaconda or conda-forge conda and python packages -- if you would dare to pip install conda into musl-built CPython installation things might turn out differently ;D).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that image gives you glibc, 2.28

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you point me to where the tests actually fail? All of the Circle tests I saw seem to fail long before this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Co-Authored-By: Uwe L. Korn <xhochy@users.noreply.github.com>
Comment on lines 70 to 72
* ``CONDA_OVERRIDE_CUDA`` - CUDA version number or set to ``""`` for no CUDA
detected.
* ``CONDA_OVERRIDE_GLIBC`` - CUDA version number or set to ``""`` for no GLIBC.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't aware of #8267 -- IMO we shouldn't have that CONDA_OVERRIDE_CUDA environment variable handling, but we should use conda's builtin configuration capabilities that allow overriding config parameters via environment variables.
Meaning, I would propose a virtual_packages (/system_packages/virtual_system_packages/virtual_package_overrides/something) configuration option akin to pinned_packages/disabled_packages.
(Not saying @scopatz has to implement that in this PR, but it would be very advantageous to have a more general solution in place, rather than introducing separate env vars for every "virtual package".)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, my goal here is to do the minimum possible for this capability. I just need bluetooth capability, and am already pretty deep in the weeds here 😉

@@ -157,6 +158,11 @@ def _supplement_index_with_system(index):
rec = _make_virtual_package('__cuda', cuda_version)
index[rec] = rec

libc_family, libc_version = context.libc_family_version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at https://github.com/conda/conda/blob/4.7.12/conda/common/_os/linux.py#L20-L48 , I would assume it gets the glibc configuration (under the premise that you run the Anaconda or conda-forge conda and python packages -- if you would dare to pip install conda into musl-built CPython installation things might turn out differently ;D).

scopatz and others added 2 commits October 22, 2019 13:18
@scopatz
Copy link
Contributor Author

scopatz commented Oct 22, 2019

OK I think that this is ready for review again. Also note that CI is still broken in ways unrelated to this PR

Co-Authored-By: Isuru Fernando <isuruf@gmail.com>
@scopatz
Copy link
Contributor Author

scopatz commented Oct 22, 2019

Also, everyone, please feel free to push to this branch directly.

@scopatz
Copy link
Contributor Author

scopatz commented Oct 22, 2019

Ok I have the tests running now and the added test passes. CI failures are unrelated.

@jjhelmus
Copy link
Contributor

LGTM, thanks for the addition @scopatz

@jjhelmus jjhelmus merged commit f39a6fd into conda:master Oct 22, 2019
@jjhelmus
Copy link
Contributor

FYI, a conda 4.8.0 release is planned for later this week / earlier next week. This will make a nice addition.

@scopatz scopatz deleted the virt-libc branch October 22, 2019 20:11
@scopatz
Copy link
Contributor Author

scopatz commented Oct 22, 2019

Excellent thanks! glad I could get this in under the wire 😉

@msarahan
Copy link
Contributor

Thanks for taking point on this @scopatz. We have needed this for a while. It will dramatically improve compatibility messaging on Linux. Thanks for the thorough review, @xhochy @isuruf @mbargull @jakirkham.

@github-actions
Copy link

Hi there, thank you for your contribution to Conda!

This pull request has been automatically locked since it has not had recent activity after it was closed.

Please open a new issue or pull request if needed.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Aug 23, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed [bot] added once the contributor has signed the CLA locked [bot] locked due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants