Skip to content

Omit REQUESTS_CA_BUNDLE from build env defaults - #6083

Open
ryanskeith wants to merge 2 commits into
conda:mainfrom
ryanskeith:fix-6063-requests-ca-bundle-passthrough
Open

Omit REQUESTS_CA_BUNDLE from build env defaults#6083
ryanskeith wants to merge 2 commits into
conda:mainfrom
ryanskeith:fix-6063-requests-ca-bundle-passthrough

Conversation

@ryanskeith

@ryanskeith ryanskeith commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #6063: stop injecting REQUESTS_CA_BUNDLE="" into the build environment when the variable is unset.

Changes

  • Pass it through via get_defaultmechanism so it is only present when set in the host environment.
  • Updated Document the inherited behavior; empty CA paths break TLS clients such as recent botocore (boto/botocore#3751).

Notes for review

  • Left HTTP_PROXY / HTTPS_PROXY on the older os.getenv(..., "") path for now; they have the same pattern and could follow in a follow-up.
  • REQUESTS_CA_BUNDLE is in os_vars so it applies on all platforms (including Windows requests/botocore).

Testing

  • I was undecided if this should be made test.

Here is a LLM generated test used for local testing:

python - <<'PY'
import os, tempfile
from pathlib import Path
from conda_build.config import Config
from conda_build.metadata import MetaData
from conda_build.environ import get_dict

workdir = tempfile.mkdtemp()
recipe = Path(workdir) / "recipe"
recipe.mkdir()
(recipe / "meta.yaml").write_text(
    "package:\n  name: probe\n  version: 0.0.1\n"
    "build:\n  number: 0\n  noarch: generic\n"
    "about:\n  home: https://example.com\n  license: BSD-3-Clause\n  summary: probe\n"
)
m = MetaData(str(recipe), config=Config(croot=workdir, verbose=False, anaconda_upload=False))

os.environ.pop("REQUESTS_CA_BUNDLE", None)
assert "REQUESTS_CA_BUNDLE" not in get_dict(m=m), "unset should omit"

os.environ["REQUESTS_CA_BUNDLE"] = "/tmp/dummy-ca.pem"
assert get_dict(m=m)["REQUESTS_CA_BUNDLE"] == "/tmp/dummy-ca.pem", "set should pass through"
print("ok")
PY

Pass it through via get_default like SSL_CERT_FILE so an empty
value is not injected into subprocess environments (botocore).

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-project-automation github-project-automation Bot moved this to 🆕 New in 🔎 Review Aug 7, 2026
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Aug 7, 2026
@codspeed-hq

codspeed-hq Bot commented Aug 7, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 5 untouched benchmarks


Comparing ryanskeith:fix-6063-requests-ca-bundle-passthrough (5a082be) with main (3b6a390)

Open in CodSpeed

@ryanskeith
ryanskeith marked this pull request as ready for review August 7, 2026 19:43
@ryanskeith
ryanskeith requested a review from a team as a code owner August 7, 2026 19:43
@ryanskeith ryanskeith changed the title omit unset REQUESTS_CA_BUNDLE from build env Omit REQUESTS_CA_BUNDLE from build env defaults Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

botocore error on empty string for environment variables

2 participants