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

avoid bootstrapping issues with different location in SRC_DIR #204

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jaimergp
Copy link
Member

@jaimergp jaimergp commented Mar 29, 2023

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

@conda-forge-webservices
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@jaimergp
Copy link
Member Author

@conda-forge-admin, please rerender

@jaimergp
Copy link
Member Author

@conda-forge-admin, please rerender

@jaimergp
Copy link
Member Author

This is not needed right now but should alleviate bootstrapping problems caused by conda-build accidentally importing conda straight from SRC_DIR (working directory) during the build and host activation steps (which happen to use python -m conda ... to generate the shell code that is then evald; python -m injects the working directory in sys.path).

So no need to merge this, but we could have it in mind for next releases in which the dependencies of the new conda version differ from the conda version available in the base environment from which conda-build runs off.

This can technically apply to not just conda, but every package that happens to be imported during the conda activate code paths, as available in base. As of conda 23.1, these are:

  • __distutils_hack
  • conda
  • cython_runtime (???)
  • pkg_resources
  • ruamel.yaml
  • setuptools
  • toolz (tlz)
  • tqdm

Note: we might want to optimize which modules are imported in the shell activation paths, for better performance.

Full list of module names
_distutils_hack
_distutils_hack.override
_ruamel_yaml
conda
conda._vendor
conda._vendor.appdirs
conda._vendor.boltons
conda._vendor.boltons.setutils
conda._vendor.boltons.timeutils
conda._vendor.frozendict
conda.activate
conda.auxlib
conda.auxlib.collection
conda.auxlib.compat
conda.auxlib.decorators
conda.auxlib.entity
conda.auxlib.exceptions
conda.auxlib.ish
conda.auxlib.logz
conda.auxlib.packaging
conda.auxlib.type_coercion
conda.base
conda.base.constants
conda.base.context
conda.cli
conda.cli.conda_argparse
conda.cli.main
conda.common
conda.common._os
conda.common._os.linux
conda.common._os.unix
conda.common.compat
conda.common.configuration
conda.common.constants
conda.common.io
conda.common.iterators
conda.common.path
conda.common.serialize
conda.common.signals
conda.common.url
conda.exceptions
conda.gateways
conda.gateways.logging
conda.models
conda.models.channel
cython_runtime
pkg_resources
pkg_resources._vendor
pkg_resources._vendor.appdirs
pkg_resources._vendor.jaraco
pkg_resources._vendor.more_itertools
pkg_resources._vendor.more_itertools.more
pkg_resources._vendor.more_itertools.recipes
pkg_resources._vendor.packaging
pkg_resources._vendor.packaging.__about__
pkg_resources._vendor.packaging._manylinux
pkg_resources._vendor.packaging._musllinux
pkg_resources._vendor.pyparsing
pkg_resources._vendor.pyparsing.actions
pkg_resources._vendor.pyparsing.common
pkg_resources._vendor.pyparsing.core
pkg_resources._vendor.pyparsing.exceptions
pkg_resources._vendor.pyparsing.helpers
pkg_resources._vendor.pyparsing.results
pkg_resources._vendor.pyparsing.testing
pkg_resources._vendor.pyparsing.unicode
pkg_resources._vendor.pyparsing.util
pkg_resources.extern
pkg_resources.extern.appdirs
pkg_resources.extern.jaraco
pkg_resources.extern.jaraco.context
pkg_resources.extern.jaraco.functools
pkg_resources.extern.jaraco.text
pkg_resources.extern.more_itertools
pkg_resources.extern.packaging
pkg_resources.extern.packaging._structures
pkg_resources.extern.packaging.markers
pkg_resources.extern.packaging.requirements
pkg_resources.extern.packaging.specifiers
pkg_resources.extern.packaging.tags
pkg_resources.extern.packaging.utils
pkg_resources.extern.packaging.version
pkg_resources.extern.pyparsing
ruamel
ruamel.yaml
ruamel.yaml.anchor
ruamel.yaml.comments
ruamel.yaml.compat
ruamel.yaml.composer
ruamel.yaml.constructor
ruamel.yaml.cyaml
ruamel.yaml.dumper
ruamel.yaml.emitter
ruamel.yaml.error
ruamel.yaml.events
ruamel.yaml.loader
ruamel.yaml.main
ruamel.yaml.nodes
ruamel.yaml.parser
ruamel.yaml.reader
ruamel.yaml.representer
ruamel.yaml.resolver
ruamel.yaml.scalarbool
ruamel.yaml.scalarfloat
ruamel.yaml.scalarint
ruamel.yaml.scalarstring
ruamel.yaml.scanner
ruamel.yaml.serializer
ruamel.yaml.timestamp
ruamel.yaml.tokens
ruamel.yaml.util
setuptools
setuptools._deprecation_warning
setuptools._distutils
setuptools._entry_points
setuptools._imp
setuptools._importlib
setuptools._itertools
setuptools._path
setuptools._reqs
setuptools._vendor
setuptools._vendor.jaraco
setuptools._vendor.more_itertools
setuptools._vendor.more_itertools.more
setuptools._vendor.more_itertools.recipes
setuptools._vendor.ordered_set
setuptools._vendor.packaging
setuptools._vendor.packaging.__about__
setuptools._vendor.packaging._manylinux
setuptools._vendor.packaging._musllinux
setuptools._vendor.pyparsing
setuptools._vendor.pyparsing.actions
setuptools._vendor.pyparsing.common
setuptools._vendor.pyparsing.core
setuptools._vendor.pyparsing.exceptions
setuptools._vendor.pyparsing.helpers
setuptools._vendor.pyparsing.results
setuptools._vendor.pyparsing.testing
setuptools._vendor.pyparsing.unicode
setuptools._vendor.pyparsing.util
setuptools.command
setuptools.config
setuptools.config._apply_pyprojecttoml
setuptools.config.expand
setuptools.config.pyprojecttoml
setuptools.config.setupcfg
setuptools.depends
setuptools.discovery
setuptools.dist
setuptools.errors
setuptools.extension
setuptools.extern
setuptools.extern.jaraco
setuptools.extern.jaraco.context
setuptools.extern.jaraco.functools
setuptools.extern.jaraco.text
setuptools.extern.more_itertools
setuptools.extern.ordered_set
setuptools.extern.packaging
setuptools.extern.packaging._structures
setuptools.extern.packaging.markers
setuptools.extern.packaging.requirements
setuptools.extern.packaging.specifiers
setuptools.extern.packaging.tags
setuptools.extern.packaging.utils
setuptools.extern.packaging.version
setuptools.extern.pyparsing
setuptools.logging
setuptools.monkey
setuptools.msvc
setuptools.py34compat
setuptools.version
setuptools.windows_support
tlz
tlz._build_tlz
tlz._signatures
tlz._version
tlz.dicttoolz
tlz.functoolz
tlz.itertoolz
tlz.recipes
tlz.utils
toolz
toolz._signatures
toolz._version
toolz.curried
toolz.curried.exceptions
toolz.curried.operator
toolz.dicttoolz
toolz.functoolz
toolz.itertoolz
toolz.recipes
toolz.sandbox
toolz.sandbox.core
toolz.sandbox.parallel
toolz.utils
tqdm
tqdm._dist_ver
tqdm._monitor
tqdm._tqdm_pandas
tqdm.cli
tqdm.gui
tqdm.std
tqdm.utils
tqdm.version
Code injected at the end of conda.cli.main:main
    seen = set()
    for name, _ in sorted(sys.modules.items()):
        pkg = name.split(".")[0]
        if pkg in seen:
            continue
        if pkg in sys.stdlib_module_names:
            continue
        print(name)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant