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

If ~/.condarc is a symlink non-default channels do not work #12956

Closed
2 tasks done
andrsd opened this issue Aug 2, 2023 · 3 comments · Fixed by #13208
Closed
2 tasks done

If ~/.condarc is a symlink non-default channels do not work #12956

andrsd opened this issue Aug 2, 2023 · 3 comments · Fixed by #13208
Assignees
Labels
good first issue great for new contributors, code change is envisioned to be trivial/relatively straight-forward in-progress issue is actively being worked on severity::3 major; broken functionality with a workaround source::community catch-all for issues filed by community members type::bug describes erroneous operation, use severity::* to classify the type

Comments

@andrsd
Copy link

andrsd commented Aug 2, 2023

Checklist

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

What happened?

In my setup, I have several .condarc.XYZ files and I used a symlink from .condarc to one of those based on what I needed. This was done for debugging purposes when I was developing a new conda adapter.

I upgraded conda from 23.5.x to 23.7.0 and my non-default channel (conda-forge) disappeared.

This is what conda info gave with 23.5.x:

     active environment : bld
    active env location : /<homedir>/miniconda3/envs/bld
            shell level : 2
       user config file : /<homedir>/.condarc
 populated config files : /<homedir>/.condarc
          conda version : 23.5.1
    conda-build version : not installed
         python version : 3.9.16.final.0
       virtual packages : __archspec=1=arm64
                          __osx=13.5=0
                          __unix=0=0
       base environment : /<homedir>/miniconda3  (writable)
      conda av data dir : /<homedir>/miniconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-arm64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/osx-arm64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-arm64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /<homedir>/miniconda3/pkgs
                          /<homedir>/.conda/pkgs
       envs directories : /<homedir>/miniconda3/envs
                          /<homedir>/.conda/envs
               platform : osx-arm64
             user-agent : conda/23.5.1 requests/2.31.0 CPython/3.9.16 Darwin/22.6.0 OSX/13.5 solver/libmamba conda-libmamba-solver/23.7.0 libmambapy/1.4.9
                UID:GID : 501:20
             netrc file : /<homedir>/.netrc
           offline mode : False

This is conda info with 23.7.0:

     active environment : bld
    active env location : /<homedir>/miniconda3/envs/bld
            shell level : 2
       user config file : /<homedir>/.condarc
 populated config files : 
          conda version : 23.7.0
    conda-build version : not installed
         python version : 3.9.16.final.0
       virtual packages : __archspec=1=arm64
                          __osx=13.5=0
                          __unix=0=0
       base environment : /<homedir>/miniconda3  (writable)
      conda av data dir : /<homedir>/miniconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/osx-arm64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-arm64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /<homedir>/miniconda3/pkgs
                          /<homedir>/.conda/pkgs
       envs directories : /<homedir>/miniconda3/envs
                          /<homedir>/.conda/envs
               platform : osx-arm64
             user-agent : conda/23.7.0 requests/2.31.0 CPython/3.9.16 Darwin/22.6.0 OSX/13.5
                UID:GID : 501:20
             netrc file : /<homedir>/.netrc
           offline mode : False

Notice that populated config files is empty.

The content of ~/.condarc:

report_errors: false
channels:
  - conda-forge
  - defaults

I tested this on OSX (macbook pro with apple M1) and linux (amd64 debian).

This is not a show stopper for me, I can go back to the regular file for .condarc. Thought you may want to know about this. Or, if somebody runs into a the same problem, hopefully they will find this issue.

Conda Info

See above for more details...

Conda Config

==> envvars <==
number_channel_notices: 0

Conda list

No response

Additional Context

No response

@andrsd andrsd added the type::bug describes erroneous operation, use severity::* to classify the type label Aug 2, 2023
@andrsd andrsd changed the title If ~/.condarc is a symlink channels do not work If ~/.condarc is a symlink non-default channels do not work Aug 2, 2023
@travishathaway travishathaway added the source::community catch-all for issues filed by community members label Aug 7, 2023
@travishathaway
Copy link
Contributor

Hi @andrsd,

Thanks for reporting this. I have been able to recreate this issue myself, so I can confirm this regression. Your workaround seems reasonable in the meantime, but I think we should restore this behavior.

I cannot promise when we will get around to fixing this, but I will tag it as a good-first issue so it hopefully gets more attention and will bring it up with my colleagues.

@travishathaway travishathaway added severity::3 major; broken functionality with a workaround good first issue great for new contributors, code change is envisioned to be trivial/relatively straight-forward backlog issue has been triaged but has not been earmarked for any upcoming release labels Aug 7, 2023
@dholth
Copy link
Contributor

dholth commented Oct 17, 2023

This code resolves the symlink, and THEN checks that the resolved path is in CONDARC_FILENAMES (.condarc, condarc) or if the suffix (extension) is in YAML_EXTENSIONS (.yml, .yaml).

else:
template = custom_expandvars(search, environ, **kwargs)
path = Path(template).expanduser().resolve()
if path.is_file() and (
path.name in CONDARC_FILENAMES or path.suffix in YAML_EXTENSIONS
):

I copied ~/.condarc to ~/linkto-condarc and then symlinked it. Conda ignores the file because the symlink's target does not pass the test.

@dholth dholth self-assigned this Oct 17, 2023
@dholth dholth added in-progress issue is actively being worked on and removed backlog issue has been triaged but has not been earmarked for any upcoming release labels Oct 17, 2023
@andrsd
Copy link
Author

andrsd commented Oct 18, 2023

Thanks for fixing this! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue great for new contributors, code change is envisioned to be trivial/relatively straight-forward in-progress issue is actively being worked on severity::3 major; broken functionality with a workaround source::community catch-all for issues filed by community members type::bug describes erroneous operation, use severity::* to classify the type
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants